API reference · FASHN
fashn/tryon/v1.5
Integrate this model through SandBase's unified API, with production-ready schemas and examples.
Production endpoint
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
POST
https://api.sandbase.ai/v1/runModel ID
fashn/tryon/v1.501
Input Schema
9 parameters · 0 required · 9 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
seed | integer | Optional | Sets random operations to a fixed state. Use the same seed to reproduce results with the same inputs, or different seed to force different results. |
category | string | Optional | Category of the garment to try-on. 'auto' will attempt to automatically detect the category of the garment. · Options: tops, bottoms, one-pieces, auto · Default: "auto" topsbottomsone-piecesauto |
model_image | string | Optional | URL or base64 of the model image |
num_samples | integer | Optional | Number of images to generate in a single run. Image generation has a random element in it, so trying multiple images at once increases the chances of getting a good result. · Min: 1 · Max: 4 · Default: 1 |
garment_image | string | Optional | URL or base64 of the garment image |
output_format | string | Optional | Output format of the generated images. 'png' is highest quality, while 'jpeg' is faster · Options: png, jpeg · Default: "png" pngjpeg |
moderation_level | string | Optional | Content moderation level for garment images. 'none' disables moderation, 'permissive' blocks only explicit content, 'conservative' also blocks underwear and swimwear. · Options: none, permissive, conservative · Default: "permissive" nonepermissiveconservative |
segmentation_free | boolean | Optional | Disables human parsing on the model image. · Default: true |
garment_photo_type | string | Optional | Specifies the type of garment photo to optimize internal parameters for better performance. 'model' is for photos of garments on a model, 'flat-lay' is for flat-lay or ghost mannequin images, and 'auto' attempts to automatically detect the photo type. · Options: auto, model, flat-lay · Default: "auto" automodelflat-lay |
02
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
03
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "fashn/tryon/v1.5",
"category": "auto",
"model_image": "https://static.sandbase.ai/examples/fashn/tryon/v1.5/input_model_image_1.bin",
"num_samples": 1,
"garment_image": "https://static.sandbase.ai/examples/fashn/tryon/v1.5/input_garment_image_0.bin",
"output_format": "png",
"moderation_level": "permissive",
"segmentation_free": true,
"garment_photo_type": "auto",
"prompt": "a beautiful sunset over mountains"
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"
