Replace Object
Replace Object
POST https://api.novita.ai/v3/async/replace-object
Replace unwanted objects, defects, and people as desired.
This is an asynchronous API; only the task_id will be returned. You should use the task_id to request the Task Result API to retrieve the image generation results.
Example
This API helps to replace unwanted objects, defects, and people as desired.
Try it in playground.
Request:
curl --location --request POST 'https://api.novita.ai/v3/async/replace-object' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"negative_prompt": "ng_deepnegative_v1_75t, (badhandv4:1.2), (worst quality:2), (low quality:2), (normal quality:2), lowres, bad anatomy, bad hands, ((monochrome)), ((grayscale)) watermark, moles",
"prompt": "a dog",
"object_prompt": "1girl",
"image_file": "{{Base64 encoded image}}"
}'
Response:
{
"task_id": "d4b2b68f-fd45-41b7-a095-a563e9d3405f"
}
Use task_id
to retrieve images.
HTTP status codes in the 2xx range indicate that the request has been successfully accepted, while status codes in the 5xx range indicate internal server errors.
You can obtain the image URLs in imgs.image_url
of the response.
Request:
curl --location --request GET 'https://api.novita.ai/v3/async/task-result?task_id=d4b2b68f-fd45-41b7-a095-a563e9d3405f' \
--header 'Authorization: Bearer {{API Key}}'
Response:
{
"task": {
"task_id": "d4b2b68f-fd45-41b7-a095-a563e9d3405f",
"status": "TASK_STATUS_SUCCEED",
"reason": ""
},
"images": [
{
"image_url": "https://faas-output-image.s3.*****",
"image_url_ttl": "3600",
"image_type": "jpeg"
}
]
}