POST
/
v1
/
image
/
gen
/
sd
curl --request POST \
  --url https://openapi.monica.im/v1/image/gen/sd \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "sd3_5",
  "prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
  "negative_prompt": "",
  "seed": "42",
  "size": "1024x1024",
  "steps": 28,
  "cfg_scale": "3.5",
  "num_outputs": 1,
  "output_quality": 90,
  "scheduler": "K_EULER",
  "num_inference_steps": 50
}'
{
  "data": [
    {
      "url": "<string>"
    }
  ]
}
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
header
required

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

"sd3_5"

prompt
string
required

Text prompt for image generation.

Required string length: 1 - 4000
Example:

"An astronaut riding a rainbow unicorn, cinematic, dramatic"

negative_prompt
string

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

Maximum length: 4000
Example:

""

seed
integer
default:0

Random seed for reproducible generations.

Required range: x <= 4294967295
Example:

"42"

size
enum<string>
default:1024x1024

The size of the generated images.

Available options:
1024x1024,
1344x768,
768x1344
Example:

"1024x1024"

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.

Example:

28

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.

Example:

"3.5"

num_outputs
integer
default:1

Number of images to generate. Only supports sdxl.

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

1

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

90

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

"K_EULER"

num_inference_steps
integer
default:50

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

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

50

Response

200 - application/json
Success
data
object[]

An array of generated image URLs.