Skip to main content
POST
/
api
/
portrait
/
effects
/
face-attribute-editing
Age & Gender swap
curl --request POST \
  --url https://www.ailabapi.com/api/portrait/effects/face-attribute-editing \
  --header 'Content-Type: multipart/form-data' \
  --header 'ailabapi-api-key: <api-key>' \
  --form 'action_type=<string>' \
  --form 'quality_control=<string>' \
  --form 'face_location=<string>' \
  --form 'target=<string>' \
  --form image=@example-file
{
"request_id": "",
"log_id": "",
"error_code": 0,
"error_code_str": "",
"error_msg": "",
"error_detail": {
"status_code": 200,
"code": "",
"code_message": "",
"message": ""
},
"result": {
"image": ""
}
}

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Body

multipart/form-data
image
file
action_type
string

Face editing method. <li>TO_KID: V1 version becomes a child.</li> <li>TO_OLD: V1 version becomes old man.</li> <li>TO_FEMALE: V1 version becomes girls.</li> <li>TO_MALE: V1 version becomes boys.</li> <li>V2_AGE: V2 version age change.</li> <li>V2_GENDER: v2 version gender shift.</li>

quality_control
string

Image quality (image field image quality). <br/>Please select the appropriate option based on quality information such as masking, lighting, blurriness, and integrity of the face. <br/>If selecting a higher quality causes the image to be unprocessable, please select a lower quality to try. <li>NONE: No control is performed.</li> <li>LOW: Lower quality requirements.</li> <li>NORMAL: General quality requirements.</li> <li>HIGH: Higher quality requirements.</li>

face_location
string

When multiple faces are detected in the image, use this parameter to specify the position of the face to be edited in the image, or default to the largest face in the image if not specified.

target
string

Response

200 - application/json

Success

The response is of type object.