Face Swap Pro
Highest quality face swap for images
Documentation Index
Fetch the complete documentation index at: https://docs.akool.com/llms.txt
Use this file to discover all available pages before exploring further.
Face Swap Pro (akool_faceswap_image_hq)
Face Swap Pro delivers the highest quality face swap results for images:- More Realistic: Advanced algorithm produces natural and lifelike face swaps
- More Similar: Enhanced matching ensures high similarity to the source face
- Simplified Integration:
optsparameter is optional, no face detection step required - Batch Support: Supports up to 50 sourceImage / targetImage pairs per request
- Optional Face Landmarks: Provide
optsfrom the Face Detection API for improved accuracy
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sourceImage | array | Yes | Source (new) face image URLs. Each item: { "path": "url", "opts": "landmarks" }. Min 1, Max 50 items. |
sourceImage[].path | string | Yes | Valid URL of the source face image. Must be a valid HTTP/HTTPS URL. |
sourceImage[].opts | string | Conditional | Face landmark string from crop_landmarks of Face Detection API. Required when sourceImage or targetImage array length > 1. Optional when both arrays have exactly 1 element. |
targetImage | array | Yes | Target face image URLs. Each item: { "path": "url", "opts": "landmarks" }. Min 1, Max 50 items. |
targetImage[].path | string | Yes | Valid URL of the target face image. Must be a valid HTTP/HTTPS URL. |
targetImage[].opts | string | Conditional | Face landmark string from crop_landmarks of Face Detection API. Required when sourceImage or targetImage array length > 1. Optional when both arrays have exactly 1 element. |
model_name | string | No | Default: akool_faceswap_image_hq |
webhookUrl | string | No | Callback URL for result notification |
face_enhance | boolean | No | Enable face enhancement (default: false) |
single_face_mode | boolean | No | When true, enables single face mode (default: false) |
Getting opts Value
Theopts parameter provides face landmark coordinates for improved face alignment accuracy. To get the opts value:
- Call the Face Detection API with your image URL
- Use the
crop_landmarksvalue from the response as theoptsparameter - Format: colon-separated coordinate pairs, e.g.
"262,175:363,175:313,215:272,279"
Important Notes
Parameter Validation Rules
pathvalidation: Eachpathmust be a valid HTTP/HTTPS URL. Invalid URLs will be rejected.optsconditional requirement:- When both
sourceImageandtargetImagearrays have exactly 1 element each:optsis optional for all elements - When either
sourceImageortargetImagearray has more than 1 element:optsis required for every element in both arrays - If any element is missing
optswhen required, the request will be rejected with a validation error
- When both
Usage Guidelines
- For single face swap (1 source + 1 target):
optsis optional but recommended for better accuracy - For batch face swap (multiple faces):
optsis required for all elements to ensure proper face mapping - For multi-face swap, image + video support, or video segment swap, use Face Swap Plus
Example: Single Face Swap (opts Optional)
When both arrays have exactly 1 element,opts is optional:
Example: Single Face Swap with opts (Recommended)
Example: Batch Face Swap (opts Required)
When either array has more than 1 element,opts is required for all elements:
Authorizations
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.
Body
Source (new) face image URL array. Each item contains path (required, must be valid URL) and opts (conditional).
opts requirement:
- Required when
sourceImageortargetImagearray length > 1 (all elements must haveopts) - Optional when both
sourceImageandtargetImagearrays have exactly 1 element each
The opts value comes from the crop_landmarks field returned by the Face Detection API.
1 - 50 elementsTarget face image URL array. Each item contains path (required, must be valid URL) and opts (conditional).
opts requirement:
- Required when
sourceImageortargetImagearray length > 1 (all elements must haveopts) - Optional when both
sourceImageandtargetImagearrays have exactly 1 element each
The opts value comes from the crop_landmarks field returned by the Face Detection API.
1 - 50 elementsModel name (default: akool_faceswap_image_hq)
akool_faceswap_image_hq Callback URL for result notification
Whether to enable face enhancement (default false)
When true, enables single face mode for simplified single-face swap.
When false (default), standard mode.