Generate images from text prompts
/v1/images/generations endpoint generates images based on a descriptive text prompt. You can control the aspect ratio, image format, size, and provide negative prompts to refine the output.
Authorization header with your Heroku Inference API key:
DIFFUSION_KEY config variable (assuming you created the model resource with an --as DIFFUSION flag).
"stable-image-ultra"
10,000 characters"A beautiful sunset over the mountains with vibrant orange and purple colors"
"1:1"
Controls the aspect ratio of the generated image.
Options: 16:9, 1:1, 21:9, 2:3, 3:2, 4:5, 5:4, 9:16, 9:21
"1024x1024"
Size, in pixels, of the output image.
Options: 1344x768, 1024x1024, 1536x640, 832x1216, 1216x832, 896x1088, 1088x896, 768x1344, 640x1536
10,000 characters"crowded, blurry, low quality"
"png"
Format of the output image.
Options: jpeg, png
0
A starting value used as a base to generate the image from. If all parameters remain the same, images generated with the same seed will be identical, while images generated with different seeds will be similar but not identical.
0 (random) to 4294967295123 for reproducible results
false
Ignore unsupported parameters in request instead of throwing an error.
Data Object
""seed value to generate consistent resultsBearer token using your INFERENCE_KEY
"stable-image-ultra"
1000016:9, 1:1, 21:9, 2:3, 3:2, 4:5, 5:4, 9:16, 9:21 jpeg, png 1344x768, 1024x1024, 1536x640, 832x1216, 1216x832, 896x1088, 1088x896, 768x1344, 640x1536 0 <= x <= 4294967295