Multi-face swap for images and videos
face_mappingsingle_face_mode for simplified single-face swaprealistic, beautify, or lossless styles| Parameter | Type | Required | Description |
|---|---|---|---|
source_url | string | Yes | Source (new) face image URL |
target_url | string | Yes | Target material URL (image or video) |
webhookUrl | string | No | Callback URL for result notification |
face_enhance | boolean | No | Enable face enhancement (default: false) |
model_style | string | No | realistic (default), beautify, or lossless |
single_face_mode | boolean | No | false (default) for multi-face mode, true for single-face mode |
single_face_mode is false (default), use face_mapping to define multiple source-target face pairs:
| Parameter | Type | Required | Description |
|---|---|---|---|
face_mapping | array | Yes | Array of face mapping objects |
face_mapping[].source_face_info | object | Yes | Source face info |
face_mapping[].source_face_info.face_url | string | Yes | Source face image URL |
face_mapping[].source_face_info.bbox | number[] | No | Bounding box [x1, y1, x2, y2]. See bbox rules |
face_mapping[].target_face_info | object | Yes | Target face info |
face_mapping[].target_face_info.face_url | string | No | Target face image URL |
face_mapping[].target_face_info.bbox | number[] | No | Bounding box [x1, y1, x2, y2]. See bbox rules |
single_face_mode is true, enables simplified single-face swap mode:
| Parameter | Type | Required | Description |
|---|---|---|---|
single_face_mode | boolean | Yes | Set to true for single-face mode |
bbox parameter in source_face_info and target_face_info depends on where face_url comes from:
| face_url source | bbox required? | Description |
|---|---|---|
face_urls from Face Detection API | No | The URL is already a cropped face image, no bbox needed |
| User-uploaded original image URL | Yes | Provide bbox from crop_region of the Face Detection API response |
crop_region from Face Detection API returns [x, y, width, height]. Convert it to bbox format [x1, y1, x2, y2]:
x1 = x, y1 = y, x2 = x + width, y2 = y + heightface_urls from the Face Detection API response, bbox is not required:
crop_region:
Your API Key used for request authorization. If both Authorization and x-api-key have values, Authorization will be used first and x-api-key will be discarded.
Source (new) face image URL
Target material URL (image or video)
Callback URL for result notification
Whether to enable face enhancement (default false)
Model style: realistic (default), beautify, or lossless
realistic, beautify, lossless Face mapping array for multi-face swap (required when single_face_mode is false).
Each item maps one source face to one target face.
When true, enables single-face mode for simplified single-face swap.
When false (default), uses face_mapping for multi-face swap.