Skip to main content

AILabTools API - Face Beauty Pro - Async API

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.
FieldRequiredTypeDescription
ailabapi-api-keyYESstringApplication API KEY. Get API KEY

Body

FieldRequiredTypeScopeDefaultDescription
task_typeYESstring
  • async
  • Task Type.
  • 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_typeNOinteger
  • 1
  • 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
  • 35
  • Filter Effects.
  • 1: 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

    Processing Flow
    1. Handle Public Parameters:

      First, parse and validate the Public Parameters, checking the status code or response message to ensure the request is successful and no errors are present.

    2. Handle Business Parameters:

      If the public parameters are valid and no exceptions are found, proceed to process the business logic in the Business Parameters.

    Public Parameters

    Viewing Public Parameters and Error Codes

    Business Parameters

    FieldTypeScopeDescription
    task_typestring
  • async
  • Task Type.
  • async: Asynchronous tasks.
  • task_idstringAsynchronous task ID.

    Example

    {
    "request_id": "",
    "log_id": "",
    "error_code": 0,
    "error_code_str": "",
    "error_msg": "",
    "error_detail": {
    "status_code": 200,
    "code": "",
    "code_message": "",
    "message": ""
    },
    "task_type": "",
    "task_id": ""
    }
    tip

    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

    Processing Flow
    1. Handle Public Parameters:

      First, parse and validate the Public Parameters, checking the status code or response message to ensure the request is successful and no errors are present.

    2. Handle Business Parameters:

      If the public parameters are valid and no exceptions are found, proceed to process the business logic in the Business Parameters.

    Public Parameters

    Viewing Public Parameters and Error Codes

    Business Parameters

    FieldTypeScopeDescription
    task_statusinteger
  • 0
  • 1
  • 2
  • Asynchronous task status.
  • 0: The task is queued.
  • 1: Asynchronous processing.
  • 2: Processing was successful.
  • result_urlstringResult URL address.
    tip

    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.

    Example

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

    Code example