OutfitAnyone - Basic Edition API Reference
The OutfitAnyone - Basic Edition model generates realistic try-on images from flat-lay clothing photos and full-body front-facing portraits.
ImportantThis document applies only to the China (Beijing) region. Use an API key from this region.
Quick links: Try it online | OutfitAnyone models overview | Billing and throttling | Free quota | Beginner's guide to API calls |
Related API operations: |
Model capabilities
Various clothing try-on options
| Fine-grained control
|
Model overview
Model introduction
Model name | Billing price | Throttling (shared by Alibaba Cloud accounts and RAM users) | Free quota(View) | |
|---|---|---|---|---|
RPS limit for task submission API | Number of concurrent tasks | |||
aitryon | CNY 0.20/image | 10 | 5 | 400 images |
Note
- Model selection advice: If your scenario requires higher image definition, more detailed clothing textures, and better logo restoration, and you can tolerate a longer wait time, use theaitryon-plus model.
- Billing and throttling: The billing rates and call frequency limits for the aitryon and aitryon-plus models are different. For more information, see Billing.
Model effect demonstration
Input a full-body front-facing photo of the model | Input a flat-lay clothing image | Generated try-on image |
|---|---|---|
| Top flat-lay image
|
|
Bottom flat-lay image
|
Input image requirements
High-quality input ensures high-quality output. Before you call the API, ensure your images meet the following specifications.
Model image requirements
Requirement category | Details |
|---|---|
Image requirements |
|
Model person requirements |
|
Correct model image examples
|
|
|
|
Incorrect character graph example
❌ Multiple people | ❌ Not a full-body front-facing photo (Avoid side views, sitting, lying down, or half-body photos) | ❌ Person or clothing obstructed (Avoid holding objects, bags, etc.) | ❌ Poor lighting/blurry |
|---|---|---|---|
|
|
|
|
Clothing image requirements
Requirement category | Details |
|---|---|
Image requirements |
|
Clothing requirements |
|
Correct clothing image examples
Tops |
|
|
|
Bottoms |
|
|
|
Dresses/Jumpsuits |
|
|
|
Incorrect clothing image examples
❌ Multiple garments | ❌ Not a front-facing photo | ❌ Folded and obstructed | ❌ Wrinkled clothing |
|---|---|---|---|
|
|
|
|
Prerequisites
The OutfitAnyone API can only be invoked through HTTP.
Before you make a call, obtain and configure your API key. The linked topic also describes how to configure the API key as an environment variable.
HTTP calls
The API provides an asynchronous operation. Retrieving the result is a two-step process:
- Create a task: Create an image generation task to obtain a unique task_id.
- Query the result: Use the task_id to poll the task status until the task is complete and the result is retrieved.
Step 1: Create a task
Send a POST request to create a try-on task.
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis
Replace {WorkspaceId} with your actual workspace ID.
Note
- Because this model call has a long processing time, the task is created using an asynchronous call.
- After the task is created, the system immediately returns a
task_id. In the next step, you must use this task_id to query the task result within 24 hours.
Request parameters
Field | Type | Passing parameters | Required | Description | Example |
|---|---|---|---|---|---|
Content-Type | String | Header | Yes | The request type is application/json. | application/json |
Authorization | String | Header | Yes | The API key. Example: Bearer sk-xxxx. | Bearer sk-xxxx |
X-DashScope-Async | String | Header | Yes | A static field set to enable, which indicates an asynchronous call. | enable |
model | String | Body | Yes | The model to call. | aitryon |
input.person_image_url | String | Body | Yes | The public URL of the model's image. You can also get a temporary public URL here.
For model image examples, see Model image requirements. Click here to download the model images we provide. | http://aaa/3.jpg |
input.top_garment_url | String | Body | No | The public URL of the top or dress image. You can also get a temporary public URL here.
For clothing image examples, see Clothing image requirements.
| http://aaa/1.jpg |
input.bottom_garment_url | String | Body | No | The public URL of the bottom clothing image. You can also get a temporary public URL here.
For clothing image examples, see Clothing image requirements.
| http://aaa/2.jpg |
parameters.resolution | Int | Body | No | The resolution of the output image.
If you also need to call the OutfitAnyone - Image Refinement API later, you must set this value to -1. | -1 |
parameters.restore_face | Bool | Body | No | Specifies whether to restore the face from the model's image.
If you also need to call the OutfitAnyone - Image Refinement API later, you must set this value to true. | true |
Response parameters
Field | Type | Description | Example |
|---|---|---|---|
output.task_id | String | The unique ID of the asynchronous task. | a8532587-fa8c-4ef8-82be-0c46b17950d1 |
output.task_status | String | The status of the task after submission. | PENDING |
request_id | String | The unique ID of this request. | 7574ee8f-38a3-4b1e-9280-11c33ab46e51 |
Request examples
Try on a top
- Try on a top: Pass top_garment_url (the top to try on), and the model will randomly generate a bottom.
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "aitryon",
"input": {
"person_image_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/ubznva/model_person.png",
"top_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/epousa/short_sleeve.jpeg"
},
"parameters": {
"resolution": -1,
"restore_face": true
}
}'
-
Keep the model's original bottom: This is a two-step process:
- Call the OutfitAnyone - Image Segmentation API to obtain the URL of the model's bottom image.
- Call the try-on API in this topic, passing top_garment_url (the top to try on) and bottom_garment_url (the bottom URL obtained from segmentation).
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "aitryon",
"input": {
"person_image_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/ubznva/model_person.png",
"top_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/epousa/short_sleeve.jpeg",
"bottom_garment_url": "URL of the image output by the Image Segmentation API"
},
"parameters": {
"resolution": -1,
"restore_face": true
}
}'
Try on a bottom
- Try on a bottom: Pass bottom_garment_url (the bottom to try on), and the model will randomly generate a top.
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "aitryon",
"input": {
"person_image_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/ubznva/model_person.png",
"bottom_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/rchumi/pants.jpeg"
},
"parameters": {
"resolution": -1,
"restore_face": true
}
}'
-
Keep the model's original top: This is a two-step process:
- Call the OutfitAnyone - Image Segmentation API to obtain the URL of the model's top image.
- Call the try-on API in this topic, passing top_garment_url (the top URL obtained from segmentation) and bottom_garment_url (the bottom to try on).
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "aitryon",
"input": {
"person_image_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/ubznva/model_person.png",
"top_garment_url": "URL of the image output by the Image Segmentation API",
"bottom_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/rchumi/pants.jpeg"
},
"parameters": {
"resolution": -1,
"restore_face": true
}
}'
Try on a top and bottom
- Pass top_garment_url (the top to try on) and bottom_garment_url (the bottom to try on).
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "aitryon",
"input": {
"person_image_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/ubznva/model_person.png",
"top_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/epousa/short_sleeve.jpeg",
"bottom_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/rchumi/pants.jpeg"
},
"parameters": {
"resolution": -1,
"restore_face": true
}
}'
Try on a dress/jumpsuit
- For a dress or jumpsuit, just pass top_garment_url.
curl --location 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis' \
--header 'X-DashScope-Async: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "aitryon",
"input": {
"person_image_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/ubznva/model_person.png",
"top_garment_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250626/odngby/dress.jpg"
},
"parameters": {
"resolution": -1,
"restore_face": true
}
}'
Response examples
Successful response
Save the task_id to query the task status and result.
{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}
Error response
Task creation failed. See Error codes.
{
"code": "InvalidApiKey",
"message": "Invalid API-key provided.",
"request_id": "7438d53d-6eb8-4596-8835-xxxxxx"
}
Step 2: Query the result by task ID
Use the task_id from the previous step to send a GET request to query the task status and result. Replace {task_id} in the URL with your actual task ID.
GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
Replace {WorkspaceId} with your actual workspace ID.
Note
- Because an OutfitAnyone task takes 15 to 30 seconds to complete, we recommend using a polling mechanism with a query interval of 3 to 5 seconds to retrieve the result.
- The
image_urlreturned for a successful task is valid for 24 hours. Download and save the image promptly. - The default QPS for this query API is 20. For higher frequency queries or event notifications, configure an asynchronous task callback.
- To query or cancel tasks in batches, see Manage asynchronous tasks.
Request parameters
Field | Type | Passing parameters | Required | Description | Example |
|---|---|---|---|---|---|
Authorization | String | Header | Yes | The API key. Example: Bearer sk-xxx. | Bearer sk-xxx |
task_id | String | Url Path | Yes | The ID of the task to query. | a8532587-fa8c-4ef8-82be-0c46b17950d1 |
Response parameters
Field | Type | Description | Example |
|---|---|---|---|
output.task_id | String | The ID of the queried task. | a8532587-fa8c-4ef8-82be-0c46b17950d1 |
output.task_status | String | The task status. Possible values include the following:
| SUCCEEDED |
output.image_url | String | The URL of the generated try-on image. The image_url is valid for 24 hours. Download it promptly. | |
output.submit_time | String | Task submission time. | 2024-07-30 15:39:39.918 |
output.scheduled_time | String | The running time of the job. | 2024-07-30 15:39:39.941 |
output.end_time | String | Task completion time. | 2024-07-30 15:39:55.080 |
output.code | String | Error code. This parameter is returned when the task fails. | InvalidParameter |
output.message | String | Error details. This parameter is returned when the task fails. | The request is missing required parameters or in a wrong format |
usage.image_count | Int | The number of images generated for this request. | 1 |
request_id | String | The unique ID of this request. | 7574ee8f-38a3-4b1e-9280-11c33ab46e51 |
Request example
Replace 86ecf553-d340-4e21-xxxxxxxxx with the actual task_id.
curl -X GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/86ecf553-d340-4e21-xxxxxxxxx \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
NoteYou can query a task result using its task_id for only 24 hours. After this period, the system automatically purges the result.
Response examples
Successful response
Task data, such as the task status and image URL, is retained for only 24 hours and is then automatically purged. Save the generated image promptly.
{
"request_id": "98d46cd0-1f90-9231-9a6c-xxxxxx",
"output": {
"task_id": "15991992-1487-40d4-ae66-xxxxxx",
"task_status": "SUCCEEDED",
"submit_time": "2025-06-30 14:37:53.838",
"scheduled_time": "2025-06-30 14:37:53.858",
"end_time": "2025-06-30 14:38:11.472",
"image_url": "http://dashscope-result-hz.oss-cn-hangzhou.aliyuncs.com/tryon.jpg?Expires=xxx"
},
"usage": {
"image_count": 1
}
}
Failed response
{
"request_id": "6bf4693b-c6d0-933a-b7b7-xxxxxx",
"output": {
"task_id": "e32bd911-5a3d-4687-bf53-xxxxxx",
"task_status": "FAILED",
"code": "InvalidParameter",
"message": "The request is missing required parameters xxxxx"
}
}
Error codes
For common status codes of the large model service, see Error codes.
The following error codes are specific to the OutfitAnyone model:
HTTP status code | Error code (code) | Error message (message) | Description |
|---|---|---|---|
400 | InvalidParameter | The request is missing required parameters or in a wrong format, please check the parameters that you send. | A required parameter is missing or a parameter is in an incorrect format. Check if your request body complies with the API specifications. |
400 | InvalidParameter | Download the media resource timed out during the data inspection process. | Image download timed out. Possible causes and solutions are as follows:
|
400 | InvalidURL | The request URL is invalid, please check the request URL is available and the request image format is one of the following types: JPEG, JPG, PNG, BMP, and WEBP. | The image URL is invalid. Check if the URL is a public address and if the image format is supported. |
400 | InvalidPerson | The input image has no human body or multi human bodies. Please upload other image with single person. | The model image is non-compliant. Make sure the input image contains one and only one complete person. |
400 | InvalidGarment | Missing clothing image.Please input at least one top garment or bottom garment image. | Clothing image is missing. Provide at least one top (top_garment_url) or bottom (bottom_garment_url) image. |
400 | InvalidInputLength | The image resolution is invalid, please make sure that the largest length of image is smaller than 4096, and the smallest length of image is larger than 150. and the size of image ranges from 5KB to 5MB. | The image dimensions or file size do not meet the requirements. For more information, see Input image requirements. |
FAQ
How to prepare model and clothing images
-
Why must I use a flat-lay clothing image?
A flat-lay image most clearly shows the cut, pattern, and silhouette of the clothing. This helps the AI accurately understand the garment's structure and generate a more realistic and better-fitting try-on effect.
-
What if I do not have a flat-lay clothing image?
You can try placing the garment flat on a clean background, such as the floor or a wall, and taking a top-down photo. Alternatively, you can have a real model or a mannequin wear the garment and take a front-facing photo. The key is to ensure the garment is displayed completely, lies flat, and is unobstructed.
-
How do I choose a suitable model image?
Choose a clear, complete, front-facing, full-body photo. The model should wear simple, form-fitting clothes (such as a T-shirt and shorts). Avoid long skirts, robes with wide sleeves, or multiple layers. Also, make sure the model's hands and feet are clearly visible and not blocked by accessories such as bags or umbrellas.
-
What if I do not have a suitable model image?
We provide a set of compliant reference model images. You can click here to download and use them.
Model effect is not as expected
-
Why is the generated image quality poor and lacking in detail?
The main reason is likely the low quality of the input clothing image. Make sure the clothing image is high-definition and complete, without any loss of detail due to folds or poor shooting angles. High-quality input is essential for high-quality output.
Feature usage questions
-
How do I generate a try-on image for a dress or jumpsuit?
Enter the image URL of the dress or jumpsuit in the
input.top_garment_urlfield, and leave theinput.bottom_garment_urlfield empty or omit it.
Billing and throttling
For questions about OutfitAnyone billing and throttling, see FAQ.
























