Swap faces in the target video sequentially using the chosen images.
Supports MP4 only (≤10MB, ≤720p, ≤600 frames).
Face-Swapping Logic Based on Algorithmic Face Order#
The face-swapping sequence is determined by the model's algorithmic detection of faces. Generally, faces are labeled numerically in order - for example, 0 represents the leftmost face, 1 represents the next face to the right, and so on. The model assigns order labels to detected faces, and users can generally expect the API to sort faces from left to right by default.However, if faces in a photo/video are positioned diagonally (e.g., one at the top-left and another at the bottom-right), the model may prioritize them as follows:
Top-left face → Labeled 1 (smaller)
Bottom-right face → Labeled 0 (larger)
Conversely, if one face is at the bottom-left and another at the top-right:
swap_faces_index: 0 1 target_faces_index: 1 0 Action: The left face in the source image replaces the right face in the target video, and the right face in the source replaces the left face in the target.
swap_faces_index: 0 1 target_faces_index: 0 1 Action: The left face in the source replaces the left face in the target; the right face in the source replaces the right face in the target.
Upload the image URL into this parameter (the URL should end with '.png', '.jpeg', or Base64 string). The face in this image will be swapped out with the swap_image face.
swap_image
string
required
Upload the image URL into this parameter (the URL should end with '.png', '.jpeg', or Base64 string). The face in this image will swapped be onto the target_image face.
result_type
string
optional
The format should be: "url" or "base64". Default type is "base64".