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.

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

Response

Returns a job ID for status polling:

Response
{
  "id": "64b7f1a9d9a3b8e5c7f9a123",
  "error": null
}

Request Parameters

Required Parameters

face_image image URL | base64

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

hair_style 'BuzzCut' | 'UnderCut' | ...

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

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.

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

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

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