Skip to main content
POST
Inpainting
Inpainting is a conservation process in which damaged, deteriorated, or missing parts of an artwork are filled in to present a complete image.
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.

Request Headers

Content-Type
string
required
Enum: application/json
Authorization
string
required
Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

extra
object
Optional extra parameters for the request.
request
object
required

Response

task_id
string
Use the task_id to request the Task Result API to retrieve the generated outputs.

Example

I have no mask images. How do I generate mask parameters in the body?

You can use our playground to get the mask base64 information. Please be aware that mask images should have the same resolution as the input images. Guidance can be found here: Click Here

I already have mask images. How do I convert mask images to base64?

You can use the following code to convert mask images to base64.

Start requesting inpainting.

Please set the Content-Type header to application/json in your HTTP request to indicate that you are sending JSON data. Currently, only JSON format is supported. "model_name":"realisticVisionV40_v40VAE-inpainting_81543.safetensors" in body represent inpainting models, which, can be accessed in API /v3/model with sd_name like %inpainting%. Request:
Response:
Response:
Last modified on September 5, 2025