Log inStart free
LESSON 25.06 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Latent diffusion

Watch diffusion run on 2 latent numbers instead of 64 pixels.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 25.06 · LATENT BAY12 IMAGES → 12 CODES · 64 → 2 NUMBERS
01
Stage 1 of 6 · Encode
The VAE encoder turns each image into a latent code of 2 numbers. These 12 codes are the training data.
Explain it simply

You see 12 small pictures, each with 64 pixels. The encoder from the VAE lesson squeezes each one into 2 numbers, a point on the plane. The codes spread about 1.07 from the centre, close to the noise scale, so they need no rescaling.

Twelve images move from a grid to points on a 2D plane. Each point is the image's latent code.

images and codesnoiseschedule and costguesses and output
z₁z₂−3−3−2−2−1−1112233latent space · 2 numbersencoderencode the images12 training images · 64 pixels eachz₁z₂−3−3−2−2−1−1112233latent space · 2 numbersencoderencode the images12 training images · 64 pixels each
Toy: 12 images of 8×8 pixels, 2-number codes, 10 noise steps. The denoiser is exact, not trained.
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
z0=μ(x)\sy{z0}{data}{z_0} = \mu(\sy{x}{data}{x})
z0=μ(ring top left)=(0.12,1.87)z_0 = \mu(\text{ring top left}) = (0.12, 1.87)

Each code is the mean the VAE encoder gives the image.

Common mix-ups

MYTHThe decoder runs at every denoising step.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With start noise 1, does a 5-step sample still decode to a clean shape?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.