Log inStart free
LESSON 25.07 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Conditioning and classifier-free guidance

Watch a prompt steer noise toward one image, and guidance push it further.


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

Go Pro · $8.25/mo
EXPLAINER · 25.07 · GUIDANCE BAYC (−0.50, 0.87, 1.00, 1.00)
01
Stage 1 of 6 · Text encoder
A text encoder turns the prompt into a vector c. Each word adds its own vector.
Explain it simply

Each word owns a few cells. The shape word writes into the first two cells. The row word writes into the third, and the column word into the fourth. The sum is the prompt vector. Here the word vectors are set by hand, and a real text encoder such as CLIP learns them.

Three word chips, ring, top, left, each with four cells, add up to the prompt vector c.

prompt, codesguidancenoiseguesses, sample
−3−2−1123−3−2−1123z₁z₂ring−0.500.8700top0010left0001c = sum−0.500.8711cells: shape, shape, row, collatent planetext encodermatch: p(caption | c)c = v(ring) + v(top) + v(left) = (−0.50, 0.87, 1.00, 1.00)−3−2−1123−3−2−1123z₁z₂ring−0.500.8700top0010left0001c = sum−0.500.8711cells: shape, shape, row, collatent planetext encodermatch: p(caption | c)c = v(ring) + v(top) + v(left) = (−0.50, 0.87, 1.00, 1.00)
Toy: 25.C1 images, VAE latent, hand-set words, exact denoiser (not trained)
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
c=∑w ∈ promptvw\sy{c}{data}{c} = \sum_{w\, \in\, \text{prompt}} \sy{v}{data}{v_w}
c=(−0.50,0.87,1.00,1.00)c = (-0.50, 0.87, 1.00, 1.00)

The prompt vector adds the vectors of its words.

Common mix-ups

MYTHA model conditioned on the prompt always draws the prompt.

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

Predict, then reveal
3 CHECKS · PRO
Q01For ring top left, do more or fewer seeds draw the prompt at scale 1 than at scale 3?

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 3 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.