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.

circle-info

Model Specifications

  • Processing Resolution: 864×1296 pixels

  • Processing Time: 6 seconds

  • Tryon Cost: 1 per image

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",
    "haircut": "TwinBraids"
  }'

Response

Returns a job ID for status polling:

chevron-rightResponsehashtag
{
  "id": "64b7f1a9d9a3b8e5c7f9a123",
  "error": null
}

Request Parameters

Required Parameters

circle-info

face_image image URL | base64

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

triangle-exclamation
circle-info

haircut 'BuzzCut' | 'SlickBack' | ...

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

Original Image
BuzzCut
UnderCut
Pompadour
SlickBack
CurlyShag
WavyShag
FauxHawk
Spiky
CombOver
HighTightFade
ManBun
Afro
LowFade
UndercutLongHair
TwoBlockHaircut
TexturedFringe
BluntBowlCut
LongWavyCurtainBangs
MessyTousled
CornrowBraids
LongHairTiedUp
Middle-parted

Optional Parameters

circle-info

hair_color 'blonde' | 'platinumBlonde' | ...

The desired hair color to be tried on the haircut. You can select from a wide range of colors below.

Original Image
blonde
platinumBlonde
brown
lightBrown
blue
darkBlue
lightBlue
purple
lightPurple
pink
black
white
grey
silver
red
burgundy
orange
green
darkGreen

Response Polling

After submitting your request, poll the status endpoint using the returned job ID. See API Fundamentalsarrow-up-right 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.

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