The AI Handbook Open in the app →

Diffusion Model

Models & Architectures · Intermediate · 5 min read

What is it?

A diffusion model is an AI that generates images (or audio/video) by starting from random noise and gradually cleaning it up into a coherent result.

Explain like I'm 5

Imagine a photo buried under TV static. A diffusion model has practiced removing static so many times that it can start from pure static and 'uncover' a brand-new picture that was never there.

Why was it created?

Earlier image generators (like GANs) were powerful but unstable and hard to train. Diffusion models were developed to produce high-quality, diverse images with a more stable, controllable training process.

Where is it used?

  • Image generation (art, product mockups)
  • Photo editing and inpainting
  • Audio and video generation
  • Design and marketing tools

Why should developers care?

Diffusion models power most modern image and video generators, so anyone building creative or media features will likely use or integrate one.

How does it work?

During training the model repeatedly adds noise to real images and learns to reverse each step. To generate, it starts from random noise and applies that learned denoising many times, guided by a text prompt, until a clear image emerges.

Real-world example

You type 'a cozy cabin in the snow at sunset'; the model turns random noise into a matching image over dozens of denoising steps.

Common use cases

  • Text-to-image generation
  • Filling in or editing parts of an image
  • Upscaling and restoration
  • Generating variations of a design

Advantages

  • High-quality, diverse output
  • Stable to train compared to GANs
  • Flexible control via prompts and guidance
  • Strong open-source ecosystem

Disadvantages

  • Slow — many steps per image
  • Compute-heavy to run and train
  • Can reproduce biases from training data
  • Fine detail (hands, text) can be wrong

When should you use it?

When you need to generate or edit images, audio, or video from a description or an existing sample.

When should you avoid it?

When you need guaranteed-accurate or factual output, or ultra-low-latency generation on limited hardware.

Alternatives

GANs (generative adversarial networks)Autoregressive image modelsVariational autoencoders (VAEs)

Related terms

Neural NetworkGPUMultimodal AITraining

Interview questions

Beginner

  • What does a diffusion model generate, and from what starting point?
  • What is 'denoising' in this context?

Intermediate

  • How does training a diffusion model differ from generating with one?
  • Why are diffusion models slower than a single forward pass?

Senior

  • How does classifier-free guidance steer generation toward a prompt?
  • What trade-offs come with reducing the number of sampling steps?

Common misconceptions

  • "It stores and pastes training images" — it learns a denoising process and generates new pixels.
  • "More steps always means a better image" — returns diminish, and quality plateaus.

Fun facts

  • The idea borrows from non-equilibrium thermodynamics — modeling how noise spreads.
  • Stable Diffusion made high-quality generation runnable on consumer GPUs.

Timeline

  • 2015 — Diffusion probabilistic models proposed
  • 2020 — DDPM shows diffusion can rival GANs
  • 2022 — Text-to-image diffusion reaches the mainstream

Learning resources

Quick summary

A diffusion model generates images by learning to reverse a noising process, turning random noise into a coherent result guided by a prompt.

Cheat sheet

  • Generates by denoising random noise
  • Trained by adding then removing noise
  • Powers modern image/video generators
  • Slow but high quality

If you remember only one thing

A diffusion model paints by starting from static and repeatedly cleaning it up into the image your prompt describes.

Related tools