TryItOn
API Reference

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

ParameterTypeDefaultDescription
model_imagestringRequired. URL or base64 data URL of the person.
garment_imagestringRequired. URL or base64 data URL of the item.
categorystringautoWhat the item is. auto detects it for you, or pass one of clothing, eyewear, footwear, headwear, jewelry, accessories, others. See Categories & subcategories.
subcategorystringRefines the placement. Required for clothing, jewelry, and accessories; omit it for single-placement categories. See Categories & subcategories.
modestringbalancedQuality/speed trade-off: performance, balanced, or quality. (Clothing only.)
num_samplesinteger1Number of output images to generate (1–4). Charged per output image. (Clothing only — other categories always return a single image.)
output_formatstringpngOutput image format: png or jpeg. (Clothing only.)
seedinteger42Fixes randomness so the same inputs reproduce the same result. (Clothing only.)
segmentation_freebooleantrueAdvanced. Let the model place the garment without an explicit mask. (Clothing only.)
garment_photo_typestringautoAdvanced. Hint about the garment photo: auto, model, or flat-lay. (Clothing only.)
moderation_levelstringpermissiveAdvanced. 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.

categoryValid subcategory valuessubcategory
autoomit (detected for you)
clothingauto, tops, bottoms, dressesrequired
eyewearomit
footwearomit
headwearomit
jewelryrings, earrings, necklaces, bracelets, ankletsrequired
accessorieswatches, belts, scarvesrequired
othersomit
// 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.

On this page