TryItOn
API Reference

Virtual Try-On — Fashion

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/fashion

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.tryOnFashion({
  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_fashion(
    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/fashion \
     -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.
output_formatstringpngOutput image format: png or jpeg.
moderation_levelstringpermissiveContent moderation strictness: conservative, permissive, or none. See Moderation levels. (Clothing only.)

Moderation levels

moderation_level controls how strictly garment content is filtered.

ValueBehavior
conservativeEnforces stricter modesty standards suitable for culturally sensitive contexts. Blocks underwear, swimwear, and revealing outfits.
permissive(Default.) Allows swimwear, underwear, and revealing garments, while still blocking explicit nudity.
noneDisables all content moderation.

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, scarves, bags, gloves, tiesrequired
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 (mode, moderation_level). Every other category is rendered by our accessory engine. Both engines support num_samples (1–4) and output_format. 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