Diffusion Model
Learns to remove noise from images step by step. To generate, it starts from pure static and denoises it into a brand new image.
Also denoising diffusion · DDPM · latent diffusion · score-based model
Sohl-Dickstein et al., 2015; Ho et al. (DDPM), 2020
Imagine a sculptor who starts with a rough block of marble and chips away a little at a time until a statue appears. A diffusion model does that with static: it chips away noise, step by step, until a picture appears.
Where it fits
Not shown: 1 more that build on it. See the full list below.
+All relationships as a list
Is a kind of / part of
Kinds and parts
Siblings
Techniques that apply here
Try it
How it works
Destroying an image is easy: add a bit of random noise, then a bit more, and after enough steps you have pure static. That is the forward process, and it needs no learning.
A diffusion model learns to run the film backward. Training is simple:
- Take a real image and a random step number .
- Add the amount of noise that belongs to step .
- Ask the network: what noise was added? Compare with the truth and update.
After training on millions of images, the network is an expert denoiser at every noise level. To generate, start from pure random noise and repeatedly subtract the predicted noise, a little at a time. Each step makes the image slightly cleaner, and after dozens of steps a new image emerges that never existed in the training set.
Text conditioning: feed a text description into the denoiser (through attention layers), and it learns to denoise toward images that match the text. Classifier-free guidance exaggerates the difference between “denoise with the prompt” and “denoise without it”, trading variety for prompt-faithfulness.
Latent diffusion: running hundreds of steps on full-size images is expensive, so models like Stable Diffusion first compress the image with an autoencoder (see VAE) and do the diffusion in that small latent space.
The math
The forward process has a closed form, with noise schedule :
The network is trained with the simple loss
Everyday use cases
- Case 01
Text-to-image
Turn "an astronaut riding a horse" into a picture.
- Case 02
Photo editing
Fill in removed objects, extend a photo beyond its borders, change the style.
- Case 03
Video and audio
The same idea, extended through time, generates video clips and sound.
Famous examples
- 2022Stable 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.
- 2024Sora
OpenAI's text-to-video model, unveiled in February 2024, which generates video from text by denoising spacetime patches with a diffusion Transformer.
- 2024Veo
Google DeepMind's text-to-video model family, announced at Google I/O in May 2024 and offered in Google's AI products and cloud platform.
Strengths, weaknesses and when to use it
Strengths
- High-quality, diverse samples.
- Stable training compared with GANs.
- Easy to condition on text, images or sketches.
Weaknesses
- Slow sampling: many denoising steps per image (though distillation and better samplers cut this a lot).
- Expensive to train.
When to use itThe default choice for high-quality image, video and audio generation.
Compare with
Check yourself
- Q01
What does the network in a diffusion model learn to predict during training?
Show answer
B: The noise that was added to the image
- Q02
Where does generation start?
Show answer
B: From pure random noise
- Q03
What does latent diffusion change?
Show answer
A: It runs the diffusion in a compressed latent space instead of on full-size pixels