OutfitAnyone - Basic Edition API Reference

Updated at:

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: api OutfitAnyone - Plus Edition | api OutfitAnyone - Image Refinement | api OutfitAnyone - Image Segmentation

Model capabilities

Various clothing try-on options

  • Single top try-on: The model randomly generates a bottom or keeps the model's original bottom.

  • Single bottom try-on: The model randomly generates a top or keeps the model's original top.

  • Top and bottom combination try-on: Replaces the entire outfit.

  • Dress/jumpsuit try-on

Fine-grained control

  • Face policy: Choose to keep the model's original face or generate a new, random face.

  • Resolution specification: Specify the output image dimensions or retain the original image dimensions.

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

test_client_tryon

Top flat-lay image

image.jpeg

test_client_tryon

Bottom flat-lay image

image.jpeg

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

  • File size: 5 KB to 5 MB.

  • Resolution: Both the width and height of the image must be between 150 px and 4096 px.

  • Image format: JPG, JPEG, PNG, BMP, and HEIC are supported.

  • URL requirement: The uploaded image must have a public HTTP/HTTPS URL. Local paths are not supported.

Model person requirements

  • Person requirements: Images of people of different genders, skin tones, and ages (6 years and older) are supported.

  • Pose requirements: A full-body front-facing photo with good lighting. The person's hands must be fully visible. Avoid crossed arms or other obstructions.

  • Subject requirement: The image must contain one and only one complete person.

Correct model image examples

image.png

image.png

image.png

image.png

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

image.png

image

image.png

image.png

Clothing image requirements

Requirement category

Details

Image requirements

  • File size: 5 KB to 5 MB.

  • Resolution: Both the width and height of the image must be between 150 px and 4096 px.

  • Image format: JPG, JPEG, PNG, BMP, and HEIC are supported.

  • URL requirement: The uploaded image must have a public HTTP/HTTPS URL. Local paths are not supported.

Clothing requirements

  • Clothing type: Single tops, bottoms, and dresses are supported. Sets and top-and-bottom combinations are also supported.

  • Clothing category: Common clothing categories are supported. Underwear, wedding dresses, and traditional ethnic clothing are not supported.

  • Clothing requirements:

    • Single garment: The image must be a flat-lay photo containing only one piece of clothing.

    • No folds or obstructions: The clothing should be spread out, flat, and free of wrinkles or folds.

    • Simple and clean background: The image background must be simple, clean, and have a uniform color. The clothing subject must be clear, without complex lighting or shadows.

    • Large clothing proportion: The clothing should take up as much of the frame as possible. Avoid excessive white space around the garment, as it can reduce the quality of the try-on effect.

Correct clothing image examples

Tops

image.jpeg

image.jpeg

image.jpeg

Bottoms

image.jpeg

image.jpeg

image.webp

Dresses/Jumpsuits

image.webp

image.webp

Dress sample 2

Incorrect clothing image examples

❌ Multiple garments

❌ Not a front-facing photo

❌ Folded and obstructed

❌ Wrinkled clothing

image.jpeg

image.png

image.png

image.png

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:

  1. Create a task: Create an image generation task to obtain a unique task_id.
  2. 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.

  • 5 KB ≤ Image file size ≤ 5 MB

  • 150 ≤ Image side length ≤ 4096

  • Supported formats: jpg, png, jpeg, bmp, heic

  • The image must contain one and only one complete person.

  • Only HTTP/HTTPS URLs are supported. Local paths are not supported.

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.

  • 5 KB ≤ Image file size ≤ 5 MB

  • 150 ≤ Image side length ≤ 4096

  • Supported formats: jpg, png, jpeg, bmp, heic

  • Upload a flat-lay clothing image. The garment must be the sole subject and be displayed in full against a clean background. Avoid excessive white space around the edges.

  • Only HTTP/HTTPS URLs are supported. Local paths are not supported.

For clothing image examples, see Clothing image requirements.

  • You must provide at least one of top_garment_url or bottom_garment_url.

  • If you do not pass this field, the model randomly generates a top.

  • For a dress or jumpsuit, enter the image URL in this field and leave bottom_garment_url empty.

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.

  • 5 KB ≤ Image file size ≤ 5 MB

  • 150 ≤ Image side length ≤ 4096

  • Supported formats: jpg, png, jpeg, bmp, heic

  • Upload a flat-lay clothing image. The garment must be the sole subject and be displayed in full against a clean background. Avoid excessive white space around the edges.

  • Only HTTP/HTTPS URLs are supported. Local paths are not supported.

For clothing image examples, see Clothing image requirements.

  • You must provide at least one of top_garment_url or bottom_garment_url.

  • If you do not pass this field, the model randomly generates a bottom.

http://aaa/2.jpg

parameters.resolution

Int

Body

No

The resolution of the output image.

  • -1: Default value. The output image has the same dimensions as the original image.

  • 1024: Represents a resolution of 576 × 1024.

  • 1280: Represents a resolution of 720 × 1280.

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.

  • true: Default value. Keeps the original face.

  • false: Generates a new, random face.

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:

    1. Call the OutfitAnyone - Image Segmentation API to obtain the URL of the model's bottom image.
    2. 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:

    1. Call the OutfitAnyone - Image Segmentation API to obtain the URL of the model's top image.
    2. 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_url returned 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:

  • PENDING: Queued

  • PRE-PROCESSING: Pre-processing

  • Processing

  • POST-PROCESSING: Post-processing

  • Succeeded

  • FAILED: Failed

  • UNKNOWN: The task does not exist or its status is unknown.

  • CANCELED: The task was successfully canceled.

SUCCEEDED

output.image_url

String

The URL of the generated try-on image.

The image_url is valid for 24 hours. Download it promptly.

https://.../result.jpg?Expires=xxx

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:

  • Network issue: Your server may not be able to connect to the Alibaba Cloud Model Studio service. Check your network connection.

  • OSS internal URL: The Alibaba Cloud Model Studio service cannot access internal network addresses. Use a public OSS URL instead.

  • Resource outside the Chinese mainland: Cross-border network access is unstable. Use a storage service in the Chinese mainland.

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

  1. 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.

  2. 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.

  3. 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.

  4. 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

  1. 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

  1. 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_url field, and leave the input.bottom_garment_url field empty or omit it.

Billing and throttling

For questions about OutfitAnyone billing and throttling, see FAQ.