Skip to main content
POST
/
api
/
portrait
/
effects
/
lips-color-changer
Lips Color Changer
curl --request POST \
  --url https://www.ailabapi.com/api/portrait/effects/lips-color-changer \
  --header 'Content-Type: multipart/form-data' \
  --header 'ailabapi-api-key: <api-key>' \
  --form 'lip_color_infos=<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": ""
}

Request

  • URL: https://www.ailabapi.com/api/portrait/effects/lips-color-changer
  • Method: POST
  • Content-Type: multipart/form-data

Image requirements

  • Image format: JPEG JPG PNG BMP
  • Image size: No more than 5 MB.
  • Image resolution: Less than 2000x2000px.

Headers

FieldRequiredTypeDescription
ailabapi-api-keyYESstringApplication API KEY. Get API KEY

Body

FieldRequiredTypeDescription
imageYESfile
lip_color_infosYESjson stringLip Color Info. You can enter up to 3 lip_color_info to enable changing the lip color for up to 3 faces in a graph. Description

lip_color_infos

FieldRequiredTypeScopeDescription
rgbaYESobjectLip color.
+rYESinteger[0, 255]R channel values.
+gYESinteger[0, 255]G channel values.
+bYESinteger[0, 255]B channel values.
+aYESinteger[0, 100]A channel values. Transparency, the smaller the value, the more transparent.
face_rectNOobjectFace box position. If not entered the face with the largest area in the image is selected. You can use the Face Analyzer API or Facial Landmarks API to get face frame position information.
+xYESintegerHorizontal coordinate of the upper left corner of the face box.
+yYESintegerThe vertical coordinate of the upper left corner of the face box.
+widthYESintegerFace frame width.
+heightYESintegerFace frame height.
Example
{
  "lip_color_infos": '[{"rgba":{"r":246,"g":27,"b":91,"a":100}}]'
}
{
  "lip_color_infos": '[{"rgba":{"r":246,"g":27,"b":91,"a":100},"face_rect":{"x":0,"y":0,"width":0,"height":0}}]'
}

Response

Response Field Handling Flow
  1. Handle Public Response Fields Parse and validate the Public Response Fields, checking the status code or response message to ensure the request is successful and error-free.
  2. Handle Business Response Fields If the Public Response Fields are valid and error-free, proceed with processing the business logic in the Business Response Fields.

Public Response Fields

Viewing Public Response Fields and Error Codes

Business Response Fields

FieldTypeDescription
result_imagestringReturns the base64 data of the processed image.

Response Example

{
  "request_id":     "",
  "log_id":         "",
  "error_code":     0,
  "error_msg":      "",
  "error_detail":   {
    "status_code":  200,
    "code":         "",
    "code_message": "",
    "message":      ""
  },
  "result_image":   ""
}

Sample Code

👉 Online Experience 👈If you’d like to see the actual effects, please visit the experience page for a trial.

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Body

multipart/form-data
image
file
lip_color_infos
string

Lip Color Info. You can enter up to 3 lip_color_info to enable changing the lip color for up to 3 faces in a graph.

Response

200 - application/json

Success

The response is of type object.