Face Replacement API
POSThttps://api.acedata.cloud/face/swap

This API can be used to swap faces based on the source and target images.

Request Headers

acceptstring
Specify the response format returned by the server.
Please select
authorizationstring
Bearer token

Request Body

source_image_urlstring
Source image URL. The final generated image will retain all content of the image (excluding faces). Please ensure that the provided URL directly points to an accessible image file, rather than an image embedded in a webpage.
target_image_urlstring
The URL of the target image. The final generated image will replace the face in this image. Please ensure that the provided URL directly points to an accessible image file, rather than an image embedded in a webpage.
callback_urlstring
Webhook callback URL for asynchronous notifications.
asyncboolean
Whether to process in asynchronous mode. When set to `true`, the interface immediately returns `task_id`, without the need to provide `callback_url`, and then the result can be obtained by polling the corresponding task query interface; if `callback_url` is also provided, the result will be pushed to that callback address.
Please select
timeoutnumber
The maximum time to wait for a task to complete (in seconds). The default value is 120 seconds.

Response

Face Transformation
Allow Use General Balance

When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.

Shell

Python

JavaScript

Java

Go

PHP

Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.