Foundations to Frontier
Tests
H. Generative Models › H7 Diffusion Models

Video diffusion models

A video diffusion model generates all frames of a clip together, so that each frame looks right and the motion between frames is consistent. Modern systems such as Sora, Veo, Wan, HunyuanVideo and Cosmos compress the clip with a causal 3-D VAE. A diffusion transformer then denoises space-time patches with full or factorised attention, usually trained with flow matching, and long videos are made autoregressively. This page covers the architecture and cost, noise priors, conditioning (text, image, camera, actions) and the evaluation of temporal consistency. In the exercises you count latent frames, tokens and attention pairs, then compare samplers on a toy video dataset whose frames move one mode around a ring per step. Every sampler made good single frames: 98.8–99.9% landed on a mode. Yet frames from an image model with independent noise moved to an adjacent mode only 27% of the time and never formed a coherent video. Shared noise froze 100% of videos, while the joint video model was coherent in 100% of them. Autoregressive generation with one frame of context was coherent in only 0.3%, because one frame cannot tell the direction of motion; two frames of context fixed it (99.7%).

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Many pictures that must agree

A video is a stack of pictures that must agree with each other: the same drone, the same lighting, moving smoothly. If you drew each picture separately, each one could look fine but the drone would jump around. A video diffusion model removes the noise from all frames at once, so every frame knows what the others are doing. The demo shows tiny 8-frame videos where a dot should hop one step around a ring per frame.

Diffusion lab 3: video, flows and few-step sampling
Five 8-frame videos (big dot = first frame; each drawn on a slightly larger circle). Over 60 videos: 100% move coherently one mode per frame, 0% are frozen. Every method makes good single frames; only the joint model (or enough context) gets the motion right.
Why engineers care

Video world models (NVIDIA Cosmos, DeepMind Genie 3) generate camera views of robots, cars and drones acting in a scene, to train and test controllers in simulation.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A video model must get right…
  2. 2. Drawing frames separately tends to give…
  3. 3. Video diffusion denoises…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Data: a clip is a tensor of F frames × H × W × 3. At 720p and 24 fps, 5 s is 121 frames, about 3.3 × 10⁸ numbers, so everything runs in a compressed latent space.
  • Causal 3-D VAE: compresses time by 4 and space by 8 (Wan 2.1, HunyuanVideo, CogVideoX); the first frame is encoded alone, so F = 4k + 1 frames give k + 1 latent frames and an image is a one-frame video.
  • Backbone: early models inflated image U-Nets with temporal convolution and temporal attention (VDM 2022, Make-A-Video, Video LDM, Stable Video Diffusion 2023). Since Sora (2024) most use a diffusion transformer over space-time patches with full 3-D attention, trained with flow matching (rectified flow).
  • Cost: tokens = latent frames × (H/16) × (W/16). Full attention grows with the square of the token count; factorised spatial plus temporal attention costs T S² + S T² instead of (T S)².
  • Noise: independent per-frame noise is standard; correlated noise priors (PYoCo, 2023) help when fine-tuning image models into video models.
  • Conditioning: text through a language model encoder (T5, an LLM), a first frame (image-to-video), camera poses, robot actions (world models), audio (Veo 3 generates sound together with the video).
  • Long videos: sliding windows, autoregressive chunks conditioned on previous frames, Diffusion Forcing (per-frame noise levels), and causal students distilled from bidirectional teachers (CausVid, Self Forcing, 2025).
  • Evaluation: FVD, VBench (dimensions such as subject consistency, motion smoothness and dynamic degree), human preference; physics benchmarks show that plausible-looking video often breaks conservation laws.
📝 Quick check (Level 1)
0/3 answered
  1. 1. A causal video VAE turns 121 frames into…
  2. 2. Most 2024–2026 video models use…
  3. 3. Factorised attention replaces (T S)² by…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

Building and sampling a video model

Exercise 1.

  • Latent shape of a clip after a causal 3-D VAE.
  • Number of transformer tokens after patchifying.
  • Attention pairs for full and factorised attention.
  • Noise correlated across frames.

Practice.

  • Start from an open model (Wan 2.1/2.2, HunyuanVideo, CogVideoX, LTX-Video, Cosmos) through diffusers; generate at the model’s native frame count (4k + 1) and resolution.
  • Budget memory by tokens: 81 frames at 480×832 is about 33k tokens; enable VAE tiling, CPU offload or sequence parallelism for 720p.
  • Fine-tune with LoRA on short clips first, then on longer clips (curriculum over length and resolution).
  • Check temporal consistency explicitly: track an object across frames and measure identity and motion smoothness; per-frame image metrics miss flicker.
  • For long videos, generate overlapping chunks conditioned on the last frames, and watch for drift.
import torch
from diffusers import WanPipeline
from diffusers.utils import export_to_video
pipe = WanPipeline.from_pretrained("Wan-AI/Wan2.1-T2V-1.3B-Diffusers", torch_dtype=torch.bfloat16).to("cuda")
video = pipe(prompt="a quadcopter flying low over a wheat field at sunset, tracking shot",
             num_frames=81, height=480, width=832, num_inference_steps=40, guidance_scale=5.0).frames[0]
export_to_video(video, "drone.mp4", fps=16)
🐍 Exercise 1: shapes, tokens and attention cost
Compute latent shapes, token counts and attention pairs of video transformers, and sample noise correlated across frames.
📝 Quick check (Level 2)
0/3 answered
  1. 1. 81 frames at 480×832 give about…
  2. 2. Per-frame image metrics miss…
  3. 3. Long videos are usually made by…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Frames are not independent. A video distribution p(x¹, …, x^F) has the same single-frame marginals as an image model trained on the frames, but a very different joint distribution. Sampling each frame from the image model draws from the product of the marginals: every frame is plausible, and the motion is random.

Shared noise freezes the video. A deterministic sampler (DDIM or a probability-flow ODE) is a function of its noise. Giving every frame the same noise gives the same frame F times. Mixing shared and independent noise (z_f = √α z + √(1 − α) ε_f) correlates frames but still cannot encode motion; PYoCo uses such priors only as a better starting point for fine-tuning.

Context and the Markov order. An autoregressive video model samples p(x^f | x^(f−k), …, x^(f−1)). If the dynamics need more than k frames (here, direction of motion needs two positions), the conditional is a mixture over the unseen state and the model can switch mode mid-clip; real systems carry long contexts or memory for this reason.

Cost of full attention. For T latent frames of S tokens, full attention costs (T S)² pairs and factorised attention T S² + S T², a ratio of T S / (T + S); for 31 frames of 3600 tokens that is about 31×. Full attention still dominates quality, so systems pay it with FlashAttention, sequence parallelism and sparse or sliding-window attention.

Training objective. Same as images: flow matching or ε/v-prediction on the latent clip, with joint image–video training and timestep shifting toward high noise for large token counts.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Independent per-frame sampling draws from…
  2. 2. Same noise for every frame with a deterministic sampler gives…
  3. 3. One frame of context fails here because…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

Which sampling schemes produce coherent motion, and why do per-frame models fail?

History.

  • J. Ho, T. Salimans, A. Gritsenko, W. Chan, M. Norouzi and D. Fleet, “Video diffusion models” (2022).
  • A. Blattmann et al., “Align your latents: high-resolution video synthesis with latent diffusion models” (2023); “Stable Video Diffusion” (2023).
  • S. Ge et al., “Preserve your own correlation: a noise prior for video diffusion models” (PYoCo, 2023).
  • T. Brooks et al., “Video generation models as world simulators” (Sora technical report, 2024).
  • B. Chen et al., “Diffusion Forcing: next-token prediction meets full-sequence diffusion” (2024).
  • Wan Team, “Wan: open and advanced large-scale video generative models” (2025).

Exercise 2. Toy videos with an exact denoiser (no network).

  • Data: 8 frames per video; a frame is a 2-D point near one of 8 modes on a circle (std 0.15). A video starts at a random mode and moves one mode per frame, clockwise or anticlockwise, so it is a mixture of 16 Gaussians in 16 dimensions whose frame marginals are the 8-mode ring.
  • Samplers: the exact probability-flow ODE (EDM schedule, 20 Euler steps) of each model: an image model per frame with independent, shared, or mixed (α = 0.9) noise; the joint video model; autoregressive models conditioned on 1 or 2 previous frames.
  • Measures: over 300 videos, frames within 4 std of a mode, consecutive frames on adjacent modes, coherent videos (all 7 steps in the same direction), frozen videos.
sampler frames on a mode adjacent steps coherent frozen
image model, independent noise 0.991 0.27 0.0 0.0
image model, shared noise 0.993 0.0 0.0 1.0
image model, mixed noise α = 0.9 0.988 0.364 0.0 0.15
joint video model 0.999 1.0 1.0 0.0
autoregressive, 1 frame of context 0.991 0.999 0.003 0.0
autoregressive, 2 frames of context 0.998 0.999 0.997 0.0
  • Frame quality told us nothing: all six samplers put 98.8–99.9% of frames on a mode.
  • Independent frames hop to an adjacent mode about 2/8 of the time, as chance predicts, and never form a coherent clip. Shared noise freezes every clip.
  • The joint model was coherent in all 300 clips. One frame of context gives locally smooth motion that flips direction at random (theory: 1/64 = 0.016 coherent); two frames fix it.
  • Seeds 1 and 2: independent adjacent steps 0.253 and 0.25; frozen share with mixed noise 0.183 and 0.167; one-frame-context coherence 0.007 and 0.013; two-frame 0.997 both; joint 1.0 both.
  • Caveat: exact denoisers isolate the sampling structure; trained models add their own errors, and real dynamics need far longer context than two frames.
🐍 Exercise 2 (research): which sampling schemes produce coherent motion, and why do per-frame models fail?
Sample toy videos from per-frame, joint and autoregressive models with exact denoisers and measure frame quality and temporal coherence.

Video diffusion in AI, robotics and aerospace

  • World models for robots and vehicles: NVIDIA Cosmos (2025) and DeepMind Genie 3 (2025) generate action-conditioned video to train and evaluate policies; 1X and others use video world models to test humanoid policies.
  • Video policies: UniPi (2023) plans by generating a video of the task and extracting actions with an inverse-dynamics model.
  • Earth observation: diffusion models generate or interpolate satellite image time series and cloud-free sequences, and nowcast precipitation from radar sequences.

References

  1. J. Ho et al. (2022). “Video diffusion models.” NeurIPS.
  2. A. Blattmann et al. (2023). “Align your latents: high-resolution video synthesis with latent diffusion models.” CVPR.
  3. S. Ge et al. (2023). “Preserve your own correlation: a noise prior for video diffusion models.” ICCV.
  4. T. Brooks et al. (2024). “Video generation models as world simulators.” OpenAI technical report.
  5. B. Chen et al. (2024). “Diffusion Forcing: next-token prediction meets full-sequence diffusion.” NeurIPS.
  6. Wan Team (2025). “Wan: open and advanced large-scale video generative models.” arXiv.
  7. NVIDIA (2025). “Cosmos world foundation model platform for physical AI.” arXiv.