Managed Inference and Agents API with Stable Image Ultra
Last updated May 13, 2025
Table of Contents
Stability AI’s Stable Image Ultra is a state-of-the-art image generation model designed to create high-quality, detailed images from text prompts. It offers improved resolution, finer details, and greater consistency compared to earlier versions.
- Model ID:
stable-image-ultra
- Region:
us
When to Use This Model
Stable Image Ultra is ideal for generating photorealistic images, concept art, and visual content based on text descriptions. It can be particularly useful for generating images for content like blog posts and marketing campaigns. Image generation models (including this one) are less well-suited for creating images with very specific properties. For example, current models struggle to generate images with very specific or consistent colors, numbers of objects, characters, layouts, or compositions.
Usage
Stable Image Ultra follows our Stability v1/images/generations API schema.
To provision access to the model, attach stable-image-ultra
to your app $APP_NAME
:
heroku ai:models:create -a $APP_NAME stable-image-ultra --as DIFFUSION
Using config variables, you can invoke stable-image-ultra
in multiple ways:
- Heroku CLI
ai
plugin (heroku ai:models:call
) - curl
- Python
- Ruby
- Javascript
Example curl Request
Get started quickly with an example request:
export DIFFUSION_MODEL_ID=$(heroku config:get -a $APP_NAME DIFFUSION_MODEL_ID)
export DIFFUSION_KEY=$(heroku config:get -a $APP_NAME DIFFUSION_KEY)
export DIFFUSION_URL=$(heroku config:get -a $APP_NAME DIFFUSION_URL)
curl $DIFFUSION_URL/v1/images/generations \
-H "Authorization: Bearer $DIFFUSION_KEY" \
-d @- <<EOF | jq -r '.data[0].b64_json' | base64 --decode > "x.png"
{
"model": "$DIFFUSION_MODEL_ID",
"prompt": "A surreal landscape with glowing mushrooms under a night sky.",
"aspect_ratio": "16:9",
"output_format": "png",
"seed": 12345,
"negative_prompt": "crowded, noisy, chaotic"
}
EOF
open x.png