Virtual Try-on Submit API Reference
Virtual Try-On Submit API
POST
/ai/virtual/tryon-pro
Supports uploading individual clothing item image URLs and clothing types. Generates real-time virtual try-on images based on the model image.
Note: This interface is asynchronous. You need to submit a task first, and after obtaining the task ID, call the result query interface to retrieve the generated result. The current API is the first step for task submission. Currently, during testing phase, this API supports receiving up to three requests within 60 seconds. If you require a faster response rate, please contact sales.
Request Parameters
paramJson
String
Yes
The value is a List, but should be transferred to String value.
clothesList
Object[]
Yes
"clothesList" represents a suit of garments, not a batch. "clothesList" can contain 2 elements at most and the 'type' parameter in these elements MUST be 'tops' and 'bottoms' (eg. it does not support 2 tops).
imageUrl
String
Yes
Clothing image URL, with a minimum side length ≥150 pixels and maximum side length ≤6500 pixels.
type
String
No
Type of garments includes:
"tops": Upper body clothing
"bottoms": Lower body clothing
"dresses": One-pieces garments For single clothing try-on, you can leave blank for automatic type recognition. For suits tryon, type is required.
modelImage
String[]
No
A list of URLs for customized model images with maximum 8. Recommend one modelImage per request to get a more stable service.
Sample Request
IopClient client = new IopClientImp(url, appkey, appSecret);
IopRequest request = new IopRequest();
request.setApiName("/ai/virtual/tryon-pro");
request.addApiParameter("paramJson", "[{\"clothesList\":[{\"imageUrl\":\"https://ae-pic-a1.aliexpress-media.com/kf/H7588ee37b7674fea814b55f2f516fda1z.jpg\",\"type\":\"tops\"}],\"modelImage\":[\"http://ai-business-algo-pai.oss-ap-southeast-1.aliyuncs.com/pengxin.zpx%2Fdatasets%2Ftest_images%2F365b8862-71cb-11ef-a6f9-964d09221cfd.png?OSSAccessKeyId=LTAI5tAGoBnm5eYsnZ5E1zMr&Expires=1883910332&Signature=ebJZT4eoEN3kpsSiSpK4minOdRM%3D\"]}]");
IopResponse response = client.execute(request);
System.out.println(response.getBody());
Thread.sleep(10);
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
{
"code": "0",
"data": {
"result": "{\"taskId\":\"1ce4fd33-b9d5-4e21-a24c-0c4027d2b105\"}"
},
"requestId": "212cd83017085872506144758e3fca",
"success": "true",
"resCode": "200",
"resMessage": "success",
"request_id": "0ba2887315178178017221014"
}
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 ([email protected]) 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 ([email protected]) for troubleshooting.
1002
content risk filter failed, please contact us
Content risk failed, please ccontact us via navigation bar or email us ([email protected]).
Last updated
Was this helpful?