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/upscale

https://api.stability.ai
https://api.stability.ai
https://api.stability.ai
https://api.stability.ai
POST
/v2alpha/generation/stable-image/upscale
v2alpha/generation
Takes images between 64x64 and 1 megapixel and upscales them all the way to 4K resolution. Put more
generally, it can upscale images ~20-40x times while preserving, and often enhancing, quality.

How to use#

Invoke this endpoint with the required parameters to start a generation
Use that id in the response to poll for results at the upscale/result/{id} endpoint
Rate-limiting or other errors may occur if you poll more than once every 10 seconds
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.stability.ai/v2alpha/generation/stable-image/upscale' \
--header 'authorization;' \
--form 'image=@"./some/image.png"' \
--form 'prompt=""'
Response Response Example
200 - Example 1
{
    "id": "a6dc6c6e20acda010fe14d71f180658f2896ed9b4ec25aa99a6ff06c796987c4"
}

Request

Header Params
authorization
string 
required
content-type
string 
required
Body Params multipart/form-data
image
file 
required
The image you wish to upscale.
Supported Formats:
jpeg
png
webp
Supported Sizes:
Minimum: 4,096 pixels (e.g. 64x64)
Maximum: 1,048,576 pixels (e.g. 1024x1024)
Example:
./some/image.png
prompt
string 
required
A blurb of text describing what you wish to see in the output image.
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.
negative_prompt
string 
optional
A blurb of text describing what you do not wish to see in the output image.
This is an advanced feature.
output_format
string 
optional
Dictates the format of the output image. This does not affect the content-type of this endpoint's response, but
rather the content-type of the response from the /result/{id} endpoint.
Example:
png
seed
number 
optional
A specific value that is used to guide the 'randomness' of the generation. (Omit this parameter or pass 0 to use a random seed.)
creativity
number 
optional
Indicates how creative the model should be when upscaling an image.
Higher values will result in more details being added to the image during upscaling.
Example:
0.3

Responses

🟢200Upscaling was successful!
application/json
Body
id
string 
required
The id of a generation, typically used for async generations, that can be used to check the status of the generation or retrieve the result.
>= 64 characters<= 64 characters
Example:
a6dc6c6e20acda010fe14d71f180658f2896ed9b4ec25aa99a6ff06c796987c4
🟠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
image-to-video/result
Next
stable-image/upscale/result
Built with