Stability AI

Interact with the Stability AI API to generate, upscale, and edit images.

Generate Image

AI-generated

Summary

Generate an image from a text prompt by calling Stability AI's image generation API with customizable model, aspect ratio, seed, output format, and style preset options.

Inputs

  • Model — Select the image generation model to use, such as 'Stable Image Ultra' or 'Stable Diffusion 3.5 Large'.
  • Prompt (required) — Provide the text prompt from which the image will be generated.
  • Negative Prompt — Supply a text prompt to steer image generation away from certain features.
  • Aspect Ratio — Choose the desired aspect ratio of the generated image.
  • Seed — Set a numerical seed for reproducible image generation; use 0 to randomize.
  • Output Format — Specify the image file format (PNG, JPEG, or WEBP) for the output.
  • Style Preset — Apply a style preset (e.g., 'Photographic', 'Anime') to the image, available only when using the 'Stable Image Core' model.

Output shape

a list of items each containing a binary image file

Each output item includes the generated image as a binary property named 'data' with the appropriate file name and MIME type matching the selected output format.

Links

Discussion