Skip to content

Stable Diffusion

An open-weights text-to-image model based on latent diffusion. Its public release in 2022 let anyone generate images on their own computer.

Fig. / How it works
PromptPromptText encoder (CLIP)Text encoder (CLIP)Denoise a small latentDenoise a small latentDecoder: latent to imageDecoder: latent to image
Domain 06
Generative AI
Role · kind
Real systemsFamous system
Level
Intermediate

Stability AI, CompVis (LMU Munich) and Runway, 2022

You type 'a cat astronaut, oil painting', and it starts from TV static and cleans it up, step by step, into a picture of exactly that. And unlike most rivals, anyone could download it and run it at home.

Where it fits

+All relationships as a list

See it on the full map

How it works

Stable Diffusion was publicly released on 22 August 2022, developed by Stability AI together with researchers from the CompVis group at LMU Munich and Runway. It builds on the latent diffusion paper by Rombach et al.

How it makes an image:

  1. A Transformer text encoder turns your prompt into a sequence of vectors.
  2. Generation starts from random noise in a compressed latent space (for a 512×512 image, a 64×64 grid), not on full pixels.
  3. A denoising network (a U-Net with attention layers that read the text vectors) removes noise step by step, steered toward the prompt. See diffusion models.
  4. The decoder of an autoencoder (see VAE) expands the clean latent into the final image.

Working in the small latent space is what made it fast enough for ordinary graphics cards. Releasing the weights openly, unlike earlier cloud-only services, set off a wave of community tools, fine-tunes and research.

Everyday use cases

  • Case 01

    How you've probably met it

    Many image-generation apps, plug-ins and community tools are built on Stable Diffusion models because the weights are openly available.

Strengths, weaknesses and when to use it

Strengths

  • Open weights: runs locally and can be fine-tuned by anyone.
  • Latent diffusion makes it cheap enough for consumer GPUs.

Weaknesses

  • Raised concerns about training on copyrighted and personal images, and about misuse.

When to use itWhen you want an image generator you can run, inspect and customize yourself.

Go deeper