Create Task
POST
/api/v1/taskThis async endpoint from PiAPI's Faceswap API swaps the face from the swap_image
to the target_image
.
:::info
This async endpoint from PiAPI's Faceswap API swaps the face from the swap_image
onto the target_image
.
Format & Constraints
- Size & Resolution: both swap_image and target_image should be under 2048 x 2048 resolution each.
- Input Format: both swap_image and target_image should be passed in as urls (ending in jpg/jpeg/png/webp) or in base64 string.
:::
Request
Your API Key used for request authorization
Webhook provides timely task notifications. Check PiAPI webhook for detail.
This allows users to choose whether this specific task will get processed under PAYG or HYA mode. If unspecified, then this task will get processed under whatever mode (PAYG or HYA)
the user chose on the workspace setting of your account.
public
means this task will be processed under PAYG mode.private
means this task will be processed under HYA mode.
{
"model": "Qubico/image-toolkit",
"task_type": "face-swap",
"input": {
"target_image": "https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg",
"swap_image": "https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg"
}
}
Request samples
Responses
Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged
If you get non-null error message, here are some steps you chould follow:
- Check our common error message
- Retry for several times
- If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon.
{
"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"
}