WEBVTT

NOTE AI Engineering Visualised: https://understandingdata.com/ai-engineering-visualised/diffusion-models/

1
00:00:00.047 --> 00:00:13.370
Nobody can write down a formula for a picture of a ring, so a diffusion model learns something easier, how to take a little noise away, and then it repeats that step until pure static has become a picture.

2
00:00:13.370 --> 00:00:27.266
Training runs the other way: take a real picture and mix in noise, and at step 500 of 1,000 the standard linear schedule keeps only 28 percent of the signal, with the noise at 0.96.

3
00:00:27.266 --> 00:00:46.348
The schedule decides how fast the picture drowns, and this is the part people miss: the linear one is over 90 percent noise from step 674 on, a third of the steps spent on static, while a cosine schedule holds out until step 936.

4
00:00:46.348 --> 00:01:00.181
The network's whole job is to look at a noisy picture, the step number and the prompt, and predict the noise in it, whether it is built as a U-Net hourglass or as a stack of transformer blocks, a DiT.

5
00:01:00.181 --> 00:01:17.184
Sampling runs that prediction backwards: start from static 20.5 units from any real picture, and fifty DDIM steps, not a thousand, walk it down to 0.84, inside the spread of the real pictures.

6
00:01:17.184 --> 00:01:32.998
The prompt is a second prediction: with no prompt, 17 of 40 samples come out as rings, but ask for a ring and all 40 do, and the guidance scale pushes further still, past the prompted prediction.

7
00:01:32.998 --> 00:01:50.458
Turn that scale up and it breaks: at 7.5 the predicted picture asks for pixels up to six times brighter than white, and at 60 the samples crowd together, 18 of 40 on one ring, with two of the six variants gone.

8
00:01:50.458 --> 00:02:08.824
So real systems diffuse something smaller: an autoencoder squeezes our 256 pixels into 20 numbers that keep 99 percent of the picture, Stable Diffusion's squeezes 48 times, and a decoder inflates the result.

9
00:02:08.824 --> 00:02:26.236
So treat a diffusion model as a denoiser you call fifty times: pick a schedule that keeps the signal longer, use the fewest steps that still converge, and keep guidance moderate, because past a point it trades variety for exaggeration.
