Skip to main content
POST
/
api
/
portrait
/
effects
/
face-beauty-pro
Face Beauty Pro
curl --request POST \
  --url https://www.ailabapi.com/api/portrait/effects/face-beauty-pro \
  --header 'Content-Type: multipart/form-data' \
  --header 'ailabapi-api-key: <api-key>' \
  --form task_type=sync \
  --form whitening=50 \
  --form smoothing=50 \
  --form thinface=50 \
  --form shrink_face=50 \
  --form enlarge_eye=50 \
  --form remove_eyebrow=50 \
  --form 'filter_type=<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": ""
},
"task_type": "sync",
"result": ""
}

Request

  • URL: https://www.ailabapi.com/api/portrait/effects/face-beauty-pro
  • Method: POST
  • Content-Type: multipart/form-data

Image requirements

  • Image format: JPEG JPG PNG
  • Image size: No more than 2 MB.
  • Image resolution: Larger than 48x48px, smaller than 4096x4096px.

Headers

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

Body

FieldRequiredTypeScopeDefaultDescription
task_typeYESstringasync“async: Asynchronous tasks.
imageYESfile
whiteningNOinteger[0, 100]50Whitening Degree. 0 means no whitening effect, 100 represents the highest degree.
smoothingNOinteger[0, 100]50Smoothing Degree. 0 means no smoothing effect, 100 represents the highest degree.
thinfaceNOinteger[0, 100]50Face Slimming Degree. 0 means no face slimming effect, 100 represents the highest degree.
shrink_faceNOinteger[0, 100]50Small Face Degree. 0 means no small face effect, 100 represents the highest degree.
enlarge_eyeNOinteger[0, 100]50Big Eyes Degree. 0 means no big eyes effect, 100 represents the highest degree.
remove_eyebrowNOinteger[0, 100]50Eyebrow Removal Degree. 0 means no eyebrow removal effect, 100 represents the highest degree.
filter_typeNOinteger1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 351`: Black and White.`, 2: Calm., 3`: Sunny Day.`, 4: Journey., 5`: Beautify Skin.`, 6: Hong Kong Style., 7`: Aesthetic.`, 8: Lovely., 9`: New York.`, 10: Sakura., 11`: Seventeen.`, 12: Soft Light., 13`: Afternoon Tea.`, 14: Brighten Skin., 15`: Chaplin.`, 16: Floral., 17`: Memories.`, 18: Ice Beauty., 19`: Paris.`, 20: Time., 21`: LOMO.`, 22: Old Times., 23`: Early Spring.`, 24: Story., 25`: Abao Color.`, 26: Fill Light., 27`: Warm.`, 28: Gorgeous., 29`: Lavender.`, 30: Chanel., 31`: Prague.`, 32: Old Dreams., 33`: Peach Blossom.`, 34: Pink., “35: Misty Rain.

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

FieldTypeScopeDescription
task_typestringasyncTask Type. “async: Asynchronous tasks.
task_idstringAsynchronous task ID.

Response Example

{
  "request_id":     "",
  "log_id":         "",
  "error_code":     0,
  "error_msg":      "",
  "error_detail":   {
    "status_code":  200,
    "code":         "",
    "code_message": "",
    "message":      ""
  },
  "task_type":      "",
  "task_id":        ""
}
This API is asynchronous, please keep task_id and call Querying Async Task Results to get the final results.Asynchronous task results are valid for 24 hours. It is recommended that asynchronous task results be queried every 5 seconds.

Querying Async Task Results 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

FieldTypeScopeDescription
task_statusinteger0, 1, 2Asynchronous task status. 0`: The task is queued.` 1: Asynchronous processing. “2: Processing was successful.
result_urlstringResult URL address.
The URL address is a temporary address, valid for 24 hours, and will not be accessible after it expires. If you need to save the file for a long time or permanently, please visit the URL address within 24 hours and download the file to your own storage space.

Response Example

{
  "error_code":     0,
  "error_msg":      "",
  "error_detail":   {
    "status_code":  200,
    "code":         "",
    "code_message": "",
    "message":      ""
  },
  "task_status":    0,
  "result_url":     ""
}

Sample Code

Authorizations

ailabapi-api-key
string
header
required

API Key for authentication

Body

multipart/form-data
task_type
string

Task Type. <li>sync: Synchronous tasks.</li> <li>async: Asynchronous tasks.</li>

Example:

"sync"

image
file
whitening
integer

Whitening Degree. 0 means no whitening effect, 100 represents the highest degree.

Example:

"50"

smoothing
integer

Smoothing Degree. 0 means no smoothing effect, 100 represents the highest degree.

Example:

"50"

thinface
integer

Face Slimming Degree. 0 means no face slimming effect, 100 represents the highest degree.

Example:

"50"

shrink_face
integer

Small Face Degree. 0 means no small face effect, 100 represents the highest degree.

Example:

"50"

enlarge_eye
integer

Big Eyes Degree. 0 means no big eyes effect, 100 represents the highest degree.

Example:

"50"

remove_eyebrow
integer

Eyebrow Removal Degree. 0 means no eyebrow removal effect, 100 represents the highest degree.

Example:

"50"

filter_type
string

Filter Effects. <li>1: Black and White.</li> <li>2: Calm.</li> <li>3: Sunny Day.</li> <li>4: Journey.</li> <li>5: Beautify Skin.</li> <li>6: Hong Kong Style.</li> <li>7: Aesthetic.</li> <li>8: Lovely.</li> <li>9: New York.</li> <li>10: Sakura.</li> <li>11: Seventeen.</li> <li>12: Soft Light.</li> <li>13: Afternoon Tea.</li> <li>14: Brighten Skin.</li> <li>15: Chaplin.</li> <li>16: Floral.</li> <li>17: Memories.</li> <li>18: Ice Beauty.</li> <li>19: Paris.</li> <li>20: Time.</li> <li>21: LOMO.</li> <li>22: Old Times.</li> <li>23: Early Spring.</li> <li>24: Story.</li> <li>25: Abao Color.</li> <li>26: Fill Light.</li> <li>27: Warm.</li> <li>28: Gorgeous.</li> <li>29: Lavender.</li> <li>30: Chanel.</li> <li>31: Prague.</li> <li>32: Old Dreams.</li> <li>33: Peach Blossom.</li> <li>34: Pink.</li> <li>35: Misty Rain.</li>

Response

200 - application/json

Success

The response is of type object.