Skip to content
English

Google Virtual Try-On API

POST Base URL: 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 natural-looking try-on images, up to 4 per request.

Production guidance

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

E-commerce on-model shots

Show one garment on different models without a photo shoot.

person_image_urlproduct_image_url
Outfit comparison

Try several garments on the same person to compare looks.

product_image_url
Multiple options

Generate 1–4 images per request and pick the best one.

num_images

Request parameters

model string required

Fixed value google-virtual-try-on.

example 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

How many try-on images to generate, 1-4. Billed per requested image.

default 1
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; HTTPS URL that receives terminal task notifications.

example https://your-domain.com/hiapi/callback
when enum optional

Callback trigger timing. Use final.

default final enum: final

Example requests

Single try-on

One person photo and one garment photo, one result.

Request body
{
  "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
  }
}
Four options at once

Four results from the same inputs, billed per image.

Request body
{
  "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": 4
  }
}

Getting the result

  1. The response returns a taskId immediately without waiting for generation to finish.
  2. In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status=success, download the generated image from output[].url.
  4. 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 requested image (num_images). See the live prices on the HiAPI pricing page. View pricing

Next steps