Skip to content

V1.0

AI Replace API allows you to replace specific objects in images using generative fill technology. Requires source image, mask for the area to replace, and a text prompt describing what should be generated.

Run an AI Replace task.

Request

Please refer to the polling guide for checking task status. This API requires a source image, mask file, and prompt describing what should replace the masked area.

Security
BearerAuthenticationV2
Bodyapplication/jsonrequired
Any of:
promptstringrequired

Prompt for generating objects in the masked area.

Example:"a cute cat"
src_file_urlstringrequired

Url of the file to run task. The url should be publicly accessible.

Example:"https://example.com/selfie.jpg"
msk_file_urlstringrequired

URL of the mask file. This should be a grey scale mask image with the exact same width and height with the input image where white pixels indicate foreground and black pixels represent background. The URL should be publicly accessible.

Example:"https://example.com/mask.jpg"
POST
/s2s/v2.0/task/obj-replace
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/obj-replace \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "src_file_url": "https://example.com/selfie.jpg",
    "msk_file_url": "https://example.com/mask.jpg",
    "prompt": "a cute cat"
  }'

Responses

Successful execution of the task

Bodyapplication/json
statusinteger

Response status

Example:200
dataobject
Response
{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }