Light Mode
Faceswap
POST
/api/face_swap/v1/asyncThis async endpoint from PiAPI's Faceswap API swaps the face from the swap_image
to the target_image
.
Request
Header Params
X-API-Key
string
required
Insert your API Key here
Example:
{{x-api-key}}
Body Params application/json
target_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 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".
Example
{
"target_image": "Superman.png",
"swap_image": "Leonardo_Dicaprio.png",
"result_type": "url"
}
Request samples
Responses
OK(200)
Bad Request(400)
Unauthorized(401)
Server Error(500)
HTTP Code: 200
Content Type : JSONapplication/json
OK - Successful response
Data Schema
code
integer
optional
data
object
optional
task_id
string
optional
message
string
optional
ExampleExample 1
{
"code": 200,
"data": {
"task_id": "7a7ba527************1974d4316e22"
},
"message": "success"
}
Modified at 15 days ago