Try On (Beta)
POST/v1/try-on
BETA - This endpoint is currently in beta and may change without notice.
Places a garment onto a person image.
For Best Results:
- Person Image:
- There should only be one person in the image.
- Plain backgrounds and no accessories are best
- The person should take up most of the frame, a 3/4 body view works best.
- The person should be standing facing forward, side/seated views work less well.
- Garment Image:
- The garment image should only contain a single garment.
- Plain "stock photos" of garments work best, however the model is capable of transferring garments from one person to another.
- The garment should take up most of the frame.
Limitations:
- The API may not work with all garments, it works best with top garments like t-shirts, blouses, etc.
- Text and fine details in the garment image may not be reproduced perfectly in the resulting image.
- Colors in the resulting image may be slightly different to the colors in the garment image.
Input Image Limits:
- Max size: 25MB
- Min resolution: 256x256px
- Max resolution: 1920x1920px
Request
Header Parameters
Acceptable response media type(s). application/json
.
- application/json
- multipart/form-data
Body
URL of the image. Background will be automatically removed.
URL of the image. Background will be automatically removed.
Body
URL of the image. Background will be automatically removed.
Binary file of the image to be processed, this is mutually exclusive with image_url, if both are provided the image will be used.
URL of the image. Background will be automatically removed.
Binary file of the image to be processed, this is mutually exclusive with image_url, if both are provided the image will be used.
Responses
- 200
- 400
- 401
- 403
- 429
- 500
Success
- application/json
- Schema
- Example (from schema)
Schema
A URL to access the resultant image which is valid for 1 hour. File format will be jpeg.
{
"result_url": "https://assets.pixelcut.app/public/result/a16646be-91c8-4e3a-b359.jpg"
}
The input could not be processed, often returned when the input image exceeds API limits.
- application/json
- Schema
- Example (from schema)
Schema
invalid_request_body
: The request body was empty or invalid.missing_parameter
: A required parameter was not provided.invalid_parameter
: A parameter was provided but it was invalid.unsupported_content_type
: The content type of the request was not application/json or multipart/form-data.malformed_image
: The image could not be decoded.unsupported_image_format
: The image format is not supported.file_size_too_large
: The image file size is too large.resolution_too_high
: The image resolution is too high.unknown_foreground
: The foreground subject of the image could not be detected.
A description of the error.
Possible values: [invalid_request_body
, missing_parameter
, invalid_parameter
, unsupported_content_type
, malformed_image
, unsupported_image_format
, file_size_too_large
, resolution_too_high
, unknown_foreground
]
The error codes provide a way to programmatically handle errors.
The following error codes are currently in use:
{
"error": "File size too large",
"error_code": "file_size_too_large"
}
The authentication token is missing or invalid.
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [invalid_auth_token
]
{
"error": "API Token not found",
"error_code": "invalid_auth_token"
}
Returned when you have insufficient credits to perform the requested action.
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [insufficient_api_credits
]
{
"error": "Insufficient credits available",
"error_code": "insufficient_api_credits"
}
Rate limit exceeded
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [rate_limit_exceeded
]
{
"error": "Too many requests",
"error_code": "rate_limit_exceeded"
}
Internal service error