Generate hairstyle (Pro)
Generate hairstyle (Pro) uses a more powerful model than Generate hairstyle to produce more realistic, visually appealing hairstyles. Choose a preset hairstyle or use a portrait reference image to guide the result.
Provide at least one of style or ref_image; style is not required when ref_image is supplied. If both are supplied, style takes priority over ref_image. Omit style to use the reference image. Returns an RGB image with the same dimensions as the input.
hairstyle-transfer-pro/v1/images/hairstyle/proAuthorization — This endpoint requires an API key. Pass it in the api-key header on every request. Learn more
Thời gian xử lý trung bình
Cho mỗi yêu cầu.
- Thời gian xử lý
- ≈ 3,8 giây
Yêu cầu đầu vào
Hình ảnh
- Định dạng
- JPEG, PNG, WEBP
- Độ phân giải tối đa
- 3000 × 3000 px
Use an RGB portrait and either a preset hairstyle or a reference hairstyle image. Style is optional when a reference image is supplied. The RGB output matches the input portrait dimensions.
Parameters
| Name | Type | Status | Description |
|---|---|---|---|
input_image | file | Required | Required RGB portrait image file or URL. |
style | string | Optional | Preset hairstyle. Required only when ref_image is absent. Takes priority over ref_image if both are supplied; omit style to use the reference image. bobcutc_shapedbanglongbendy_bobcurly_bobfrench_bobjapan_butterfly_hairstylejapan_himejapan_hush_cutjapan_layerjapan_mermaid_wedge_bobjapan_soft_wolf_cutjapan_thick_parted_bangskorea_balayage_highlightskorea_korean_bangskorea_layered_midi_hairkorea_long_curls_with_bangskorea_multi_layered_shagkorea_sleek_layered_korean_hairkorea_slick_pixie_bobsingle_braidedtwin_braidedusa_italian_bobusa_loose_hairusa_ponytail_hairstyleusa_racoon_hairstyleusa_retro_bobusa_sleek_face_contouring_bob |
ref_image | file | Optional | Reference hairstyle image file or URL. Required only when style is absent. Omit style to use this image; style takes priority if both are supplied. |
Responses
Hairstyle generated successfullySingleImageResponse
| Field | Type | Description |
|---|---|---|
created | integer | Unix timestamp of when the response was created |
data | object[] | |
url | string | URL to download the result image |
curl -X POST "https://api.snapedit.app/v1/images/hairstyle/pro" \
-H "api-key: YOUR_API_KEY" \
-F "input_image=@./image.jpg" \
-F "style=bobcut" \
-F "ref_image=@./image.jpg"{
"created": 1745827200,
"data": [
{
"url": "https://outputs.snapedit.app/outputs/abc123.png"
}
]
}
