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 receive the bytes of the image directly. Otherwise specify application/json to receive the image as base64 encoded JSON.

Available options:
image/*,
application/json
stability-client-id
string

The name of your application, used to help us communicate app-specific debugging or moderation issues to you.

Maximum string length: 256
Example:

"my-awesome-app"

stability-client-user-id
string

A unique identifier for your end user. Used to help us communicate user-specific debugging or moderation issues to you. Feel free to obfuscate this value to protect user privacy.

Maximum string length: 256
Example:

"DiscordUser#9999"

stability-client-version
string

The version of your application, used to help us communicate version-specific debugging or moderation issues to you.

Maximum string length: 256
Example:

"1.2.1"

Body

multipart/form-data
init_image
file
required

An image containing the subject you wish to restyle.

Supported Formats:

  • jpeg
  • png
  • webp

Validation Rules:

  • Width must be between 64 and 16,383 pixels
  • Height must be between 64 and 16,383 pixels
  • Total pixel count must be between 4,096 and 9,437,184 pixels
  • The aspect ratio must be between 1:2.5 and 2.5:1
style_image
file
required

An image containing the new style.

Supported Formats:

  • jpeg
  • png
  • webp

Validation Rules:

  • Width must be between 64 and 16,383 pixels
  • Height must be between 64 and 16,383 pixels
  • Total pixel count must be between 4,096 and 9,437,184 pixels
prompt
string

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.

Maximum string length: 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
style_strength
number
default:1

Sometimes referred to as denoising, this parameter controls how much influence the style_image parameter has on the generated image. A value of 0 would yield an image that is identical to the input. A value of 1 would be as if you passed in no image at all.

Required range: 0 <= x <= 1
composition_fidelity
number
default:0.9

How closely the output image's style resembles the input image's style.

Required range: 0 <= x <= 1
change_strength
number
default:0.9

How much the original image should change

Required range: 0.1 <= x <= 1
output_format
enum<string>
default:png

Dictates the content-type of the generated image.

Available options:
png,
jpeg,
webp

Response

Generation was successful.

The bytes of the generated image.

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