Skip to main content
POST
Stable Diffusion 3

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/*
required

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

Available options:
application/json,
image/*

Body

multipart/form-data
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.

Required string length: 1 - 10000
Example:

""

mode
enum<string>
default:text-to-image

Controls whether this is a text-to-image or image-to-image generation, which affects which parameters are required:

  • text-to-image requires only the prompt parameter
  • image-to-image requires the prompt, image, and strength parameters
Available options:
image-to-image,
text-to-image
Example:

"text-to-image"

image
file

The image to use as the starting point for the generation.

Supported formats:

  • jpeg
  • png
  • webp

Supported dimensions:

  • Every side must be at least 64 pixels

Important: This parameter is only valid for image-to-image requests.

strength
number

Sometimes referred to as denoising, this parameter controls how much influence the 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.

Important: This parameter is only valid for image-to-image requests.

Required range: 0 <= x <= 1
Example:

""

aspect_ratio
enum<string>
default:1:1

Controls the aspect ratio of the generated image. Defaults to 1:1.

Important: This parameter is only valid for text-to-image requests.

Available options:
16:9,
1:1,
21:9,
2:3,
3:2,
4:5,
5:4,
9:16,
9:21
Example:

"1:1"

model
enum<string>
default:sd3-large

The model to use for generation.

  • sd3-medium requires 3.5 credits per generation
  • sd3-large requires 6.5 credits per generation
  • sd3-large-turbo requires 4 credits per generation
Available options:
sd3-large,
sd3-large-turbo,
sd3-medium
Example:

"sd3-large"

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
Example:

""

output_format
enum<string>
default:png

Dictates the content-type of the generated image.

Available options:
jpeg,
png
Example:

"png"

negative_prompt
string

Keywords of what you do not wish to see in the output image. This is an advanced feature.

Important: This parameter does not work with sd3-large-turbo.

Maximum string length: 10000
Example:

""

Response

Request succeeded.

The response is of type file.