The mathematical foundations behind Stable Diffusion, FLUX, Movie Gen, and LLaDA — rebuilt chapter by chapter as interactive lessons.
This interactive companion covers the complete pipeline — from probability paths and vector fields to classifier-free guidance, diffusion transformers, variational autoencoders, and discrete diffusion models for language. Each chapter features step-by-step derivations, working Python code, and interactive Canvas simulations.
Objects as vectors, data distributions, sampling, guided generation, the generative modeling problem.
ODEs, SDEs, probability paths, vector fields, Gaussian paths, noise schedules, simulation.
Conditional vector fields, the marginalization trick, CFM loss, simulation-free training.
Score functions, score-velocity duality, denoising score matching, Langevin dynamics, DDPM.
Vanilla guidance, classifier guidance, classifier-free guidance (CFG), guidance scale, training with label dropping.
Fourier features, patchification, DiT blocks, U-Net, VAEs, latent diffusion, Stable Diffusion 3, Movie Gen.
CTMCs, rate matrices, factorized models, discrete probability paths, discrete flow matching, MDLM.