Перейти к основному содержанию
POST
/
face
/
swap
Face swap based on the provided image.
curl --request POST \
  --url https://api.acedata.cloud/face/swap \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "timeout": 123,
  "callback_url": "<string>",
  "source_image_url": "https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg",
  "target_image_url": "https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg"
}
'
{
  "success": true,
  "task_id": "<string>",
  "image_url": "<string>",
  "image_width": "<string>",
  "image_height": "<string>"
}

Авторизации

Authorization
string
header
обязательно

Заголовки

accept
enum<string>

Specifies the format of the response from the server.

Доступные опции:
application/json,
application/x-ndjson

Тело

application/json
timeout
number

The maximum time in seconds to wait for the task to complete. Default is 120 seconds.

callback_url
string

Webhook callback URL for asynchronous notifications.

source_image_url
string

The URL of the source image. The final image will show the same content as the provided image except for the face. Make sure the provided URL points directly to an openable image, not an image embedded in a webpage.

Пример:

"https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg"

target_image_url
string

The URL of the target image. The final image will show the same content as the provided face. Make sure the provided URL points directly to an openable image, not an image embedded in a webpage.

Пример:

"https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg"

Ответ

Image generated successfully or operation performed successfully.

success
boolean

Indicates if the task was successful executed.

task_id
string

The ID of the imagine task.

image_url
string

The URL of the generated image, if you want to get the raw image use the raw_image_url field.

image_width
string

The width of the generated image.

image_height
string

The height of the generated image.