Skip to main content
POST
Try on Clothes

Request

  • URL: https://www.ailabapi.com/api/portrait/editing/try-on-clothes
  • Method: POST
  • Content-Type: multipart/form-data

Image requirements

Portrait

  • Image format: JPG JPEG PNG
  • Image size: No more than 3 MB.
  • Image resolution: Less than 4096x4096px.
  • Pose requirements: full-body front view with hands fully visible. Arm positioning should avoid wide openings, crossing, or other exaggerated gestures.
Correct Example
Correct Example ImageCorrect Example Image
Incorrect Example
Non-Front Full-Body Shot
(Avoid uploading side views, sitting poses, lying down poses, or half-body photos.)
Group Photo
Clothing Obstruction
(Avoid holding items, bags, etc.)
Lighting Too Dark / Blurry
Incorrect Example Image
Incorrect Example Image
Incorrect Example Image
Incorrect Example Image

Clothing

  • Image format: JPG JPEG PNG
  • Image size: No more than 3 MB.
  • Image resolution: Less than 4096x4096px.
  • Pose requirements: full-body front view with hands fully visible. Arm positioning should avoid wide openings, crossing, or other exaggerated gestures.
  • Clothing Category: Minimal Patterns & Prints. Examples include jeans, polo shirts, yoga wear, dresses, suits, T-shirts, etc.
  • Upload a clear, well-aligned flat-lay image of the clothing.
  • Background should be simple, clean, and well-lit.
  • Only a single item of clothing should be displayed in the image.
  • No layering with other clothing items.
  • The clothing item should occupy as much of the image frame as possible.
Correct Example
Correct Example ImageCorrect Example ImageCorrect Example ImageCorrect Example Image
Correct Example ImageCorrect Example ImageCorrect Example ImageCorrect Example Image
Incorrect Example
Multiple Clothing Items
Non-Front View
Folded Obstruction
Clothing Wrinkles
Incorrect Example Image
Incorrect Example Image
Incorrect Example Image
Incorrect Example Image

Headers

Body

Response

Response Field Handling Flow
  1. Handle Public Response Fields Parse and validate the Public Response Fields, checking the status code or response message to ensure the request is successful and error-free.
  2. Handle Business Response Fields If the Public Response Fields are valid and error-free, proceed with processing the business logic in the Business Response Fields.

Public Response Fields

Viewing Public Response Fields and Error Codes

Business Response Fields

Response Example

This API is asynchronous, please keep task_id and call Querying Async Task Results to get the final results.Asynchronous task results are valid for 24 hours. It is recommended that asynchronous task results be queried every 5 seconds.

Querying Async Task Results Response

Response Field Handling Flow
  1. Handle Public Response Fields Parse and validate the Public Response Fields, checking the status code or response message to ensure the request is successful and error-free.
  2. Handle Business Response Fields If the Public Response Fields are valid and error-free, proceed with processing the business logic in the Business Response Fields.

Public Response Fields

Viewing Public Response Fields and Error Codes

Business Response Fields

All result URLs are temporarily available and will expire after 24 hours.

Response Example

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Body

multipart/form-data
task_type
string

Task Type.

  • async: Asynchronous tasks.
Example:

"async"

person_image
file

Portrait image.

clothes_image
file

Clothing image.

clothes_type
string

Clothing Types.

  • upper_body: Upper body clothing.
  • lower_body: Lower body clothing.
  • full_body: Full body clothing.

Response

200 - application/json

Success

The response is of type object.