POST
/
deepfake
/
single_face_swap
Specific face swap in image
curl --request POST \
  --url https://modelslab.com/api/v6/deepfake/single_face_swap \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "init_image": "<string>",
  "target_image": "<string>",
  "reference_image": "<string>",
  "watermark": true,
  "webhook": "<string>",
  "base64": false,
  "track_id": 123
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "meta": {
    "init_image": "<string>",
    "target_image": "<string>",
    "reference_image": "<string>",
    "seed": 123,
    "temp": "<string>",
    "file_prefix": "<string>",
    "model_save_format": "<string>",
    "watermark": "<string>",
    "watermark_image": "<string>"
  }
}

Request

Make a POST request to below endpoint and pass the required parameters in the request body.
curl
--request POST 'https://modelslab.com/api/v6/deepfake/single_face_swap' \

Body

json
{    
    "key":"",    
    "init_image":" https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/DTs2zg3HELltVoQElpO3ec0f9BsAtS-metaNzExMTY5My1zYWxtYW4ta2hhbi1zaGFocnVraC1raGFuLTJbMV0ucG5n-.png",    
    "target_image":"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/jznUIJy6FoM1nUkXZBCvhyrlbetau1-metabGljZW5zZWQtaW1hZ2UuanBn-.jpg",    
    "reference_image":"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/9Mhbi9i0r9ADMfTpwTOqmyEQQyb6AK-metaSEQtd2FsbHBhcGVyLXNoYWhydWtoLWtoYW4tc3JrLWFjdG9yLWhlcm9bMV0uanBn-.jpg",    
    "base64":false,
    "webhook": null,    
    "track_id": null
}

Body

application/json
key
string
required

Your API Key used for request authorization

init_image
string<uri>
required

The initial image containing the face to replace

target_image
string<uri>
required

The target image containing the face to be swapped

reference_image
string<uri>
required

A reference image containing the specific face to swap from the initial image

watermark
boolean
default:true

Indicates if the generated result should include a watermark

webhook
string<uri> | null

A URL to receive a POST API call once the image generation is complete

base64
boolean
default:false

Input image is base64 format

track_id
integer | null

An ID included in the webhook response to identify the request

Response

Face swap response

status
enum<string>
Available options:
success
generationTime
number

Time taken to generate the result in seconds

id
integer

Unique identifier for the generation request

output
string<uri>[]

Array of URLs to the generated images

Array of proxy URLs for the generated images

meta
object

Metadata about the generation process and parameters used