Skip to main content

POST /tryon-api

Generate a virtual try-on by combining a shopper photo with a product image.

Endpoint

Request body

Image formats

Both userPhoto and productImage accept a public URL or a Base64 string. URL (recommended for server-to-server):
Base64 with data URI prefix:
Base64 raw (without prefix):

Wedding-dress mode (train rendering)

The try-on engine normally drops the train of long / wedding gowns. Set productType: "wedding-dress" to render the full gown including the train spread on the floor. Example request
Only productType: "wedding-dress" is specific to bridal mode — every other field is identical to a standard try-on.

Train evaluation and refunds

After generation, the engine scores how well the train (the gown’s trailing fabric) was rendered. The verdict is returned in the bridal object:
  • bridal.applied: true → the train was rendered satisfactorily. 2 credits are consumed.
  • bridal.applied: false → the train was not rendered (low trainScore). No credit is consumed — both credits are refunded and the result is still delivered without regeneration.
This mode consumes 2 credits (a standard try-on consumes 1).
  • If the train verdict is unsatisfactory (bridal.applied: false) → both credits are refunded (no credit consumed).
  • If the generation fails outright → both credits are refunded.
  • If only the train pre-treatment can’t run → the extra credit is refunded and you are billed a single credit for the standard try-on that is still delivered.

Best results

  • Both the customer and the gown photos should be full-length, front-facing, standing.
  • A cropped, angled, or partial customer photo noticeably degrades the result.
Never breaks. If the pre-treatment can’t run, the request falls back to a standard try-on (gown rendered without the train) — it does not return an error.

Success response — 200 OK

Train not rendered (verdict fail)

When bridal.applied is false, the train was not rendered. Both credits are refunded and the result is still delivered — there is no regeneration.
trainScore may be null if the sidecar /score endpoint is unavailable. The result is still delivered, but without a refund (the verdict could not be evaluated).

Error responses

If the wedding-dress pre-processing crashes, the request returns:
HTTP 503 — generation is cancelled and fully refunded.
A 404 from Cloudflare ({"error":"requested path is invalid"}, with a CF-RAY header) means the request URL is wrong — not a Wearo error. Double-check the path is /functions/v1/tryon-api and that your key is sent as the X-API-Key header, never as a query parameter.
Full error reference →

Code examples

See Code examples → for curl, Node, Python, PHP, and Ruby.