Virtual Try-On — Clothes
Generate a realistic preview of a garment worn by a person from a model photo and a garment image.
Put a garment on a person. Submit a photo of the person (model_image) and an
image of the garment (garment_image); the API returns a job id you poll on the
Job Status endpoint until the result is ready.
POST
https://tryiton.now/api/v1/tryon/clothes
All image fields accept either a public URL or a base64 data URL
(data:image/png;base64,...).
Request
Use an official SDK (recommended) or call the endpoint directly.
import { TryItOn } from "tryiton";
const client = new TryItOn({ apiKey: process.env.TRYITON_API_KEY });
const jobId = await client.tryOnClothes({
modelImage: "https://example.com/model.jpg",
garmentImage: "https://example.com/garment.jpg",
category: "clothing",
subcategory: "tops",
});
const [resultUrl] = await client.waitForResult(jobId);import os
from tryiton import TryItOn
client = TryItOn(api_key=os.environ["TRYITON_API_KEY"])
job_id = client.try_on_clothes(
model_image="https://example.com/model.jpg",
garment_image="https://example.com/garment.jpg",
category="clothing",
subcategory="tops",
)
urls = client.wait_for_result(job_id)curl -X POST https://tryiton.now/api/v1/tryon/clothes \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model_image": "https://example.com/model.jpg",
"garment_image": "https://example.com/garment.jpg",
"category": "clothing",
"subcategory": "tops"
}'Body Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
model_image | string | — | Required. URL or base64 data URL of the person. |
garment_image | string | — | Required. URL or base64 data URL of the item. |
category | string | auto | What the item is. auto detects it for you, or pass one of clothing, eyewear, footwear, headwear, jewelry, accessories, others. See Categories & subcategories. |
subcategory | string | — | Refines the placement. Required for clothing, jewelry, and accessories; omit it for single-placement categories. See Categories & subcategories. |
mode | string | balanced | Quality/speed trade-off: performance, balanced, or quality. (Clothing only.) |
num_samples | integer | 1 | Number of output images to generate (1–4). Charged per output image. (Clothing only — other categories always return a single image.) |
output_format | string | png | Output image format: png or jpeg. (Clothing only.) |
seed | integer | 42 | Fixes randomness so the same inputs reproduce the same result. (Clothing only.) |
segmentation_free | boolean | true | Advanced. Let the model place the garment without an explicit mask. (Clothing only.) |
garment_photo_type | string | auto | Advanced. Hint about the garment photo: auto, model, or flat-lay. (Clothing only.) |
moderation_level | string | permissive | Advanced. Content moderation strictness. (Clothing only.) |
Categories & subcategories
Pass category (and a subcategory where required) to tell the API what the
item is and where it belongs on the body. auto inspects garment_image and
picks for you — a good default when you don't know the item type up front.
category | Valid subcategory values | subcategory |
|---|---|---|
auto | — | omit (detected for you) |
clothing | auto, tops, bottoms, dresses | required |
eyewear | — | omit |
footwear | — | omit |
headwear | — | omit |
jewelry | rings, earrings, necklaces, bracelets, anklets | required |
accessories | watches, belts, scarves | required |
others | — | omit |
// Clothing — pick the garment area
{ "category": "clothing", "subcategory": "tops" }
// Accessory — pick where it sits
{ "category": "jewelry", "subcategory": "necklaces" }
// Single-placement category — no subcategory
{ "category": "eyewear" }Routing. clothing is rendered by our clothing engine and honors the
clothing-only parameters above (including num_samples). Every other category
is rendered by our accessory engine and always returns one image. Either
way you get a jobId to poll — the flow is identical.
Response
A successful submission returns a jobId. Poll
/api/v1/status/{jobId} until status is
completed.
201 Created
{
"ok": true,
"jobId": "64b7f1a9d9a3b8e5c7f9a123"
}Credits: 1 credit per output image. With num_samples: 3 you are charged 3
credits. Failed jobs are never charged.