Skip to main content

Garment Virtual Try-On

Garment VTO overlays a product garment onto a person photo, generating a realistic composite image of the person wearing the item.

Garment Classes

Each request requires a garmentClass that tells the system what type of garment is being tried on. This determines how the garment is applied to the person image.

Garment ClassDescriptionExamples
UPPER_BODYTops and upper-body clothingT-shirt, blouse, jacket, sweater
LOWER_BODYBottoms and lower-body clothingJeans, shorts, skirt, trousers
FOOTWEARShoes and footwearSneakers, heels, boots, sandals
FULL_BODYFull outfits covering the entire bodyDress, jumpsuit, romper, suit
tip

Choose the garment class that best matches the product. Using the wrong class may produce unexpected results — for example, using UPPER_BODY for a pair of shoes.

Make Your First Request

Send a POST request to the /vto/garment endpoint with a person photo (sourceImage), a product garment photo (garmentImage), and the garmentClass.

Garment VTO - Sample Request
curl -L -X POST 'https://api-company-xyz.evolvestorefront.com/image-engine/vto/garment' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...' \
-d '{
"sourceImage": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
"garmentImage": "/9j/4AAQSkZJRgABAQEASABIAAD...",
"garmentClass": "UPPER_BODY"
}'
Garment VTO - Sample Response
{
"success": true,
"data": {
"resultImage": "iVBORw0KGgoAAAANSUhEUgAA...",
"mimeType": "image/png",
"processingTime": 4.832
}
}

Understanding the Response

FieldDescription
resultImageBase64-encoded composite image of the person wearing the garment
mimeTypeThe format of the result image (e.g., image/png)
processingTimeTime in seconds taken to generate the image

To display the result, decode the base64 string back to an image. For example, using the command line:

Decode result image
echo "<resultImage value>" | base64 -d > result.png

Error Handling

If the request fails, the response will include an error code and message:

Error Response
{
"success": false,
"error": {
"message": "garmentClass must be one of: UPPER_BODY, LOWER_BODY, FOOTWEAR, FULL_BODY",
"code": "INVALID_GARMENT_CLASS"
}
}
Error CodeHTTP StatusDescription
VALIDATION_ERROR400Missing required fields or invalid request body
INVALID_GARMENT_CLASS400garmentClass is not one of the valid enum values
IMAGE_TOO_LARGE400Image exceeds 3,072 pixels on its longest side
INVALID_IMAGE400Unable to decode the base64 image data
IMAGE_GENERATION_ERROR500Generation failed — retry the request

API Reference