Stability.Ai
  1. generation
Stability.Ai
  • Getting Started
  • v1
    • user
      • account
      • balance
    • engines
      • list
    • generation
      • text-to-image
      • image-to-image
      • image-to-image/upscale
      • image-to-image/masking
  • v2alpha
    • generation
      • image-to-video
        POST
      • image-to-video/result
        GET
      • stable-image/upscale
        POST
      • stable-image/upscale/result
        GET
      • stable-image/inpaint
        POST
  1. generation

stable-image/inpaint

https://api.stability.ai
https://api.stability.ai
https://api.stability.ai
https://api.stability.ai
POST
/v2alpha/generation/stable-image/inpaint
v2alpha/generation
Inpaint an existing image, with or without a mask, using our latest-and-greatest inpainting model.

Search-and-Replace Mode#

This mode is ideal for individuals of all levels of skill in design. It can be used for straightforward
adjustments to images. The service will automatically mask the most appropriate object based on the contents
of the search_prompt, and replace it with a generated result based on the prompt.
How to use: set the mode parameter to search and provide a short description of what to
search-and-replace in the search_prompt parameter.

Mask Mode#

This mode allows for precise control of generative fill tasks on an image, down to the level of
individual pixels. Design professionals can provide a mask for the section of the image to be replaced,
and use standard image prompting to describe the full image as it should appear after the editing.
The resulting image will incorporate all of the elements described in the prompt.
How to use: set the mode parameter to mask and either pass in an image with an alpha channel
or provide an explicit mask image to the mask parameter. If both are present the mask parameter will
take precedence.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.stability.ai/v2alpha/generation/stable-image/inpaint' \
--header 'authorization;'
Response Response Example
200 - Example 1
{}

Request

Header Params
authorization
string 
required
content-type
string 
required
accept
string 
optional
Body Params multipart/form-data
object {0}

Responses

🟢200Inpainting was successful.
application/json
Body
object {0}
🟠400Something about your request is invalid, see the `errors` field for details.
🟠403Your request was flagged by our content moderation system.
🔴500An internal error occurred. If the problem persists [contact support](https://platform.stability.ai/support).
Previous
stable-image/upscale/result
Built with