POST
/
v1
/
image
/
gen
/
sd
Follow the quickstart guide to get your own API Key.

Stable Diffusion represents a series of open-source image generation models developed by Stability AI. See the pricing page for pricing details.

Stable Diffusion XL 1.0

  • Efficient image generation model
  • Good quality and performance
  • Suitable for general use

Stable Diffusion 3

  • Advanced model with better prompting
  • Higher image quality and details
  • Ideal for professional work

Stable Diffusion 3.5 Large

  • Latest model with best quality
  • Exceptional detail and realism
  • Superior artistic capabilities

Previews

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

The Stable Diffusion model version to use.

Available options:
sdxl,
sd3,
sd3_5
prompt
string
required

Text prompt for image generation.

Required string length: 1 - 4000
negative_prompt
string

Description of what to exclude from the image. Only supports sdxl.

Maximum length: 4000
seed
integer
default: 0

Random seed for reproducible generations.

Required range: x < 4294967295
size
enum<string>
default: 1024x1024

The size of the generated images.

Available options:
1024x1024,
1344x768,
768x1344
steps
integer
default: 28

Number of steps to run the sampler for. Supports sd3 and sd3_5. For sd3, must be between 1 and 28, default is 28. For sd3_5, must be between 1 and 50, default is 40.

cfg_scale
number
default: 3.5

The guidance scale tells the model how similar the output should be to the prompt. For sd3 and sd3_5, must be between 0 and 20. For sdxl, must be between 1 and 50. Default is 3.5 for sd3, 4.5 for sd3_5, and 7.5 for sdxl.

num_outputs
integer
default: 1

Number of images to generate. Only supports sdxl.

Required range: 1 < x < 4
output_quality
integer
default: 90

Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Supports for sd3 and sd3_5.

Required range: x < 100
scheduler
enum<string>
default: K_EULER

Which sampler to use for the diffusion process. Only supports sdxl.

Available options:
K_EULER,
DDIM,
DDPM,
K_DPMPP_2M,
K_DPMPP_2S_ANCESTRAL,
K_DPM_2,
K_DPM_2_ANCESTRAL,
K_EULER_ANCESTRAL,
K_HEUN,
K_LMS
num_inference_steps
integer
default: 50

Number of denoising steps. Between 1 and 500. Only supports sdxl.

Required range: 1 < x < 500

Response

200 - application/json
data
object[]

An array of generated image URLs.