Clothes Tryon

Our Virtual Try-On Clothes endpoint provides realistic garment visualization using only one photo of a person and one of a garment. It’s our most advanced AI model for try-on experiences, built to deliver high-quality, detailed results with minimal setup.

Model Specifications

  • Processing Resolution: 864×1296 pixels

  • Processing Time:

    • Performance: 6 seconds

    • Balanced: 9 seconds

    • Quality: 12–18 seconds (depending on input resolution)

  • Tryon Cost: 1 per image

Request

Generate a virtual try-on by sending your model and garment images to following endpoint:

POST https://tryiton.now/api/v1/tryon/clothes

Request Examples

curl -X POST "https://tryiton.now/api/v1/tryon/clothes" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_image": "https://example.com/path/to/model.png",
    "garment_image": "https://example.com/path/to/garment.png"
  }'

Response

Returns a job ID for status polling:

Response

Request Parameters

Required Parameters

model_image image URL | base64

Primary image of the person on whom the virtual try-on will be performed.

garment_image image URL | base64

Reference image of the clothing item to be tried on the model_image

Optional Parameters

category 'auto' | 'tops' | 'bottoms' | 'one-pieces'

Use auto to enable automatic classification of the garment type. For flat-lay or ghost mannequin images, the system detects the garment type automatically. For on-model images, full-body shots default to a full outfit swap. For focused shots (upper or lower body), the system selects the most likely garment type (tops or bottoms).

Default: auto

segmentation_free boolean

Performs direct garment fitting without clothing segmentation, allowing bulkier garments to be tried on while better preserving body shape and skin texture. Set this to false if the original garments are not being removed correctly.

Default: true

moderation_level 'conservative' | 'permissive' | 'none'

Sets the content moderation level for garment images.

  • conservative enforces stricter modesty standards for culturally sensitive contexts, blocking underwear, swimwear, and revealing outfits.

  • permissive allows swimwear, underwear, and revealing garments, while still blocking explicit nudity.

  • none disables all content moderation.

Default: permissive

garment_photo_type 'auto' | 'flat-lay' | 'model'

Defines the type of garment photo to help optimize internal settings for better results. Use 'model' for photos of garments worn by a model, 'flat-lay' for flat-lay or ghost mannequin images, and 'auto' to let the system automatically detect the photo type.

Default: auto

mode 'performance' | 'balanced' | 'quality'

Specifies the mode of operation.

  • performance mode is faster but may compromise quality

  • balanced mode offers an ideal compromise between speed and quality

  • quality mode is slower, but delivers the highest quality results

Default: balanced

seed int

Specifies how many images to generate in one run. Since image generation involves some randomness, creating multiple images at once increases the chance of getting a good result.

Default: 42 Min: 0 Max: 2^32 - 1

num_samples int

Specifies how many images to generate in a single run. Because image generation involves some randomness, generating multiple images at once increases the likelihood of getting a good result.

Default: 1 Min: 1 Max: 4

output_format 'png' | 'jpeg'

Specifies the desired output image format.

  • png delivers the highest image quality, making it ideal for content creation and other cases where quality is the top priority

  • jpeg provides a faster response with slight compression, making it better suited for real-time applications like consumer virtual try-on experiences

Default: png

Response Polling

After submitting your request, poll the status endpoint using the returned job ID. See API Fundamentals for complete polling details.

Successful Response

When your virtual try-on completes successfully, the status endpoint will return:

The output array contains URLs to your generated try-on images showing the model wearing the specified garment. The number of images depends on the num_samples parameter (default: 1).

Runtime Errors

If an error occurs during inference (while the model is running), the API will return a 200 status code with a prediction status: failed. The response will also include an error object under the error key.

Name
Cause
Solution

ImageLoadError

The pipeline couldn’t load the model or garment image from the provided inputs.

For Image URLs:

  • Make sure the URL is publicly accessible and not restricted by permissions.

  • Verify that the Content-Type header specifies the correct image format (image/jpeg or image/png)

For Base64-encoded images:

  • Prefix the string with data:image/<format>;base64where format is the image type (such as jpeg or png)

ContentModerationError

Prohibited content was detected in the provided garment image according to your current moderation settings.

  • If your use case allows, adjust moderation_level to permissive or none.

  • Setting moderation_level: none disables content moderation but does not remove your responsibility to ensure ethical and lawful use, as outlined in our Terms of Service.

  • Misuse of this technology such as generating inappropriate imagery of individuals without consent may result in service denial.

PoseError

The pipeline couldn’t detect a body pose in either the model image or the garment image (when garment_photo_type is set to model).

Improve the quality of the model or garment image by following our model photo guidelines.

PipelineError

An unexpected error occurred while running the pipeline.

Retry the request (you won't be charged for failed attempts). If the issue persists, please reach out to us at [email protected] and include the job ID from the failed attempt to help us locate and address the issue promptly.

ThirdPartyError

A third-party processor encountered an error or refused to process the request.

This is most likely due to content restrictions enforced by supporting services (such as image captioning). Try adjusting your image inputs. If the issue continues with different inputs, contact [email protected] with the job ID.

The Error Object

Example of an error when polling the /status endpoint:

If you encounter an unrecognized error, please contact us at [email protected]

For detailed implementation guides and best practices specific to Virtual Try-On:

Last updated