This async endpoint from Qubico's Faceswap API swaps the face from the swap_image
to the target_image
.
INFO
This async endpoint from Qubico's Faceswap API swaps faces from the swap_image
onto the target_image
.
Users on Qubico could change target faces (≥1) following specific logic which you could check as follows.
swap_image
and target_image
should be under 2048 x 2048 resolution each.swap_image
and target_image
should be passed in as URLs (ending in .jpg
/ .jpeg
/ .png
/ .webp
) or as base64 strings.Task-type | Price (USD) |
---|---|
multi-face-swap | $0.015 per generation |
The multi-face-swap
API logic operates based on the sequential order of faces detected by the algorithm, with the model assigning numeric labels from 0
to n
. While users can generally expect the API to sort faces in a left-to-right order, diagonal face positioning in photos may alter this sequence.
For instance, when one face appears in the upper-left and another in the lower-right, the model might label the upper-left face as 1
and the lower-right as 0
. Conversely, a lower-left face could be labeled 0
while an upper-right face becomes 1
. This positional variation in labeling occurs due to the algorithm's spatial evaluation of face arrangements within the frame.
curl --location --request POST '/api/v1/task' \
--header 'x-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "Qubico/image-toolkit",
"task_type": "multi-face-swap",
"input": {
"swap_image": "https://i.ibb.co/kVPGB4wG/input.png",
"target_image": "https://i.ibb.co/Lhbjs0tx/source.png",
"swap_faces_index": "0,1",
"target_faces_index": "0,1"
},
"config": {
"webhook_config": {
"endpoint": "",
"secret": ""
}
}
}'
{
"code": 200,
"data": {
"task_id": "90efd2db-bcfc-413f-a0be-c893850c9d68",
"model": "Qubico/image-toolkit",
"task_type": "face-swap",
"status": "pending",
"config": {
"webhook_config": {
"endpoint": "",
"secret": ""
}
},
"input": {},
"output": null,
"meta": {},
"detail": null,
"logs": [],
"error": {
"code": 0,
"raw_message": "",
"message": "",
"detail": null
}
},
"message": "success"
}