YouCam Online Editor AI APIs (1.15)

Download OpenAPI specification:Download

API Document

The YouCam Online Editor AI APIs are series of AI effects that let you beautify your photos, as well as generate amazing aesthetic creations beyond human imagination. Let the magic begin.

PLEASE NOTE that by reading this API documentation, or by setting up code pursuant to the instructions in this API documentation, you acknowledge it adheres to Perfect Corp's Privacy policy, and Terms of Service. And If you have any issue, please contact: YouCamOnlineEditor_API@perfectcorp.com

YouCam Online Editor AI APIs

Introduction

YouCam Online Editor is a powerful and easy-to-use AI platform that provides beautiful and true-to-life visual effects thanks to the latest AI technology. This API document will briefly introduce how to integrate these awesome AI effects into your business. YouCam Online Editor AI APIs are standard RESTful APIs to let you easily integrate to your website, e-commerce platforms, iOS/Android APP, applets, mini-programs, and more.

YouCam Online Editor AI APIs

API Server

The YouCam Online Editor AI APIs are built on top of RESTful web APIs. The API server is the host of all APIs. Once you complete the authentication, you can start your AI tasks through the API Server.

Rate Limit

To ensure fair usage and prevent abuse, our API implements rate limiting. There are two types of rate limits:

  • Per IP Address

    Each IP address is allowed a maximum of 100 requests per 5 minutes. If this limit is exceeded, subsequent requests will receive a 429 Too Many Requests error.

  • Per Access Token

    Each access token is allowed a maximum of 100 requests per minute. If this limit is exceeded, subsequent requests will receive a 429 Too Many Requests error.

Both conditions must be met for a request to be accepted. If either condition is not met, the request will receive a 429 Too Many Requests error. Please note that each query related to credit will be processed real-time. Other APIs can use the access token util expired.

It is recommended that you handle rate limit errors gracefully in your application by implementing the appropriate backoff and retry mechanisms.

Quick start guide

First, you need to register a YouCam Online Editor account for free at https://yce.perfectcorp.com/. You can then purchase or subscribe to get your credits to use the service. You can see your subscription plan, pay as you go credits, and your usage record at https://yce.perfectcorp.com/account. You can go to the API Key tab under your account page to generate and maintain your API keys to start using the YouCam Online Editor AI APIs.

To complete the authentication and start using the AI APIs, you need:

  1. Go to https://yce.perfectcorp.com/account/apikey and create the API Key.

  2. Upon creation is completed, it will show the API Key and the Secret key. Where your API Key is the client_id and the Secret key is the client_secret in this document to complete the authentication process.

    :warning: Warning: Please kindly note that your Secret key can only be copied at step #2. Once the dialog is closed, there is no method to obtain the Secret key again unless create an another API Key.

  3. To obtain id_token, you need to follow the method below and convert client_secret into id_token

    Encrypt

    client_id=<client_id>&timestamp=<timestamp in millisecond>

    with RSA X.509 format Base64 encoded client_secret to obtain id_token

    Sample code using JavaScript:

  4. Calling the authentication API to obtain the access_token to start using the YouCam Online Editor AI APIs.

Please note that your credits will be consumed when the resulting image was successfully generated. You may refer to the pricing page regarding the price of each task and how to obtain credits.

Now, let's consider an example usage flow of an AI Photo Enhance API calling sequence. After successfully authorizing and getting the access_token, you can call 'file/enhance' to acquire the upload URL and a File ID associated with it. So that You can upload your photo to the upload URL and use the File ID to run a AI task.

AI Photo Enhance

Subsequently, calling POST 'task/enhance' with the File ID executes the enhance task and obtains a task ID.

This task ID is used to monitor the task's status through polling GET 'task/enhance' to retrieve the current engine status. Until the engine completes the task, the status will remain 'running', and no credits will be consumed during this stage.

AI Photo Colorize

The task will change to the 'success' status after the engine successfully processes your input file and generates the resulting image. Your credits will only be consumed in this case. If the engine fails to process the task, the task's status will change to 'error' and no credits will be consumed.

AI Image Generator

When deducting credits, the system will prioritize those nearing expiration. If the expiration date is the same, it will deduct the credits obtained on the earliest date.

File Retention Period

All uploaded files are kept on the server for one day and deleted automatically after they are expired. The resulting files generated by the system are kept on the server for 30 days and deleted automatically after they are generated.

Supported Formats & Dimensions

AI Editing & Enhance Supported Dimensions Supported File Size Supported Formats
AI Photo Enhance 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
AI Video Enhance input: long side <= 1920; output: max 2x input resolution <100MB container: mov, mp4; video codec: MPEG-4, H.264 AVC; audio codec: aac, mp3
AI Object Removal 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
Al Photo Background Removal 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
AI Photo Background Change 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
AI Photo Background Blur 4096x4096 (long side <= 4096) < 10MB jpg/png/heic
AI Photo Colorize 4096x4096 (long side <= 4096) < 10MB jpg/png
AI Photo Lighting 4096x4096 (long side <= 4096, short side >= 256) < 10MB jpg/png
AI Photo Color Correction 4096x4096 (long side <= 4096) < 10MB jpg/png
AI Replace long side <= 2048, short side <= 1024 < 10MB jpg/png
Generative AI Supported Dimensions Supported File Size Supported Formats
AI Image Generator 1024x1024 (long side <= 1024) < 10MB jpg/png
AI Hairstyle Generator long side <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15 < 10MB jpg
AI Hair Extension long side <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15 < 10MB jpg/png
AI Hair Bang Generator long side <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15 < 10MB jpg/png
AI Hair Volume Generator long side <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15 < 10MB jpg/png
Face AI Supported Dimensions Supported File Size Supported Formats
AI Makeup Transfer 1024x1024 (long side <= 1024) < 10MB jpg/png/heic
AI Face Swap 4096x4096 (long side <= 4096) < 10MB jpg/png

Error Codes

  • Successful responses (100 - 399)
  • Client error responses (400 - 499)
  • Server error response (500 - 599)
Error Code description
exceed_max_filesize Input file size exceeds the maximum limit
invalid_parameter Invalid parameter value
error_download_image Download source image error
error_download_mask Download mask image error
error_decode_image Decode source image error
error_decode_mask Decode mask image error
error_nsfw_content_detected NSFW content detected in source image
error_no_face No face detected on source image
error_pose Failed to detect pose on source image
error_face_parsing Failed to do face segmentation on source image
error_inference Inference pipeline error
exceed_nsfw_retry_limits Exceed the retry limits to avoid generated NSFW image
error_upload Upload result image error
error_multiple_people Multiple people detected in the source image
error_no_shoulder Shoulders are not visible in the source image
error_large_face_angle The face angle in the uploaded image is too large
unknown_internal_error Others

FAQ

For more information and questions, please refer to our blog page and the FAQ page. Or send an e-mail to YouCamOnlineEditor_API@perfectcorp.com. Our customer success team are very happy to help. ;)

Last modified: 29 Oct. 2024

Authentication

Authentication with Perfect API server.

Authenticate and obtain access_token

Request Body schema: application/json
required
client_id
required
string

Your api key

id_token
required
string

Encrypt client_id=<client_id>&timestamp=<timestamp in millisecond> with RSA X.509 format Base64 encoded client_secret to obtain id_token, where your API Key is the client_id and the Secret key is the client_secret.

Responses

Response Schema: application/json
status
integer

Response status

object
access_token
string

The access token valid for 2 hours. Pass this as Bearer token to call other APIs

Request samples

Content type
application/json
{
  • "client_id": "BMIL1PIJjCV96JlSl64RlVksHK1cD0PQ",
  • "id_token": "dMtD+7WpLVe8Z1sdJAQ6GhuJBI+YeR79+FVNspLjEsfMIpfiXmdyskjAPEFgCwseJJozqZeIPjtZi8f5ttSHjCYjnZaYI5mhGU4IGdGofAVcwIBA5UJ/FQcoXh29S2ZG66uKUcnyNnbEW9iu1vha/juy7IRvafOQ3Yx4nxbmrEM="
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Credit system

Query credit information and usage history.

Get credit info

Authorizations:
BearerAuthentication

Responses

Response Schema: application/json
status
integer

Response status

Array of objects
Array
id
integer

Unique identifier of this credit

type
string
Enum: "SubsToken" "PaygToken"

Type of this credit

amount
integer

Current credit balance

expiry
integer

Unix timestamp of the expiry of this credit (ms)

Response samples

Content type
application/json
{
  • "status": 200,
  • "results": [
    ]
}

Get credit history

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in a page. Valid value should be between 1 and 30. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

Unique identifier of the history

timestamp
integer

Unix timestamp of the history (ms)

action
string
Enum: "photo_enhance" "api_photo_enhance" "object_removal" "api_object_removal" "background_removal" "api_background_removal" "colorize" "api_colorize" "text_to_image" "api_text_to_image" "hair_style" "api_hair_style" "blur_background" "change_background" "wig" "trial_gift_text_to_image" "sign_up_gift" "subscription_credits" "subscriber_gift" "permanent_credits" "compensation_from_customer_service" "renew" "expire"

Action of this history

target_id
string

Id of the target for this credit. For example, when running AI Photo Enhance task, target_id for this history will be task_id of the AI Photo Enhance task. When purchasing credit, the target_id for this history will be order_id

object
Array of objects

Detailed information for each credit

Array
id
integer

Id of the credit

amount
integer

Total amount changed from this credit

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

AI Photo Enhance

AI Photo Enhance

Sharpen, upscale, denoise, and fix colors to transform low-resolution images into high-quality masterpieces.

AI Photo Enhance

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI Photo Enhance task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of file to run enhancement. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
scale
required
integer

Scaling ratio. Available values are 1, 2, 4.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an AI Photo Enhance task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Object Removal

AI Object Removal

Remove unwanted objects with precision from your photos while preserving intricate details.

AI Object Removal

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI Object Removal task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to run object removal. File ID from upload file API.

mask_ids
required
Array of strings

ID of the file to run object removal. This should be a grey scale mask image with the exact same width and hight with the input image where white pixels indicate foregroud and black pixels represent background. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an AI Object Removal task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

Al Photo Background Removal

AI Photo Background Removal

Remove background from photo with impeccable accuracy, ensuring the high quality of images.

AI Photo Background Removal

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an Al Photo Background Removal task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Repeated requests with the same request ID will be ignored by the server. This ID should remain consistent for retries due to connection issues. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to run SOD. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate anid for each actiond. This action id has to be unique per task. In the response from the get status API, these actionids will be used to let the client know which results correspond to each action.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an Al Photo Background Removal task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Photo Background Change

AI Photo Background Change

The AI Photo Background Change tool enhances photos by effortlessly isolating the subject from the background image, allowing for various application, including in business, to sharpen the focus on product subjects.

By using this API, you can easily extract a foreground mask from a input image. So that you can change the background using the mask by any other images or colors.

Sample Before:

After:

Before:

After:

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI photo Background Change task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Repeated requests with the same request ID will be ignored by the server. This ID should remain consistent for retries due to connection issues. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to change background. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate anid for each actiond. This action id has to be unique per task. In the response from the get status API, these actionids will be used to let the client know which results correspond to each action.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check AI photo Background Change task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Photo Background Blur

AI Photo Background Blur

The AI Photo Background Blur tool enhances photos by effortlessly isolating the subject from the background image, allowing for various application, including in bokeh simulation, to sharpen the focus on product subjects.

By using this API, you can easily extract a foreground mask from a input image. So that you can blur the background using the mask by any image blur algorithms like the gaussian blur or custom blur kernels.

Sample Before:

After:

Before:

After:

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI photo Background Blur task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Repeated requests with the same request ID will be ignored by the server. This ID should remain consistent for retries due to connection issues. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to blur background. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate anid for each actiond. This action id has to be unique per task. In the response from the get status API, these actionids will be used to let the client know which results correspond to each action.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check AI photo Background Blur task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Photo Colorize

AI Photo Colorize

Using the latest AI technology to colorize black and white photos, old images, or repair them.

AI Photo Colorize

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run a AI Photo Colorize task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to run colorize. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Photo Colorize task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Image Generator

AI Image Generator

Transform words into vivid visuals with our cutting-edge AI text-to-image feature.

AI Image Generator

List predefined style groups for AI Image Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Image Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Image Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
prompt
required
string

Prompt to generate image

style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Image Generator task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Hairstyle Generator

AI Hairstyle Generator

Using the latest AI technology to try a wide variety of hairstyles, catering to both women and men, meeting different gender and style preference. Discover a world of styles: curly, long, buzz cut, and more. Our AI-powered hair changer lets you experiment effortlessly. Find your ideal hairstyle now!

Want to see more Hair styles? Please refer to https://yce.perfectcorp.com/ai-hairstyle-generator.

Use case: AI Hairstyle Generator

AI Hairstyle Generator

Suggestions for How to Shoot: Suggestions for How to Shoot

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Hairstyle Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Hairstyle Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Hairstyle Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of file to apply hair style. File ID from upload file API

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Hairstyle Generator task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Hair Extension

AI Hair Extension

Discover Your Perfect Hair Extension Match with AI​ Experiment with a variety of lengths—from long to extra-long—styles, colors, and bangs, all from the comfort of your device. No more guessing games—see exactly how each hair extension style looks on you with the advanced Generative AI. Make informed styling decisions before committing to a new look.​ With the advanced Hair Extension Try-On, which naturally blends with your current hair length, it’s the perfect time to experiment with super-long styles.

Use case: AI Hair Extension

AI Hair Extension

Suggestions for How to Shoot: Suggestions for How to Shoot

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Hair Extension task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Hair Extension task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Hair Extension task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

object
required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

required
object
src_ids
required
Array of strings

ID of file to apply hair extension. File ID from upload file API

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Hair Extension task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Hair Bang Generator

AI Hair Bang Generator

Try on Your Perfect Hair Bangs with AI Realistic Looks: Experiment with realistic bangs and discover the style that best complements your face.​ Versatile Styling Options: Explore a wide range of bangs styles to suit every personality and occasion.​ Effortless Experience: Enjoy a user-friendly interface that makes trying new bangs easy and fun​.

Want to see more Hair Bang styles? Please refer to https://yce.perfectcorp.com/bangs-filter.

Use case:

AI Hair Bang Generator

AI Hair Bang Generator

Suggestions for How to Shoot: Suggestions for How to Shoot

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Hair Bang Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Hair Bang Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Hair Bang Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

object
required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

required
object
src_ids
required
Array of strings

ID of file to apply hair bang generator. File ID from upload file API

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Hair Bang Generator task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Hair Volume Generator

AI Hair Volume Generator

Enhance Your Look with Fuller, More Voluminous Hair Instantly!​ Add natural volume to fine or thinning hair. Seamlessly fill gaps or add hair with AI. Works for all hair types: straight, curly, thin. Perfect for dating profiles, resumes & more. Our AI tool helps you achieve perfect hair volume and density in all your photos, whether for personal, professional, or social use. Say goodbye to bad hair days in pictures and hello to fresh, voluminous hair every time.

Use case: AI Hair Volume Generator

AI Hair Volume Generator

Suggestions for How to Shoot: Suggestions for How to Shoot

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style groups for AI Hair Volume task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style group

object
title
string

Title of this style group

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

List predefined style for AI Hair Volume Generator task

Authorizations:
BearerAuthentication
query Parameters
page_size
integer
Example: page_size=20

Number of results to return in this page. Valid value should be between 1 and 20. Default 20.

starting_token
string
Example: starting_token=13045969587275114

Token for current page. Start with null for the first page, and use next_token from the previous response to start next page

style_group_id
integer
Example: style_group_id=18213963761051864

The id of style group

Responses

Response Schema: application/json
status
integer

Response status

object
next_token
string

Token to query next page.

Array of objects
Array
id
integer

ID of style

object
title
string

Title of this style

thumb
string

Thumbnail url for this parameter

Response samples

Content type
application/json
{}

Run a AI Hair Volume Generator task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

object
required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
style_group_id
required
integer

Id of style group

style_ids
required
Array of numbers

Id of style to run the task. Only accept 1 style.

required
object
src_ids
required
Array of strings

ID of file to apply hair volume generator. File ID from upload file API

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check the status of a AI Hair Volume Generator task

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string

Error of this task. Available only when the task status is error

Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. Valid for 2 hours

Response samples

AI Image Extender

AI Image Extender

Expand your photos with our AI Image Extender. Seamlessly broaden visuals for all ratios.

AI Image Extender

Whether you're aiming for Instagram glory or framing a digital masterpiece, select from a variety of sizes and ratios for that perfect fit. As you tweak and transform, our AI seamlessly weaves its magic, ensuring the expanded areas blend flawlessly with your original photo.

AI Image Extender

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI Image Extender task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of file to run enhancement. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object

The AI Image Extender API takes 3 key parameters to work, an input image, a pivot point and an output image. The size of output image should always be larger than the size of input image. And the recommeded size of output image should be less than two times of the size of input image to ensure better quality. The pivot point with location input_x and input_y is used to place the top-left of input image to the output image. You need to scale the input image by youself first if any of edges of the input image is larger than 4096. Or using the crop parameters to crop the input image. After cropping, you need to make sure the input image is completely inside the output image with your pivot point. It is your resposibility to provide correct pivot point and size of the output image. Otherwise, you may get unexpected results.

output_width
required
integer

Output image height. value range: [1 - 4096]

output_height
required
integer

Output image width. value range: [1 - 4096]

input_x
required
integer

Source image left position in output image, where The indices are ordered from top to bottom, and from left to right. value range: [0 - 4096]

input_y
required
integer

Source image top position in output image, where The indices are ordered from top to bottom, and from left to right. value range: [0 - 4096]

input_width
required
integer

Source image width, input_x + input_width must ⇐ output_width. value range: [1 - 4096]

input_height
required
integer

Source image height, input_y + input_height must ⇐ output_height. value range: [1 - 4096]

crop_input_x
required
integer

Crop source image from x, where The indices are ordered from top to bottom, and from left to right. value range: [0 - 4096]

crop_input_y
required
integer

Crop source image from y, where The indices are ordered from top to bottom, and from left to right. value range: [0 - 4096]

crop_input_width
required
integer

Crop source image with width crop_input_width. value range: [1 - 4096]

crop_input_height
required
integer

Crop source image with height crop_input_height. value range: [1 - 4096]

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an AI Image Extender task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Photo Lighting

AI Photo Lighting

Brighten your images with Our AI image brightening tool effortlessly. With the legendary AI technology, lighten up any image of your choice. Brighten your dark photos or images with our AI Photo Lighting tool, illuminating your memories in a flash.

Before After Brighten low-light photos effortlessly using AI tool, bringing out stunning details and vibrant colors.

Before After Brighten your product pictures with AI Lighting tool for a captivating and stunning presentation.

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI Photo Lighting task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of file to run enhancement. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

params
required
object

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an AI Photo Lighting task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Photo Color Correction

AI Color Correction

Perfect AI Color Correction let you automatically adjust saturation, temperature, and hue of photos with ease. Adjust white balance to correct color temperature, enhance saturation and make it vibrant, correct exposure level to balance brightness, remove color casts or tints, improve skin tones for a nature-looking portrait, enhance shadow and highlight details, remove noise and improve clarity, or even apply creative color grading effects all in one touch.

Sample Before:

After:

Before:

After

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run a AI Photo Color Correction task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the file to correct color. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Photo Color Correction task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Replace

Al Replace

Replace unwanted elements with new objects using AI Replace. By using this API, you can instantly remove unwanted object from your photo and replace it with a new one just by using text. Eliminate anything from bags to cars and beyond.​

Sample:

For content creators aiming to perfect their social media presence, AI Replace offers a hassle-free way to polish travel photos or promotional images. Remove and replace elements with ease, ensuring your content stands out.

Create stunning room mockups with AI Replace by filling empty spaces with aesthetically pleasing furniture and objects, transforming the perception of any space.

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run an AI Replace task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of main image. File ID from upload file API.

msk_ids
required
Array of strings

ID of masked area image. This should be a grey scale mask image with the exact same width and hight with the input image where white pixels indicate foregroud and black pixels represent background. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
prompt
required
string

Prompt for generating objects in the masked area.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check an AI Replace task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Makeup Transfer

AI Makeup Transfer

Just Upload a Desired Photo with the Look You Like! AI Makeup Transfer makes it easy and fun to experiment with different looks by letting you to upload desired photo to try them one by one. Have any makeup look you want to try now? Let us amaze you with AI Makeup Transfer!

First, upload a photo of yourself where your face and its features are clearly visible as the target image.

Then, upload a photo of your favorite makeup look as the reference image.

There you have it - an AI Makeup Transferred photo.

Samples:

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run a AI Makeup Transfer task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the target image to transfer. File ID from upload file API.

ref_ids
required
Array of strings

ID of the reference image. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Makeup Transfer task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Face Swap

AI Face Swap

Using AI Face Swap for hyper-realistic effect with multiple faces supported.​ Our face swap artificial intelligence supports swapping one or multiple faces. Either for creating funny pictures of faces, or need a professional tool, we've got you covered.

Multiple faces swap sample:

Single face swap sample:

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run a AI Face Swap face detection task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the target image to detect face. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Face Swap face detection task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Array of objects

Response samples

Content type
application/json

Run a AI Face Swap task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the target image for swap.

ref_ids
required
Array of strings

ID of the reference image. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

required
object
required
Array of objects

The designated ref image id and face position information to be swapped for each detected face on target image. e.g. [{'index': 0, 'position': 1}] indicates that the second face on the target image is going to be swapped with the first reference image

Array
index
integer

The index of reference image

position
integer

The index of face on the target image. The index is from faces of detection result.

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Face Swap task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples

AI Video Enhance

AI Video Enhance

Fix blur, adjust sharpness and brightness, and instantly transform low-quality videos into clear, high-quality content with AI. From 480p to 4K, unblur, upscale, and boost quality with the video enhancer—no skills needed.

Supported format: .mp4,.mov,.m4v are supported. Please keep the duration under 1 minute. Maximun output resolution: up to 4K.

Sample:

Create a new file.

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
required
Array of objects
Array
content_type
required
string
Enum: "image/jpg" "image/jpeg" "image/png" "video/mp4"

Content MIME type for this file. Currently available values are listed in the enum.

file_name
required
string

Name of this file

Responses

Response Schema: application/json
status
integer

Response status

object
Array of objects
Array
content_type
string

Content MIME type for this file.

file_name
string

Name of this file

file_id
string

ID of this file. Other run task API will need this file_id.

Array of objects

Using upload url, headers, method below to upload file. After completion, the file_id is used to proceed with calling run task API.

Array
headers
object

Headers to include when uploading the file

url
string

URL to upload this file

method
string

HTTP method to upload this file

Request samples

Content type
application/json
{
  • "files": [
    ]
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Run a AI Video Enhance task

Authorizations:
BearerAuthentication
Request Body schema: application/json
required
request_id
required
integer

Incremental request number starting from 0. Requests with the same request_id will be ignored by the server. request_id should remain the same if the API client needs to retry the API due to a connection issue. This is to prevent duplicate deduction of credits caused by running the same task repeatedly. For instance, if the same file_id is sent with the same request_id, the engine won't re-run the task, nor will duplicate consume credits. However, if a client wants to generate multiple different results using the same file_id, the client needs to increment the request_id then the engine will re-run the task and consume the credit accordingly.

required
object
required
object
src_ids
required
Array of strings

ID of the video to enhance. File ID from upload file API.

required
Array of objects

Only accept 1 action.

Array
id
required
integer

ID of this action, start with 0. The client needs to generate an id for each action. This action id has to be unique per task. In the response from the get status API, these action id will be used to let the client know which results correspond to each action.

object
dst_duration
required
integer

The length of video in seconds

Responses

Response Schema: application/json
status
integer

Response status

object
task_id
string

ID of this task. This task_id will only valid if client continue polling check status API with interval polling_interval defined in check status API response. Otherwise, engine might consider client have leave and will not process the task. No credit will be consumed in this case.

Request samples

Content type
application/json
{
  • "request_id": 0,
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "result": {
    }
}

Check a AI Video Enhance task status

Authorizations:
BearerAuthentication
query Parameters
task_id
string
Example: task_id=SX9ALF1Z+KIiNa+GaFRp4bI5gijoc/ckI2teebLq35Bo1Nwc++3iXXdKqnU4/LID

ID of task to check

Responses

Response Schema: application/json
status
integer

Response status

object
polling_interval
integer

Milliseconds waiting time for start next polling. Note that the task will lose if no polling in 10 seconds

status
string
Enum: "running" "success" "error"

Status of this task

error
string (EngineErrorCode)
Enum: "exceed_max_filesize" "invalid_parameter" "error_download_image" "error_download_mask" "error_decode_image" "error_decode_mask" "error_nsfw_content_detected" "error_no_face" "error_pose" "error_face_parsing" "error_inference" "exceed_nsfw_retry_limits" "error_upload" "unknown_internal_error"

Errors:

  • exceed_max_filesize - Input file size exceeds the maximum limit
  • invalid_parameter - Invalid parameter value
  • error_download_image - Download source image error
  • error_download_mask - Download mask image error
  • error_decode_image - Decode source image error
  • error_decode_mask - Decode mask image error
  • error_nsfw_content_detected - NSFW content detected in source image
  • error_no_face - No face detected on source image
  • error_pose - Failed to detect pose on source image
  • error_face_parsing - Failed to do face segmentation on source image
  • error_inference - Inference pipeline error
  • exceed_nsfw_retry_limits - Exceed the retry limits to avoid generated NSFW image
  • error_upload - Upload result image error
  • unknown_internal_error - Others
Array of objects
Array
id
integer

ID of action

Array of objects
Array
dst_id
string

File ID of the result file is used for integrating other task. No need to reupload file.

url
string

URL to download this result. URL only valid for 2 hours

Response samples