Text-to-image
Generate an image from a text prompt.
Using SDXL 1.0
Use stable-diffusion-xl-1024-v1-0 as the engine_id of your request and pass in height & width as one of the following combinations:
- 1024x1024 (default)
- 1152x896
- 896x1152
- 1216x832
- 1344x768
- 768x1344
- 1536x640
- 640x1536
SDXL 1.0 Pricing
When specifying 30 steps or fewer, generation costs 0.9 credits.
When specifying above 30 steps, generation cost is determined using the following formula:
cost = 0.9 * (steps / 30)
Authorizations
Your Stability API key, sent as a bearer token in the Authorization header.
Headers
Body
Represents the optional parameters that can be passed to any generation request.
An array of text prompts to use for generation.
Given a text prompt with the text A lighthouse on a cliff and a weight of 0.5, it would be represented as:
1Which sampler to use for the diffusion process. If this value is omitted we'll automatically select an appropriate sampler for you.
DDIM, DDPM, K_DPMPP_2M, K_DPMPP_2S_ANCESTRAL, K_DPM_2, K_DPM_2_ANCESTRAL, K_EULER, K_EULER_ANCESTRAL, K_HEUN, K_LMS "K_DPM_2_ANCESTRAL"
Pass in a style preset to guide the image model towards a particular style. This list of style presets is subject to change.
enhance, anime, photographic, digital-art, comic-book, fantasy-art, line-art, analog-film, neon-punk, isometric, low-poly, origami, modeling-compound, cinematic, 3d-model, pixel-art, tile-texture