Skip to content
All apps

Diffusion model — images from noise (3D)

About this app

Thousands of particles flow step by step from Gaussian noise into shapes: forward and reverse process, DDPM vs. DDIM and classifier-free guidance. An image panel shows the same in pixel space, coarse shape first and details last.

How a diffusion model works

A diffusion model generates data from pure Gaussian noise in many small steps. The forward process mixes data and noise along a fixed schedule: xₜ = √ᾱₜ·x₀ + √(1−ᾱₜ)·ε. At t = 0 you have the data, at t = T only noise. In the reverse process the model estimates the clean target x̂₀ from xₜ at every step, and with it the noise ε̂, then moves a little back towards the data. The DDPM sampler adds fresh randomness along the way, while DDIM is deterministic and needs fewer steps.

What the app shows

The scene shows a two-dimensional data space above a time axis: noise at t = T = 1000 at the back, and five shapes at t = 0 in front (“hey”, spiral, heart, star, circles). 2,000 particles run forwards or backwards, and their colour shows how certain their assignment to a shape already is. The prediction panel shows xₜ, the estimate x̂₀ and the noise share for a clicked particle. The image panel runs the same process on 30 images of 48 × 48 pixels or on your own drawing. The app uses the exact optimal denoiser rather than a trained network.

Things to try

Move time t from 1000 to 0 and notice that the rough assignment to a shape is settled early, while the exact position comes last. Compare DDPM and DDIM with 5 to 200 steps and switch between the cosine and linear noise schedules. Pick a class and raise the guidance strength w from 0 to 8: hits inside the class go up, coverage of the shape goes down. In the image panel the coarse shape appears first, the details last.

Frequently asked questions

How does a diffusion model work?
A diffusion model learns to remove noise from data step by step. During training, examples are noised along a fixed schedule and a network learns to predict that noise. To generate, you start from pure noise and apply the prediction many times until a new example emerges.
What is the difference between DDPM and DDIM?
DDPM adds a little fresh randomness in every reverse step, so each run gives a different result. DDIM uses the same noise estimate but proceeds deterministically: the same starting point leads to the same result. This lets DDIM work with far fewer steps.
What does classifier-free guidance do?
Classifier-free guidance mixes the estimate with a condition, such as a prompt or a class, and the estimate without it. A weight w above 1 amplifies the difference between the two. Results then match the condition more closely, at the cost of diversity.
Does the app use a trained network?
No. It uses the exact optimal denoiser for the reference points, a weighted average of the training examples. In the end it reproduces exactly the training data, including in the image panel. Real networks are smoother and produce new examples; the app shows the process at toy scale.

Subject: Neural networks

More from Neural networks

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps