skip to content

Search

← From Frames to Worlds

Part II — Diffusion Learns to Move (2022–2023)

Video-to-Video and Editing

Structure-preserving synthesis — Runway's Gen-1 becomes a product before the model race begins.

2023 16 min read 3 papers

It is December 2022. Text-to-video diffusion models can already generate a short clip from a caption, but nobody has yet shown a general way to take a video that already exists — a phone recording, a stock clip, a rendered animation — and change it: swap the subject, restyle the footage, or apply an edit described in words while keeping the motion intact. Over the following four months, three papers close that gap by three different routes, and one of them, Runway’s Gen-1, ships as a commercial product before most of the field has even finished reading the preprint.

Where We Were

By late 2022, text-to-video generation had a real toolkit, but it was a generation toolkit, not an editing one. Video Diffusion Models (April 2022), Make-A-Video (September 2022), and Imagen Video (October 2022) — covered in Chapter 5 — had shown that a diffusion model could turn a caption into a short clip by extending image diffusion with factorized spatio-temporal attention and joint image-video training. CogVideo and Phenaki, covered in Chapter 4, took the autoregressive route to the same goal, tokenizing frames and predicting them one after another. What none of these systems accepted as input was a video. They ran forward from a text prompt and noise, once, to a finished clip; there was no slot in the pipeline for “and here is the footage I already have.”

Image diffusion, one book over, had a head start. SDEdit (August 2021) and Prompt-to-Prompt (August 2022) — covered in Chapter 17 of the image-generation book — had already shown two ways to edit a real image with a pretrained diffusion model: partially renoise it and let the reverse process finish the job, or intervene on the model’s own cross-attention maps to hold a layout in place while a prompt changes. Both tricks depend on DDIM’s proof, covered in Chapter 9 of the image-generation book, that the reverse diffusion process can be run deterministically and, therefore, inverted. Applying either trick to video was not a matter of copy-paste: a video is not one image but dozens of them, and any per-frame edit that is not forced to agree with its neighbors flickers instead of moving.

By December 2022, video models could generate but not edit Every system this year runs forward once from a prompt to a finished clip. None has a slot for footage that already exists. Grey monospace text is what each system actually accepted as input. 2022-04 Video Diffusion Models Generates clips from text, not from video prompt in, clip out no editing pathway 2022-08 Prompt-to-Prompt Edits images via cross attention maps image editing solved no video story yet 2022-09 Make-A-Video, Imagen Scale text-to-video generation quality still one pass, text only no input video accepted 2022-10 CogVideo, Phenaki Tokenize and generate autoregressively discrete tokens, no real footage as input 2022-12 The gap No general way to edit or restyle existing footage three papers answer this within the next four months generation only, no video input editing solved, but for images the open problem this chapter closes Every 2022 system ran forward once from a prompt to a finished clip; none had a slot for footage that already existed.
Every 2022 system ran forward from a prompt to a finished clip once. None of them had a slot for footage that already existed. PNG ↓

The missing piece was a way to keep a video’s motion and layout fixed while changing everything else about how it looks — without collecting a paired before-and-after video dataset, which barely existed at any scale, and without generating from scratch and hoping the result happened to match the input’s motion. Three groups, working independently, reached three different answers within a single winter.

The Breakthrough

Tune-A-Video (Wu et al., 2022), submitted to arXiv on December 22, 2022, took the narrowest and cheapest route: treat a single input video as its own training set. The method starts from a pretrained text-to-image latent diffusion model — the kind Chapter 13 of the image-generation book covers in full — and briefly fine-tunes it on one video and its caption, updating only a small slice of the network’s weights: the query projections inside the model’s existing cross-attention layers, plus a new temporal self-attention module, plus the query projection of a modified spatial self-attention module that now also looks at other frames. Everything else in the pretrained model — the layers that know how to draw a face, a car, or a snowy street — is left untouched. Once fine-tuned, the model has learned this one video’s motion well enough that swapping the caption’s subject (“a man is skiing” to “a panda is skiing”) and re-running generation, seeded from the original video’s own DDIM-inverted latent, produces a new video with the same motion and a different subject.

Tune-A-Video treats one video as its own training set A ten minute fine-tune on a single clip is enough to keep its motion while swapping everything else. Grey monospace text is the paper's own timing for each step. One video, one caption the only training data "a man is skiing" Briefly fine-tune query and temporal attention weights only 10 minutes, one A100 DDIM invert the video to a starting latent deterministic reverse process Swap the caption keep the inverted latent's motion "a panda is skiing" input, held fixed throughout a step in the one-video pipeline About one minute of sampling produces the edited video: same motion, new subject or style.
Ten minutes of fine-tuning on one video is enough to turn a general-purpose image model into a bespoke, one-video editor. PNG ↓

The mechanism that lets a model fine-tuned on a single video still generate frames that agree with each other is what the paper calls sparse-causal attention: each frame’s self-attention no longer looks only at itself, but also at the first frame and the immediately preceding frame, so a change introduced anywhere propagates forward through the sequence instead of being decided independently, frame by frame. Ten minutes of fine-tuning on one NVIDIA A100 GPU, and about a minute of sampling on the same card, is enough to turn a general-purpose image model into a bespoke, one-video video editor.

Gen-1 (Esser et al., 2023), submitted on February 6, 2023 by Runway, rejected the per-video fine-tuning approach entirely in favor of training one model, once, that generalizes to any input video at inference time. Gen-1 factors the editing problem into two separate conditioning signals. Structure — the coarse shape and layout of each frame, extracted as a monocular depth map — is concatenated to the noisy latent at every denoising step, telling the model where things are without telling it what they look like. Content — what the output should actually look like, supplied either as a driving image or as text — is injected through the model’s cross-attention layers as a CLIP embedding, the same joint image-text representation Chapter 11 of the image-generation book develops in full. Splitting “where” from “what” means a user can hand Gen-1 a video of someone dancing, describe the desired look in a sentence or a reference image, and get back a video with the original dancer’s motion and a new appearance.

Gen-1 splits where things are from what they look like One trained model takes structure and content as separate, independently swappable signals. Grey monospace text names each signal's concrete form. Input video frame the footage to edit any video, no fine-tune Monocular depth map structure signal, where concatenated to noisy latent CLIP embedding content signal, what driving image or text Video diffusion U-Net with temporal layers structure concat, content cross-attn Edited frame original structure, new content 240M images, 6.4M clips trained data, in or out structure, concatenated content, cross-attended the one model that takes both A user can hand Gen-1 a dancer's video and a new look, keeping the motion and changing the appearance.
Splitting where from what means one trained model handles any input video, not just the one it was tuned on. PNG ↓

Gen-1 is built the way Chapter 6 describes in general for later models: start from a pretrained image latent-diffusion model and add temporal convolution and attention layers so the network can reason across frames, not only within one. Gen-1’s specific contribution sits on top of that shared pattern — the depth-plus-CLIP conditioning split — and it was trained jointly on 240 million images and 6.4 million video clips, mixing image and video batches so the model retains the visual breadth of an image model while learning temporal behavior from video. Runway shipped Gen-1 as a feature inside its product within weeks of the preprint, turning a video-editing paper into a subscription feature before most competing labs had a comparable demo.

Text2Video-Zero (Khachatryan et al., 2023), submitted on March 23, 2023, went the opposite direction from Gen-1: instead of training anything at all, it repurposed a frozen, off-the-shelf Stable Diffusion checkpoint and produced temporally consistent video purely through how sampling is orchestrated. Two changes, applied at inference time only, do the work. First, the self-attention inside the pretrained U-Net is replaced with cross-frame attention: every frame’s queries are matched against the keys and values of a single fixed frame — the first frame — rather than its own, so every frame keeps rendering the same object identity and background instead of each one independently reimagining it. Second, before any denoising happens, the initial noise latents for frames after the first are not sampled independently; they are produced by warping the first frame’s own partially-denoised latent along a chosen motion direction, then re-noising, so the frames start from correlated points instead of unrelated random noise.

Text2Video-Zero trains nothing at all Consistency comes purely from how a frozen checkpoint's sampling is orchestrated. Grey monospace text names the mechanism doing the work. Frozen Stable Diffusion no weights changed, no training run off the shelf checkpoint Cross-frame attention every frame attends to frame one shared visual identity Warp frame one's latent along a motion direction for later frames correlated, not random noise Independent per-frame denoising consistent appearance Temporally consistent video zero training the checkpoint and its output an inference-time trick, no training Because neither trick touches a weight, it composes with ControlNet or InstructPix2Pix directly.
Neither trick touches a single model weight. Consistency comes entirely from how sampling is orchestrated. PNG ↓

Because neither trick touches a single model weight, Text2Video-Zero’s authors also showed it composing directly with existing conditioning tools: feeding it ControlNet-style pose or edge maps for conditional generation, or combining it with InstructPix2Pix — covered alongside Prompt-to-Prompt in Chapter 17 of the image-generation book — to perform instruction-guided video editing, again with no video-specific training anywhere in the pipeline.

The Mathematics

Tune-A-Video’s central mechanism is sparse-causal attention. For frame viv_i, the query still comes from that frame alone, but the keys and values are drawn from the first frame and the immediately preceding frame:

Q=WQzvi,K=WK[zv1; zvi−1],V=WV[zv1; zvi−1]Q = W^{Q} z_{v_i}, \qquad K = W^{K}\big[z_{v_1};\, z_{v_{i-1}}\big], \qquad V = W^{V}\big[z_{v_1};\, z_{v_{i-1}}\big] ST-Attn(Q,K,V)=Softmax ⁣(QK⊤d)V\mathrm{ST\text{-}Attn}(Q,K,V) = \mathrm{Softmax}\!\left(\frac{QK^{\top}}{\sqrt{d}}\right)V
SymbolMeaning
zviz_{v_i}features of the current frame ii
zv1z_{v_1}features of the first frame
zvi−1z_{v_{i-1}}features of the previous frame
WQ,WK,WVW^{Q}, W^{K}, W^{V}shared query, key, value projection matrices
Q,K,VQ, K, Vthe resulting query, key, and value tensors
ddthe attention head dimension

Only a subset of Tune-A-Video’s weights — the query projections in this attention, plus a comparable set in the model’s cross-attention layers — are updated when the network is briefly fine-tuned on the single input video; the diffusion training loss itself is the same denoising objective Chapter 8 of the image-generation book derives, and generation afterward reuses the DDIM inversion and sampling Chapter 9 of the image-generation book covers, applied here to a video’s frames rather than a single image.

Gen-1 conditions its denoiser on two additional signals beyond the usual noisy latent and timestep: a structure representation s(x)s(x), derived from per-frame depth, and a content representation c(x)c(x), a CLIP embedding of a driving image or text. Its training objective extends the DDPM posterior-mean loss with these two extra arguments:

L=E[λt∥μt(E(x)t,E(x)0)−μθ(E(x)t,t,s(x),c(x))∥22]\mathcal{L} = \mathbb{E}\Big[\lambda_t \big\lVert \mu_t\big(\mathcal{E}(x)_t, \mathcal{E}(x)_0\big) - \mu_\theta\big(\mathcal{E}(x)_t, t, s(x), c(x)\big) \big\rVert_2^2\Big]
SymbolMeaning
μt\mu_ttrue forward-process posterior mean at step tt
μθ\mu_\thetathe network’s predicted posterior mean
E(x)t,E(x)0\mathcal{E}(x)_t, \mathcal{E}(x)_0noisy and clean latent encodings of the video
s(x)s(x)structure conditioning, a per-frame depth map
c(x)c(x)content conditioning, a CLIP embedding
λt\lambda_tthe per-timestep loss weight

At inference, Gen-1 extends classifier-free guidance — the single-signal mechanism Chapter 10 of the image-generation book covers in full — to three terms instead of one:

μ~θ(zt,t,c,s)=μθimg(zt,t,∅,s)+ωt(μθ(zt,t,∅,s)−μθimg(zt,t,∅,s))+ω(μθ(zt,t,c,s)−μθ(zt,t,∅,s))\tilde\mu_\theta(z_t,t,c,s) = \mu_\theta^{\mathrm{img}}(z_t,t,\varnothing,s) + \omega_t\big(\mu_\theta(z_t,t,\varnothing,s) - \mu_\theta^{\mathrm{img}}(z_t,t,\varnothing,s)\big) + \omega\big(\mu_\theta(z_t,t,c,s) - \mu_\theta(z_t,t,\varnothing,s)\big)
SymbolMeaning
μ~θ\tilde\mu_\thetathe final, guided prediction used for sampling
μθimg\mu_\theta^{\mathrm{img}}the model’s image-only-pathway prediction
μθ\mu_\thetathe full video model’s prediction
ztz_tthe noisy latent at step tt
ccthe content conditioning signal
ssthe structure conditioning signal
ωt\omega_tthe temporal-consistency guidance scale
ω\omegathe content guidance scale
∅\varnothingthe null conditioning signal

Text2Video-Zero’s cross-frame attention replaces ordinary self-attention with a rule that always looks at the first frame:

Cross-Frame-Attn(Qk,K1:m,V1:m)=Softmax ⁣(Qk(K1)⊤c)V1,k=1,…,m\mathrm{Cross\text{-}Frame\text{-}Attn}\big(Q^{k}, K^{1:m}, V^{1:m}\big) = \mathrm{Softmax}\!\left(\frac{Q^{k}(K^{1})^{\top}}{\sqrt{c}}\right)V^{1}, \qquad k = 1,\dots,m
SymbolMeaning
QkQ^{k}frame kk‘s own query
K1,V1K^{1}, V^{1}frame one’s key and value
mmthe total number of frames
ccthe attention feature dimension

Cross-frame attention alone only fixes appearance; motion still needs a push, which Text2Video-Zero supplies before denoising even begins:

xT1∼N(0,I)δk=λ (k−1) δx~T′k=Wk(xT′1)xTk←DDPM-Forward(x~T′k,Δt)\begin{aligned} x^{1}_{T} &\sim \mathcal{N}(0,\mathbf{I}) \\ \delta^{k} &= \lambda\,(k-1)\,\delta \\ \tilde{x}^{k}_{T'} &= W_k\big(x^{1}_{T'}\big) \\ x^{k}_{T} &\leftarrow \mathrm{DDPM\text{-}Forward}\big(\tilde{x}^{k}_{T'}, \Delta t\big) \end{aligned}
SymbolMeaning
xT1x^{1}_{T}frame one’s initial Gaussian noise
xT′1x^{1}_{T'}frame one’s latent after Δt\Delta t backward steps
δ\deltathe base motion-direction vector
λ\lambdathe motion-magnitude scale
δk\delta^{k}frame kk‘s scaled displacement
WkW_kthe warping operator applying δk\delta^{k}
Δt\Delta tthe number of forward/backward diffusion steps
xTkx^{k}_{T}frame kk‘s resulting initial noise

What It Enabled

The three methods trade training cost, generality, and edit fidelity against each other in ways that were never fully resolved by 2023 — later chapters show the industry continuing to pick different points on this same trade-off:

Tune-A-Video, Dec 2022Gen-1, Feb 2023Text2Video-Zero, Mar 2023
Training requiredone short fine-tune, per input videoone large training run, reused for any videonone — frozen pretrained checkpoint
Editing signaledited captiondriving image or text (content), plus structuretext prompt, optionally with ControlNet-style conditioning
Generalizes without retrainingno, needs 10 minutes per new videoyesyes
Shipped as a productresearch code onlyRunway Gen-1, within weeks of the preprintresearch code only

A second table places the numbers each paper reported against CogVideo — covered in Chapter 4 — as a common autoregressive baseline, though each pair was measured on its own set of prompts, not a shared benchmark, so the two CogVideo rows below are not the same run:

MetricCogVideoTune-A-Video
Frame consistency, CLIP embedding similarity90.6492.40
Text-video CLIP score23.9127.58
Human preference, frame consistency12.14%87.86%
Human preference, textual alignment15.00%85.00%
MetricCogVideoText2Video-Zero
Text-video CLIP score, 25 sampled prompts29.6331.19

Gen-1’s own human study, run against per-frame image-editing baselines rather than CogVideo, found it preferred over SDEdit (at 50% noising strength) 85.29% of the time and over Text2LIVE 88.24% of the time — evidence that editing video directly, rather than editing each frame independently and hoping the results agreed, was already the stronger approach by early 2023.

None of the three methods solved every problem the category would eventually need solved. Tune-A-Video’s per-video fine-tuning does not scale to a product serving many users’ videos at once. Gen-1’s depth-based structure signal ties the edit to the input video’s exact geometry, which is a poor fit for changes that should alter motion itself rather than just appearance — the subject Chapter 8 takes up directly, with explicit camera-trajectory and drag-based motion conditioning. Text2Video-Zero’s warped-latent motion is a single global direction, not per-object or camera-aware motion, and its cross-frame attention alone starts to lose consistency over longer clips — a limitation Chapter 12 addresses for video generation broadly. Gen-1’s product path, meanwhile, continued directly into Runway’s later Gen-2 and Gen-3 models, covered in Chapter 10, as video editing and video generation increasingly ran through the same commercial pipelines rather than separate research tracks.

Key Papers

PaperAuthorsYearLinkWhy it matters
Tune-A-Video: One-Shot Tuning of Image Diffusion Models for Text-to-Video GenerationWu et al.2022arXiv:2212.11565Shows a pretrained image diffusion model can be turned into a single-video editor with ten minutes of fine-tuning and a sparse-causal attention trick
Structure and Content-Guided Video Synthesis with Diffusion ModelsEsser et al.2023arXiv:2302.03011Separates structure (depth) from content (CLIP) conditioning in a single trained model; shipped as Runway Gen-1 within weeks
Text2Video-Zero: Text-to-Image Diffusion Models are Zero-Shot Video GeneratorsKhachatryan et al.2023arXiv:2303.13439Produces temporally consistent video from a frozen Stable Diffusion checkpoint via cross-frame attention and latent warping, with no training at all

PM Lens

Papers referenced