Swap a face from image_template onto image_target and receive an asynchronous task for result retrieval.
https://www.ailabapi.com/api/portrait/editing/ai-face-swapPOSTmultipart/form-data| Field | Value |
|---|---|
| API Name | AI Face Swap |
| API URL | /api/portrait/editing/ai-face-swap |
| Documentation URL | /docs/ai-portrait/editing/ai-face-swap |
| Unique identification | portrait_ai_face_swap |
| Field | Requirements |
|---|---|
image_target | Image format: JPEG/JPG/PNG, Image size: No more than 5 MB., Image resolution: Less than 4096x4096px. |
image_template | Image format: JPEG/JPG/PNG, Image size: No more than 5 MB., Image resolution: Less than 4096x4096px. |
| Field | Required | Type | Description |
|---|---|---|---|
ailabapi-api-key | YES | string | Application API KEY. Get API KEY |
| Field | Required | Type | Description |
|---|---|---|---|
image_target | YES | file | Target portrait image. The face in this image will be replaced. |
image_template | YES | file | Template portrait image that provides the face to swap. |
| Field | Type | Scope | Description |
|---|---|---|---|
task_type | string | async | Task Type. “async: Asynchronous tasks. |
task_id | string | Asynchronous task ID. Please use this field when calling the Querying Async Task Results API. |
Querying Async Task Results Response| Field | Type | Scope | Description |
|---|---|---|---|
task_status | integer | 0, 1, 2 | Asynchronous task status. 0`: The task is queued.` 1: Asynchronous processing. “2: Processing was successful. |
data | object | The result payload returned by the asynchronous task. | |
+image | string | Result image URL. |
API Key for authentication
The image to be modified. The face in this image will be replaced.
JPEG JPG PNGThe image that provides the face to use.
JPEG JPG PNGSuccess
The response is of type object.