Skip to main content
POST

Authorizations

authorization
string
header
required

Use your Stability API key to authentication requests to this App.

Headers

authorization
string
required

Your Stability API key, used to authenticate your requests. Although you may have multiple keys in your account, you should use the same key for all requests to this API.

Minimum string length: 1
content-type
string
required

The content type of the request body. Do not manually specify this header; your HTTP client library will automatically include the appropriate boundary parameter.

Minimum string length: 1
Example:

"multipart/form-data"

accept
enum<string>
default:image/*

Specify image/* to get the image bytes directly. Otherwise specify application/json to receive the image as base64 encoded JSON.

Available options:
image/*,
application/json

Body

multipart/form-data
mode
enum<string>
required

Controls how the model decides which areas to inpaint and which areas to leave alone.

Specifying mask requires:

  • Provide an explicit mask image in the mask parameter
  • Use the alpha channel of the image parameter as the mask

Specifying search requires:

  • Provide a small description of what to inpaint in the search_prompt parameter
Available options:
search
search_prompt
string
required

Short description of what to inpaint in the image.

Example:

"glasses"

image
file
required

The image you wish to inpaint.

Supported Formats:

  • jpeg
  • png
  • webp

Validation Rules:

  • Every side must be at least 64 pixels
  • Total pixel count must be between 4,096 and 9,437,184 pixels
prompt
string
required

What you wish to see in the output image. A strong, descriptive prompt that clearly defines elements, colors, and subjects will lead to better results.

To control the weight of a given word use the format (word:weight), where word is the word you'd like to control the weight of and weight is a value between 0 and 1. For example: The sky was a crisp (blue:0.3) and (green:0.8) would convey a sky that was blue and green, but more green than blue.

Required string length: 1 - 10000
negative_prompt
string

A blurb of text describing what you do not wish to see in the output image. This is an advanced feature.

Maximum string length: 10000
seed
number
default:0

A specific value that is used to guide the 'randomness' of the generation. (Omit this parameter or pass 0 to use a random seed.)

Required range: 0 <= x <= 4294967294
output_format
enum<string>
default:png

Dictates the content-type of the generated image.

Available options:
jpeg,
png,
webp

Response

Inpainting was successful.

The bytes of the generated image.

The finish-reason and seed will be present as headers.