Virtual Try-On Query API Reference

Virtual Try-On Query API

Standard Ver: POST /ai/virtual/tryon-results

Retrieve the results of virtual try-on standard&pro sessions.

Request Parameters

Parameter
Type
Required
Description

task_id

String

Yes

The task Id obtained in /ai/virtual/tryon

Sample Request

IopClient client = new IopClientImp(url, appkey, appSecret);
IopRequest request = new IopRequest();
// Adding this trial tag in header means using the trial resource to test, 
// request.addHeaderParameter("x-iop-trial","true")
request.setApiName("/ai/virtual/tryon-results");
request.addApiParameter("task_id", "1ce4fd33-b9d5-4e21-a24c-0c4027d2b105");
IopResponse response = client.execute(request);
System.out.println(response.getBody());
Thread.sleep(10);

Response Parameters (For /ai/virtual/tryon)

Parameter
Type
Description

rescode

Number

The returned result code, where 200 indicates success. For detailed error codes, please refer to the error code list

data

Object

task result of the virtual try on

taskResult

Object[]

List of all sub task result

taskResult

Object

detail sub task result

result

Object

task result content

imageList

Object[]

A list of generated model try-on photos. Currently, 8 images are generated for each garment.

imageUrl

String

URL of the try-on results.

clothes

String

URL of the clothes used for the virtual try-on.

taskStatus

String

the status of the sub-task, including finished, submitted, failed, running

taskStatus

String

the status of the task, including finished, submitted, failed, running

taskId

String

the taskId of the query task

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

result message, usually success, otherwise will contain some failure reason description

Sample Response (For /ai/virtual/tryon)

{
  "code": "0",
  "data": {
    "taskResult": [
      {
        "taskResult": {
          "result": {
            "imageList": [
              {
                "imageUrl": "http://nhci-aigc.oss-cn-zhangjiakou.aliyuncs.com/pengxin.zpx%2Ftry_on%2F67794fed424e45769e1183838e9b1302_20240403194141.png?OSSAccessKeyId\u003dLTAI5tCv9DpB7gYic1oGsAyv\u0026Expires\u003d2712144501\u0026Signature\u003dz4OEeqwmBgWo5Tt5xGWFeixz0kk%3",
                "clothes": "https://ai-business-algo-pai.oss-ap-southeast-1.aliyuncs.com/pengxin.zpx/8683046691566_200.jpg?OSSAccessKeyId\u003dLTAI5tAGoBnm5eYsnZ5E1zMr\u0026Expires\u003d360001710758584\u0026Signature\u003dEfIJzSJXuS1OJTe4KLz2S7eXhBs%3"
              }
            ]
          }
        },
        "taskStatus": "finished"
      }
    ],
    "taskStatus": "finished",
    "taskId": "b5947f18-f642-4980-9379-749c053335be"
  },
  "requestId": "212cd83017085872506144758e3fca",
  "success": "true",
  "resCode": "200",
  "resMessage": "success",
  "request_id": "0ba2887315178178017221014"
}

Response Parameters (For /ai/virtual/tryon-pro)

Parameter
Type
Description

rescode

Number

The returned result code, where 200 indicates success. For detailed error codes, please refer to the error code list

data

Object

task result of the virtual try on

taskResult

Object[]

List of all sub task result

taskResult

Object

detail sub task result

result

Object

task result content

data

Object[]

A list of generated model try-on photos. Currently, 8 images are generated for each garment.

structData

String

URL of the try-on results.

imageList

Object[]

URL of the clothes used for the virtual try-on.

imageUrl

String

URL of the try-on results.

clothes

String[]

URL of the clothes used for the virtual try-on.

taskStatus

String

the status of the sub-task, including finished, submitted, failed, running

taskStatus

String

the status of the task, including finished, submitted, failed, running

taskId

String

the taskId of the query task

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

result message, usually success, otherwise will contain some failure reason description

Sample Response (For /ai/virtual/tryon-pro)

{
    "data": {
        "taskResult": [
            {
                "taskResult": {
                    "result": {
                        "data": {
                            "message": [],
                            "usageMap": "{\"usage\":2}",
                            "structData": {
                                "code": 200,
                                "imageList": [
                                    {
                                        "imageUrl": "https://aib-image.oss-ap-southeast-1.aliyuncs.com/aitryon-refiner%2Fd0e3ba28-0332-11f0-8597-00163e1a190c%2Fd0e3ba28-0332-11f0-8597-00163e1a190c_20250324164631552.png?OSSAccessKeyId=LTAI5tSEGjGp5wixZgHLc3bV&Expires=4959477991&Signature=9Ohq5ZQ97VZGpOGQ8uiHyTW%2BLl4%3D",
                                        "clothes": [
                                            "https://aib-image.oss-ap-southeast-1.aliyuncs.com/ai_computing%2Ftmp%2F6c68b36e-088c-11f0-9d35-00163e06710b.png?OSSAccessKeyId=LTAI5t75Zk154w1Ne1UmpHKJ&Expires=4959477965&Signature=l%2B0BURUFqz0HwjKiTNaatpi44r4%3D"
                                        ]
                                    },
                                    {
                                        "imageUrl": "https://aib-image.oss-ap-southeast-1.aliyuncs.com/aitryon-refiner%2Fd0e3ba28-0332-11f0-8597-00163e1a190c%2Fd0e3ba28-0332-11f0-8597-00163e1a190c_20250324164643005.png?OSSAccessKeyId=LTAI5tSEGjGp5wixZgHLc3bV&Expires=4959478003&Signature=1q4fZI5Y4AwP3MP%2Br4EmCYo6Daw%3D",
                                        "clothes": [
                                            "https://aib-image.oss-ap-southeast-1.aliyuncs.com/ai_computing%2Ftmp%2F6c68b36e-088c-11f0-9d35-00163e06710b.png?OSSAccessKeyId=LTAI5t75Zk154w1Ne1UmpHKJ&Expires=4959477965&Signature=l%2B0BURUFqz0HwjKiTNaatpi44r4%3D"
                                        ]
                                    }
                                ],
                                "usageMap": "{\"usage\": 2}"
                            }
                        },
                        "success": true,
                        "requestId": "2101196917428060035318331d1448"
                    },
                    "usage": 1,
                    "usageMap": "{\"usage\":2}"
                },
                "taskStatus": "finished"
            }
        ],
        "taskStatus": "finished",
        "taskId": "b5109fa4-6a5c-4cb2-98fe-bc8fc06f9d09"
    },
    "requestId": "210158e717428061708871336ea704",
    "success": true,
    "resCode": 200,
    "resMessage": "success",
    "code": "0",
    "request_id": "21010f3b17428061708857302",
    "_trace_id_": "210158e717428061708871336ea704"
}
```json

Last updated

Was this helpful?