Hairstyle Tryon
Our Virtual Hairstyle Try-On endpoint provides realistic hair transformations using just one photo of a person. Explore a wide range of hairstyles and hair colors with exceptional accuracy. It’s our most advanced AI model for hair try-on experiences, designed to deliver high-quality and lifelike results.
Request
Generate a virtual try-on by sending a face image to the following endpoint:
POST
https://tryiton.now/api/v1/tryon/hairstyle
Request Examples
curl -X POST "https://tryiton.now/api/v1/tryon/hairstyle" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"face_image": "https://example.com/path/to/face.png",
"hair_style": "TwinBraids"
}'fetch('https://tryiton.now/api/v1/tryon/hairstyle', {
method: 'POST',
body: JSON.stringify({
face_image: "https://example.com/path/to/face.png",
hair_style: "TwinBraids"
}),
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
}
});import requests
response = requests.post(
"https://tryiton.now/api/v1/tryon/hairstyle",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"face_image": "https://example.com/path/to/face.png",
"hair_style": "TwinBraids"
}
)Response
Returns a job ID for status polling:
Request Parameters
Required Parameters
face_image image URL | base64
face_image image URL | base64Primary image of the person's face on whom the virtual try-on will be performed.
Base64 Format
Base64 images must include the proper prefix (for example, data:image/jpg;base64,<YOUR_BASE64>)

hair_style 'BuzzCut' | 'UnderCut' | ...
hair_style 'BuzzCut' | 'UnderCut' | ...The desired hairstyle to be tried on the face_image. You can select from a wide range of styles below.




















































Optional Parameters
hair_color 'blonde' | 'platinumBlonde' | ...
hair_color 'blonde' | 'platinumBlonde' | ...The desired hair color to be tried on the hair_style. You can select from a wide range of colors below.






















num_samples int
num_samples intSpecifies 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
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.
The Error Object
Example of an error when polling the /status endpoint:
If you encounter an unrecognized error, please contact us at [email protected]
Last updated