Virtual Try-on Submit API Reference
Virtual Try-On Submit API
POST
/ai/virtual/tryon
Supports uploading individual clothing item image URLs and clothing types. Generates real-time virtual try-on images based on the selected model type.
Request Parameters
The request parameter is requestParams, which is of type Object[]. The internal structure is as follows:
clothesList
Object[]
Yes
A list of images for virtual try-on. Currently, only single garment try-on is supported.
imageUrl
String
Yes
URL of the clothing image. The resolution should be greater than 500x500 pixels and up to a maximum of 3000x3000 pixels.
type
String
No
The types of clothing.
"tops": Upper body clothing such as T-shirts, shirts, sweatshirts, pullovers, etc.
"bottoms"(beta): lower body clothing such as pants, skirts, etc.
"dresses": Single-piece garments such as dresses, long coats, jumpsuits, etc.
Default automatic recognition of clothing types is available, but manual input is more effective.
modelImage
String[]
No
A list of URLs for user-uploaded model images. If provided, these images will be prioritized for generating results. The number of generated images will depend on the number of model images you upload. If no model images are provided, you can use the model parameter to select a model from the model library. A maximum of 8 model images can be processed in a single request.
Example: ["URL1", "URL2"]
Default is empty.
model
Object
No
Users can select the type of model or a specific model from the model base.
base
String
No
Specifies the model library to be used. If a customized model library is available for your business, you can call the customized model library by providing the specific scene code if exists.
"General": General model library.
Default is "General".
name
String
No
The name of the model. You can specify a particular model from the model library by providing the model's name. Refer to the model library documentation for the list of available model names. Once a model name is specified, the other model parameters will become ineffective.
Example: "Ariel"
Default is empty.
gender
String
No
The gender of the model for virtual try-on:
"male": Male model
"female": Female model
Default is "female".
style
String
No
The style of the model for virtual try-on
"universal_1":example1
"universal_2":example2
"universal_3":example3
If using a customized model for your business, please refer to the model base reference doc for specific style tags.
body
String
No
The body type of the model for virtual try-on
"slim": slim model
"curvy": plus-size model
Default is "slim".
viewType
String
No
The perspective for the generated images:
"fullbody": Full body view
"halfbody": Half body view
"mixed": Mixed full body and half body views
Default is "fullbody".
generateCount
Number
No
The number of images to be generated, supporting an input range of 1 to 8.
Default is 4.
inputQualityDetect
Number
No
Whether to automatically filter out low-quality or incomplete flat-lay input images:
"1": Yes, filter low-quality images
"0": No, do not filter low-quality images
Default is 0. It is recommended to enable this option in batch scenarios or when image quality is inconsistent.
Sample Request
Specify the model type for virtual try-on:
Specify the model for virtual try-on:
Upload your own model image for virtual try-on:
Response Parameters
resCode
Number
The returned result code, where 200 indicates success. For detailed error codes, please refer to the error code list.
data
Object
The returned JSON result data. the task id can be used to query the generation api to obtain results
requestId
String
A unique request ID used for troubleshooting.
success
Boolean
The status of the returned request, indicating whether the request was successful.
resMessage
String
The returned request information.
Sample Response
Error Code
500
system error
System error.
501
rate limit exceed
The current interface has reached the current limit. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) to increase the current limit value.
700
invalid input
The format of the input parameters does not meet the requirements, and resMessage will return detailed fields that do not meet the requirements.
701
Clothing image dowloading failed, please try another input
Clothing image dowloading failed, please try another image url.
703
Input clothes image resoulution low, please try other image
The resolution of the clothing image does not meet the requirements. Please try another image.
707
Input clothing image is not a complete flat lay. Please try another image.
The clothing image is not a complete flat lay and does not meet the quality requirements for virtual try-on. Please try another image.
1001
content control failed, please retry
Content risk failed, please try other input. If an error persists,please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting.
1002
content risk filter failed, please contact us
Content risk failed, please ccontact us via navigation bar or email us (aidge_support@service.alibaba.com).
Last updated