API For Face Swap

Considerations

  1. Before using the API, make sure you have obtained the API key. Refer to the link below for instructions on how to obtain it. API For API Key Settings
  2. All generated images will be automatically deleted after 24 hours. Please make sure to save the images you need to your local storage in a timely manner.

Header Attributes

ParameterDescription
AuthorizationYour API Key used for request authorization.

Create Job

Request Url

--request POST https://developer.remaker.ai/api/remaker/v1/face-swap/create-job

Body Attributes

ParameterDescription
target_imageFace to be replaced(binary )
swap_imageYour Face(binary )

demo

import requests

url = 'https://developer.remaker.ai/api/remaker/v1/face-swap/create-job'
headers = {
    'accept': 'application/json',
    'Authorization': 'your token',
}
files = {
    'target_image': open('demo1.jpg', 'rb'),
    'swap_image': open('demo2.jpg', 'rb')
}

response = requests.post(url, headers=headers, files=files)

print(response.json())  # Print the response content

Fetch Job

Request Url

--request GET https://developer.remaker.ai/api/remaker/v1/face-swap/{job_id}

Body Attributes

ParameterDescription
job_idjob_id returned by create task

demo

import requests

url = 'https://developer.remaker.ai/api/remaker/v1/face-swap/224a9f67-5fc3-4c31-b33f-e611de310aa9'
headers = {'accept': 'application/json'}

response = requests.get(url, headers=headers)

print(response.json())  # Print the response content

Response

{
  "code": 100000,
  "result": {
    "job_id": "dcc56c3d-4686-4961-bb9f-81f030cd9777"
  },
  "message": {
    "en": "Request Success."
  }
}
{
  "code": 100000,
  "result": {
    "output_image_url": [
      "https://image.remaker.ai/datarm/api/face-swap/api/2024-03-05/output/0ba36469-0184-4f7b-b1f6-2a0e4d661d40.png"
    ],
    "input_image_url": [
      "https://image.remaker.ai/datarm/api/face-swap/api/2024-03-05/input/1dbdd84e-1cd9-4a53-8cf0-ac4cc6b5dd5e.png",
      "https://image.remaker.ai/datarm/api/face-swap/api/2024-03-05/input/9cb17f53-354b-4af0-819a-d5e70e935fa6.png"
    ],
    "job_id": "dcc56c3d-4686-4961-bb9f-81f030cd9777",
    "message": ""
  },
  "message": {
    "en": "Image generated successfully."
  }
}
Last Updated: