Skip to main content

Outpainting


Outpainting

Base URLs:

  • https://api.novita.ai

POST Outpainting

POST /v3/outpainting

Extending the borders of the image or giving additional variations to the edges of image.

Request header parameters

  • AuthorizationstringRequired

    In Bearer {{Key}} format.

  • Content-TypestringRequired

    Only application/json supported

    Enum: application/json

Request Body parameters

  • image_filestringRequired

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

  • promptstringRequired

    Positive prompt word, divided by `,`, Range: [1, 1024]

  • negative_promptstring

    Negtive prompt word, divided by `,`, Range: [1, 512]

  • widthintegerRequired

    The outpainting image width (px) , needs to be larger than the width of the original image, Maximum 4096px.

  • heightintegerRequired

    The outpainting image height(px) , needs to be larger than the height of the original image, Maximum 4096px.

  • center_xintegerRequired

    The offset (px) between the center of the original image and the center of the expanded image in the X-axis direction. The default is 0. The allowed value range is -(width + original images width)/2 to (width + original images width)/2.

  • center_yintegerRequired

    The offset (px) between the center of the original image and the center of the expanded image in the Y-axis direction. The default is 0. The allowed value range is -(height + original images height)/2 to (height + original images height)/2.

  • extraobject

    Extra info.

    Show properties

Responses

  • image_filestring

  • image_typestring

    Default in `png` format.

Example

Extending the borders of the image or giving additional variations to the edges of image.

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.

Try it in playgroundopen in new window.

Request:

curl --location --request POST 'https://api.novita.ai/v3/outpainting' \
--header 'Authorization: Bearer {{key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"image_file":"{{Base64 encoded image}}",
"width": 1024,
"height": 1024,
"center_x": 0,
"center_y": 0
}'

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