Skip to content
BIASED

Latent diffusion

Block 1 of 8~2 min

The bill for pixels

The topic Continuous-time diffusion and flow matching finished the theory of diffusion: noise prediction, scores, the SDE and the probability-flow ODE describe one model, and good solvers cut sampling from 1000 steps to tens. It ended with the bill: every one of those steps is still a full pass of a large network over the whole image.

Here is that bill in full. One 512×512512 \times 512 colour image has

D=512⋅512⋅3=786,432D = 512 \cdot 512 \cdot 3 = 786{,}432

numbers, and a pixel-space sampler pushes all of them through εθ\varepsilon_\theta at each of the TT steps, with T=1000T = 1000 in the original DDPM. Training is no cheaper, since every gradient step denoises full-resolution images. Rombach et al. (2022) quote 150–1000 V100-days to train the strongest pixel-space models, and about five days on one A100 to draw 50,000 samples.

Attention makes it worse. A self-attention layer compares every position with every other one, so its cost grows with the square of the number of positions, and a 512×512512 \times 512 image has 262,144262{,}144 of them. That is why pixel-space U-Nets attend only at coarse resolutions.

Now suppose an encoder could turn the image into a 64×6464 \times 64 grid with 4 channels per cell, and a decoder could turn the grid back into the image with no visible loss. Diffusion in that grid would touch far fewer numbers at every step. This topic builds that encoder and runs the whole DDPM machinery inside it.

Answers are saved on the server and tied to this browser until you sign in.