Inpainting
POST https://api.newportai.com/api/async/inpainting
Inpainting is a feature used to restore artworks by filling in damaged, deteriorated, or missing areas, ensuring the restored sections blend seamlessly with the original.
- Use Inpainting API to get taskId with POST method.
- Use Polling API to get Inpainting result with POST method.
Request Header Parameters
- Content-TypestringRequiredEnumapplication/json
- AuthorizationstringRequiredBearer authentication format, for example: Bearer
Request Body Parameters
- urlstringRequiredurl of the original image, with a maximum resolution of 16 megawpixels and a max file size of 10MB.
- maskstringRequiredurl of the mask image, with a maximum resolution of 16 megawpixels and a max file size of 10MB.
- promptstringRequiredText input that will not guide the image generation, divided by `,`, Range[1, 1024].
Response
- codeinteger0 success, or error code.
- messagestring"success", or error msg.
- dataobjecttaskIdstringUse the taskId to request the Polling API to retrieve the generated outputs.
Example
Request:
zsh
curl -X POST 'https://api.newportai.com/api/async/inpainting' \
-H "Authorization: Bearer {{key}}" \
-H 'Content-Type: application/json' \
--data '{
"url": "https://newportai-api-market.s3.amazonaws.com/demo_painting/inpaintingdemo.jpg",
"mask": "https://newportai-api-market.s3.amazonaws.com/demo_painting/inpaintingmaskdemo.jpg",
"prompt": "red tie"
}'
Response:
json
{
"code": 0,
"message": "",
"data": {
"taskId": "b08337dc08d7428daa64b3d5e61b8350"
}
}
Next Step:
Use Polling API to get the result.
Demo