Skip to main content
POST
/
api
/
portrait
/
effects
/
hairstyle-editor
Hairstyle changer
curl --request POST \
  --url https://www.ailabapi.com/api/portrait/effects/hairstyle-editor \
  --header 'Content-Type: multipart/form-data' \
  --header 'ailabapi-api-key: <api-key>' \
  --form 'hair_type=<string>' \
  --form image_target=@example-file
{
  "request_id": "",
  "log_id": "",
  "error_code": 0,
  "error_code_str": "",
  "error_msg": "",
  "error_detail": {
    "status_code": 200,
    "code": "",
    "code_message": "",
    "message": ""
  },
  "data": {
    "image": ""
  }
}

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Body

multipart/form-data
image_target
file
hair_type
string

Hairstyle type. <li>101: Bangs (default)</li> <li>201: Long hair</li> <li>301: Bangs with long hair</li> <li>401: Medium hair increase</li> <li>402: Light hair increase</li> <li>403: Heavy hair increase</li> <li>502: Light curling</li> <li>503: Heavy curling</li> <li>603: Short hair (requires input size < 2048x2048; if the input is larger than 2048x2048, the output image will be resized to a maximum of 2048 on the longest side.)</li> <li>801: Blonde</li> <li>901: Straight hair</li> <li>1001: Oil-free hair (slight effect, recommended for images with noticeable issues)</li> <li>1101: Hairline fill (slight effect, recommended for images with noticeable issues of a high hairline)</li> <li>1201: Smooth hair (slight effect, recommended for images with a large hairstyle area)</li> <li>1301: Fill hair gap (slight effect, fills the scalp part in the hair area, recommended for images with noticeable issues)</li>

Response

200 - application/json

Success

The response is of type object.