Virtual Try-On

POSThttps://api.newportai.com/api/async/tryon_clothes

The Virtual Try-On API enables realistic clothing transfer onto a model image. It supports upper garments, lower garments, and one-piece outfits, allowing you to visualize how different clothing items look on a person.

  • Submit a POST request to the Virtual Try-On API to obtain a taskId.
  • Submit a POST request to the Polling API to retrieve the generated output.
  • Configure a Callback URL to receive results automatically on completion.

Request Headers

Content-Type string Required

Enum: application/json

Authorization string Required

Bearer authentication token. Example: Bearer {{APIKey}}.

Request Body

modelImage string Required

The URL of the model image. This parameter cannot be empty.

upperClothes string

Optional. The URL of the upper garment image (e.g., shirt, jacket, top). Provide at least one of upperClothes, lowerClothes, or overallClothes.

lowerClothes string

Optional. The URL of the lower garment image (e.g., pants, skirt, shorts). Provide at least one of upperClothes, lowerClothes, or overallClothes.

overallClothes string

Optional. The URL of the one-piece garment image (e.g., dress, jumpsuit, overalls). Provide at least one of upperClothes, lowerClothes, or overallClothes.

Constraint: At least one of upperClothes, lowerClothes, or overallClothes must be provided, and they cannot all be filled at the same time. You can provide a maximum of two clothing items (e.g., upper + lower for a two-piece outfit). When overallClothes is set, upperClothes and lowerClothes must be empty.

enableShoes boolean

Optional. Generate matching shoes for clothing when enabled. Default: false.

width integer

Optional. The width of the output image in pixels. Default: 600. The product of width and height must not exceed 1,200,000.

height integer

Optional. The height of the output image in pixels. Default: 800. The product of width and height must not exceed 1,200,000.

Response

code integer

Returns 0 for success, or a specific error code.

message string

Returns "success" or a descriptive error message.

data object
taskId string

The unique identifier for the task. Use this ID with the Polling API to retrieve the generated output.

Errors

10192Illegal param

Polling

Use the Polling API to retrieve the processing results.

Callback

Alternatively, you can enable Callback to receive task results automatically upon completion.

0Task Completed
{
  "code": 0,
  "message": "success",
  "data": {
    "task": {
      "taskId": "b08337dc08d7428daa64b3d5e61b8350",
      "status": 3
    },
    "images": [{
      "imageUrl": "https://dreamface-resource-aigc.oss-us-east-1.aliyuncs.com/apiDocsAdmin/2025-4-1744793368637-tryon_result.jpg",
      "imageType": "jpg"
    }]
  }
}
Request
cURL
curl -X POST 'https://api.newportai.com/api/async/tryon_clothes' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer {{APIKey}}" \
  -d '{
  "modelImage": "https://d2t5pyzt5qvy2d.cloudfront.net/api/static_resource/prod/default/INj5UrnnrKIzCR1uYBWv0.png",
  "upperClothes": "https://d2t5pyzt5qvy2d.cloudfront.net/api/static_resource/prod/default/8uuMKyo8Pf_Fb68Rvka7H.jpeg",
  "lowerClothes": "https://d2t5pyzt5qvy2d.cloudfront.net/api/static_resource/prod/default/X_5VQM9dEfCi5KtMfoEgY.jpeg",
  "enableShoes": false,
  "width": 600,
  "height": 800
}'
0Successful
{
    "code": 0,
    "message": "success",
    "data": {
        "taskId": "b08337dc08d7428daa64b3d5e61b8350"
    }
}