Google Virtual Try-On API
https://api.hiapi.ai /v1/tasks Image, video, and audio models are called through theUnified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).
Model summary
| Model name | google-virtual-try-on |
|---|---|
| Type | Image generation (image-to-image) |
| Endpoint | POST /v1/tasks |
| Pricing | See HiAPI Pricing |
Google Virtual Try-On puts a garment from a product photo onto a person photo and returns a natural-looking try-on image, one per request.
Production guidance
- For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
- GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
- Use callback.when=final. Both success and fail are terminal states, so your service should deduplicate by taskId.
Best suited for
Show one garment on different models without a photo shoot.
person_image_urlproduct_image_urlTry several garments on the same person to compare looks.
product_image_urlEach request returns one image; submit the same inputs a few times and pick the best one.
person_image_urlproduct_image_urlRequest parameters
model string required Fixed value google-virtual-try-on.
input object required Business parameters. Put Google Virtual Try-On-specific configuration here.
person_image_url string required http(s) URL of a photo of the person who will wear the garment.
product_image_url string required http(s) URL of a product photo of the garment to try on.
num_images integer optional One output image per request. num_images must be 1; it can be omitted.
callback object optional Optional callback configuration. When set, HiAPI notifies your service when the task reaches a terminal state.
url string required Required when callback is set; http(s) URL that receives terminal task notifications.
when enum optional Callback trigger timing. Use final.
Example requests
One person photo and one garment photo, one result.
{
"model": "google-virtual-try-on",
"input": {
"person_image_url": "https://example.com/person.png",
"product_image_url": "https://example.com/garment.png",
"num_images": 1
}
}The same person photo with a suit jacket, one result.
{
"model": "google-virtual-try-on",
"input": {
"person_image_url": "https://example.com/person.png",
"product_image_url": "https://example.com/suit-jacket.png",
"num_images": 1
}
}Getting the result
- The response returns a taskId immediately without waiting for generation to finish.
- In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
- When status=success, download the generated image from output[].url.
- When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.
FAQ
Do I need a prompt?
No. Send only the person photo and the garment photo.
Which photos work best?
A front-facing full-body or half-body person photo with even light, and a flat-lay or hanging garment photo on a clean background.
What URLs are accepted?
Both fields must be publicly reachable http(s) URLs; data URIs are not accepted.
How is it billed?
Per image, one image per request. See the live prices on the HiAPI pricing page. View pricing