Unlimited Open Source Models

Get Plan
Skip to main content
Fashion API

Virtual Try-On API for Fashion and E-commerce

Send a photo of a person and a photo of a garment to POST /api/v6/image_editing/fashion. The API returns the person wearing the garment in about 30 seconds, for $0.02 per try-on image. Tops, bottoms and dresses are supported.

Last updated · By ModelsLab Engineering

What the virtual try-on API does

A try-on in one API call

The ModelsLab virtual try-on API takes two images: `init_image`, a photo of the person, and `cloth_image`, a flat-lay or product photo of the garment. Set `cloth_type` to `upper_body`, `lower_body` or `dresses` and add a short prompt. The response is a new image of the same person, in the same pose, wearing the garment.

A try-on costs $0.02 and usually finishes in about 30 seconds. The job runs on GPUs that ModelsLab hosts, so no third-party provider sits between your request and the result.

Who uses a fashion API like this

Online stores use it to show every product on a model without a photo shoot. Marketplaces let shoppers upload a selfie and see an item on themselves before they buy. Brands use it to make lookbook and social images for new drops in hours instead of weeks.

Because the input is a plain garment photo, the same catalogue images you already have for product pages are enough to start.

Virtual try-on API quick start

One POST with two image URLs. Poll the fetch endpoint or pass a webhook while the job runs.

curl

bash
1curl -X POST https://modelslab.com/api/v6/image_editing/fashion \
2 -H "Content-Type: application/json" \
3 -d '{
4 "key": "YOUR_API_KEY",
5 "init_image": "https://assets.modelslab.ai/generations/1f68ebc4-8306-4c3d-9e3c-ff69f41906d4",
6 "cloth_image": "https://assets.modelslab.ai/generations/47f52677-2761-46c3-9d5b-d039b8dfc1a1",
7 "cloth_type": "upper_body",
8 "prompt": "A realistic photo of a model wearing a beautiful t-shirt",
9 "negative_prompt": "low quality, unrealistic, warped cloth"
10 }'

Python

python
1import time
2import requests
3
4API_KEY = "YOUR_API_KEY"
5
6job = requests.post(
7 "https://modelslab.com/api/v6/image_editing/fashion",
8 json={
9 "key": API_KEY,
10 "init_image": "https://assets.modelslab.ai/generations/1f68ebc4-8306-4c3d-9e3c-ff69f41906d4",
11 "cloth_image": "https://assets.modelslab.ai/generations/47f52677-2761-46c3-9d5b-d039b8dfc1a1",
12 "cloth_type": "upper_body",
13 "prompt": "A realistic photo of a model wearing a beautiful t-shirt",
14 },
15).json()
16
17# A queued job returns status "processing" and a fetch_result URL.
18# Save that URL once, then POST it with your key until the job finishes.
19fetch_url = job.get("fetch_result")
20while job.get("status") == "processing":
21 time.sleep(10)
22 job = requests.post(fetch_url, json={"key": API_KEY}).json()
23
24if job.get("status") != "success":
25 raise RuntimeError(job.get("message", job))
26
27print(job["output"])

Request parameters

The main fields POST /api/v6/image_editing/fashion accepts.

ParameterRequiredValuesWhat it does
keyYesstringYour ModelsLab API key
init_imageYesimage URLPhoto of the person who tries on the garment
cloth_imageYesimage URLPhoto of the garment (flat-lay or product shot)
cloth_typeYesupper_body, lower_body, dressesWhich part of the outfit to replace
promptYestextShort description of the result you want
negative_promptNotextThings to keep out of the image
seedNonumberFix the seed to repeat a result
guidance_scaleNo1 to 20 (default 7.5)How closely to follow the prompt
mask_imageNoimage URLLimit the edit to a masked area
base64Notrue / falseSend init_image as base64 data instead of a URL
webhookNoURLWe POST the result here when the job finishes
track_idNoidYour own id, echoed back in the webhook

Send images as public URLs. The API decides the output size from the person photo.

Virtual try-on API pricing

Each try-on image costs $0.02 and draws from your plan allowance. The Open Source Unlimited plan includes virtual try-on.

PlanPriceTry-on images per monthEffective cost per try-on
Basic$21/monthabout 1,050$0.02
Standard$47/monthabout 2,350$0.02
Open Source Unlimited$149/monthno per-image capfalls as volume grows

ModelsLab plans and the $0.02 rate checked against the live plans table on 2026-09-23. There is no free tier: creating an account is free, API access starts at $21/month.

ModelsLab vs FASHN AI API

The two virtual try-on APIs developers ask us about most.

ModelsLabFASHN AI API
Entry price$21/month plan$0.075 per credit on demand, or $19/month for 282 credits
Price per try-on image$0.02Billed in credits
Unlimited option$149/month Open Source UnlimitedNo
Other APIs on the same key10,000+ models: image, video, audio, LLMFashion only
WebhooksYesYes

FASHN prices from fashn.ai/pricing, checked 2026-09-23. FASHN bills in credits; check their docs for how many credits each try-on uses.

Building an AI clothes changer into your store

Product page try-on

Run the try-on when a product is created, not when a shopper opens the page. A small serverless function can listen for new products, call the API with a few stock model photos, and save the output URLs to the product. Shoppers then see the garment on a person with no wait.

Shopper selfie try-on

For a "try it on me" button, upload the shopper photo to your own storage, pass its URL as `init_image`, and pass a `webhook` so your backend is told when the image is ready. Keep the shopper photo only as long as you need it.

Getting the best results

Use a front-facing person photo with the body in view and arms away from the torso. Use a garment photo on a plain background. Pick the `cloth_type` that matches the garment: a jacket is `upper_body`, jeans are `lower_body`, a full-length dress is `dresses`.

Get Expert Support in Seconds

We're Here to Help.

Want to know more? You can email us anytime at support@modelslab.com

View Docs

A virtual try-on API takes a photo of a person and a photo of a garment and returns an image of that person wearing the garment. On ModelsLab you POST both image URLs to https://modelslab.com/api/v6/image_editing/fashion with cloth_type set to upper_body, lower_body or dresses, plus a short prompt.

Each try-on image costs $0.02, drawn from your plan allowance: about 1,050 try-ons on Basic ($21/month) and about 2,350 on Standard ($47/month). The $149/month Open Source Unlimited plan includes virtual try-on with no per-image cap.

No. ModelsLab has no free tier. Creating an account is free, and API access starts with the $21/month Basic plan.

Set cloth_type to upper_body for tops, shirts and jackets, lower_body for trousers, jeans and skirts, and dresses for full-length dresses. Use a garment photo on a plain background for the best result.

About 30 seconds. If the image is not ready when the call returns, the response has status "processing" and a fetch_result URL (https://modelslab.com/api/v6/image_editing/fetch/{id}) to poll. You can also pass a webhook URL and a track_id to be told when it finishes.

FASHN lists its API at $0.075 per credit on demand, or $19/month for 282 credits (fashn.ai/pricing, checked 2026-09-23). ModelsLab charges $0.02 per try-on image, offers a $149/month unlimited plan, and the same API key also runs 10,000+ image, video, audio and LLM models.

Yes. Any clear photo of a person works as init_image, including a shopper selfie uploaded to your own storage. Send images as URLs, or set base64 to true to send the person photo as base64 data instead.