Skip to main content

Cleanup


Cleanup

POST https://api.novita.ai/v3/cleanup

Easily remove unwanted objects, defects, people, or text from your pictures in just seconds.

Request header parameters

  • Content-TypestringRequired

    undefined

    Enum:
    application/json
  • AuthorizationstringRequired

    Bearer authentication format, for example: Bearer {{API Key}}.

Request Body parameters

  • extraobject

    Optional extra parameters for the request.

    Show properties
  • image_filestringRequired

    The base64 of original image, with a maximum resolution of 16 megapixels and a max file size of 30 Mb.

  • mask_filestringRequired

    The base64 of mask image, with a maximum resolution of 16 megapixels and a max file size of 30 Mb.

Responses

  • image_filestring

    The Base64-encoded content of the returned image.

  • image_typestring

    The returned image type.

    Enum:
    png webp jpeg

Example

Cleanup helps easily remove unwanted objects, defects, people, or text from your pictures in just seconds.

Try it in playgroundopen in new window.

Request:

curl --location --request POST 'https://api.novita.ai/v3/cleanup' \
--header 'Authorization: Bearer {{key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"image_file":"{{Base64 encoded image}}",
"mask_file":"{{Base64 encoded image}}"
}'

Response:

{
    "image_file": "{{Base64 encoded image}}",
    "image_type": "png"
}

HTTP status codes in the 2xx range indicate that the request has been successfully accepted, code 400 means requst params error, while status codes in the 5xx range indicate internal server errors.

You can get images url in image_file of response in base64 format.

Response:

{
    "image_file": "{{Base64 encoded image}}"
    "image_type": "png"
}
novita.ai API
novita.ai API