Skip to main content
POST
Image Faceswap
The resources (image, video, voice) generated by our API are valid for 7 days. Please save the relevant resources as soon as possible to prevent expiration.
Experience our face swap technology in action by exploring our interactive demo on GitHub: AKool Face Swap Demo.

Important Notes

  • You can get the opts parameter (landmarks_str) through the Face Detect API
  • The Face Detect API returns a landmarks_str value that should be used as the value of opts
  • When using Face Detect API, set single_face: true to return only the largest face data, or false to return all detected faces
  • Ensure that the targetImage and sourceImage arrays are properly aligned and correspond to each other
  • Model Selection: To use different face swap models available on the official website, set face_enhance: 0 for Classic Model, and face_enhance: 1 for HD Optimized model. For Clarity Boost and Identity Keeper models, please contact our sales and technical support team

Authorizations

x-api-key
string
header
required

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

application/json
targetImage
object[]
required

A collection of faces in the original image

sourceImage
object[]
required

Replacement target image information

modifyImage
string
required

Modify the link address of the image

face_enhance
enum<integer>
default:0

Whether facial enhancement (1 means open, 0 means close)

Available options:
0,
1
webhookUrl
string

Callback url address based on HTTP request

Response

200 - application/json

Faceswap request submitted successfully

code
integer
required

Interface returns business status code (1000: success)

Example:

1000

msg
string
required

Interface returns status information

Example:

"OK"

data
object