Home / Blog / Mirage

· MadHacks 2026

Steering a live video diffusion model by voice

Video diffusion models can now make convincing clips, but they make them slowly. Wan 2.1's 1.3 billion parameter model takes about four minutes on an RTX 4090 to render one five-second clip at 480p, according to its own README. If you want the same scene in winter, you change the prompt and wait another four minutes.

A newer family of models generates video as a stream instead. Causal Forcing++ turns the same Wan 2.1 model into one that produces a quarter second of video at a time, 16 frames per second, for as long as you let it run. That raised the question we spent MadHacks 2026 on: if the video never stops, can you change what it shows while it plays, just by saying so?

Mirage is our answer. You say "make it winter," and the first winter frame appears 363 ms after you stop talking. We built it in a weekend as a team of four, on top of the published Training-Free Interactive World Models project. This post covers why a live model resists being steered, the two changes that made it work, and what we learned building it with AI coding agents.

Four frames from one live Mirage run: a red sports car on a country road, then after spoken commands the same car on a snowy mountain road, in a neon city at night, and on a beach road
Four frames from one live run, each taken after a spoken command.

How a streaming diffusion model makes video

A diffusion model learns to undo noise. In training, a clean video latent x0 is mixed with Gaussian noise ε, and the mix is controlled by a time t between 0 and 1. Wan 2.1 uses the flow-matching form of this:

xt = (1 − t) · x0 + t · ε,    ε ~ 𝒩(0, I)(1)

At t = 1 there is only noise. The model learns to predict, from any xt, the direction back toward x0. To generate, you start from pure noise and step from t = 1 toward 0. Standard Wan 2.1 takes 50 of these steps per clip, and each one is a full pass of the network over the whole clip. That is where the four minutes go.

A streaming model distills those 50 steps down to a few and generates one small chunk at a time. Each chunk is one latent frame, which decodes to four video frames, or 0.25 seconds. The model conditions each chunk on two things: the prompt embedding c and a memory C of what it has already drawn.

xn = Gθ(εn, c, Cn),    Cn+1 = last21(Cn ⊕ KV(xn))(2)

The memory is the attention keys and values of the last 21 latent frames, about five seconds of video, kept in every one of the model's 30 layers. Each finished chunk is written back into it, so the model always continues its own most recent past. This is what makes the stream smooth. It is also what makes it hard to steer.

fresh noise εₙε ~ N(0, I) prompt cumT5 embedding memory CₙKV, last 21 frames denoiser Gθ Wan 2.1, 1.3B params 30 transformer layers Causal Forcing++ 2 steps per chunk latent xₙ1 frame TAEHVdecoder21 ms → 4 frames, 0.25 s write KV(xₙ), keep the newest 21
One step of a streaming video diffusion model. Each step draws a quarter second of video and writes it back into the model's memory.

Why a live model resists being steered

Changing the prompt of a running stream should be enough to change the video. In practice it was not, for three reasons.

The memory outweighs the prompt. At our working size of 672×384, one latent frame is about a thousand tokens, so the memory holds roughly 21,000 tokens of the old scene in every layer, and the new prompt has to compete with all of it. When we changed only the prompt from day to night, the picture dimmed after four seconds and reached night after fourteen. Every chunk drawn in between was written back as more evidence for the old scene.

There is a hard time budget. Each call produces 0.25 seconds of video, so it has 250 ms or the stream stalls. A normal call fits: two denoising passes and a memory write take about 200 ms, and decoding takes 21 ms more. Any fix that adds work has very little room.

Quality drifts. The model was trained to continue real video, but at run time it continues its own output. Small errors become its next input and compound. Left alone, the colours drain after 20 to 50 seconds.

The obvious fixes interact. Clearing the memory solves the first problem but costs time, and restarting the picture to fix drift caused a visible jump.

Principles for steering a live model

A command should replace the past, not argue with it. If the memory is what holds the old scene in place, the reliable fix is to remove it at the moment of a command, rather than to push harder on the prompt.

Every chunk must fit in 250 ms. A stall is more noticeable than a slow change. Any work that does not have to happen before the next frame is moved off the critical path.

No change should look like a cut. A video that jumps feels broken even when the content is right, so every discontinuity we introduce is blended over half a second.

Quality comes back from a known-good frame. Restarting from scratch gives a different scene, and restarting from the latest frame keeps the damage. We keep a clean copy and return to it.

Language understanding stays off the GPU's critical path. Sentences we expect are answered from a table at once. Anything else goes to a language model, and the video keeps playing while it thinks.

How Mirage works

The browser turns speech into text with the Web Speech API and sends it over a WebSocket. The command reader answers the 229 sentences it already knows, with their common variants, from a pinned table. Everything else goes to Claude Sonnet 5.5, which writes the full scene prompt in two to three seconds. The GPU encodes the prompt with umT5, runs the generation loop with our steering on top, decodes each chunk with TAEHV and streams JPEG frames back to the page.

BROWSER UNDERSTANDING ONE NVIDIA GPU you speakWeb Speech API video canvas16 frames/s command reader known sentence → pinned, instant anything else → Claude Sonnet 5.5 writes the full prompt scene stateprompt, chips, undo umT5 encoderprompt → c generation loop denoiser Gθ2 steps/chunk memory C21 frames our steering clear · clean restart · dissolve TAEHV decoderchunk → 4 JPEGs JPEG frames over WebSocket 363 ms median from the end of a known sentence to the first new frame.
Mirage's architecture. The parts outlined in teal are ours; the models are published.

Clearing the memory on a command

We tried three ways to make the model obey, in the order you would try them.

change the prompt re-encode memory clear memory (Mirage) old scene, old keys old scene, new keys nothing to resist night after 14 s old scene stays new prompt in 1 step slow smooth, but wrong needs a fast first chunk
Three ways to apply a command, shown on the 21-frame memory.

Changing the prompt alone gave the fourteen seconds above. Re-encoding the memory under the new prompt, the recache used by LongLive, made the transition smooth, but the kept frames are still pictures of the old scene, so the old scene stayed. What we run keeps none of it:

C ← ∅,    xn = Gθ(εn, c′, ∅)(3)

The next chunk is generated as the first frame of a new video under the new prompt c′, and the memory refills with the new scene by itself.

The catch was cost. From an empty memory the model needed four denoising passes plus the memory write, each roughly 80 ms on an L40S, so the first chunk after a command took 412 ms against its 250 ms budget. We found that two passes, at t = 1.0 and 0.5, look the same as four for this first chunk, and that the memory write can happen after the frame is sent instead of before. That leaves K = 2 and twrite off the critical path: 162 ms.

normal chunk first chunk, before first chunk, now 221 ms 412 ms 162 ms 250 ms budget 0 100 200 300 400 ms
Time to generate one chunk, against the 250 ms it has before the stream stalls.

A clean cut still looks like a cut, so the eight output frames after it are blended with the old picture, with the new picture's weight rising from one ninth to eight ninths:

yj = (1 − αj) · yold + αj · ynew,    αj = (j + 1) / 9,   j = 0, …, 7(4)

The eye sees a half-second dissolve. Together with interrupting the chunk already in flight and dropping stale frames, the live median from the end of a sentence to the first new frame went from 717 ms to 449 ms, and to 363 ms for a sentence the reader already knows.

Restarting from a clean copy

Drift needed a different kind of restart. Three chunks after any command, when the new scene has formed but before errors build up, we save that latent as an anchor a★. Every 24 chunks, which is six seconds, we clear the memory and regenerate from a noised copy of it:

xrestart = (1 − σ) · a★ + σ · ε(seed, anchor),    σ ≈ 0.83(5)

This is the forward process from equation (1), evaluated at t = σ. The restart frame is 17 percent anchor and 83 percent noise. That is enough noise for the model to redraw the scene cleanly, and enough anchor for it to draw the same scene. The video stayed clean for all 360 chunks of our 90-second test.

command a★ saved 3 chunks after the command restart restart every 24 chunks = 6 s
Restarting from a clean anchor. Each restart lands on the same picture because its noise is fixed.

The first version of this moved the parked car and rearranged the snow every six seconds. The cause was new noise at each restart: a different ε lands on a different picture. Seeding ε from the video's seed and the anchor's chunk number makes every restart land on the same picture. Our frame-difference score at a restart fell from 30.4 to 10.9, below the score of about 12 that ordinary motion produces between frames.

Results

Measured on the live engineBeforeMirage
End of sentence to first new frame, median717 ms449 ms
The same, for a sentence the reader knows-363 ms
A new sentence, through Claude Sonnet 5.5-2 to 3 s
First chunk after a command412 ms162 ms
Jump at a quality restart (frame difference)30.410.9
Time before the colours drain20 to 50 snone in 90 s

We developed on two NVIDIA L40S GPUs at 672×384 and ran the final demo at the model's native 832×480 on an RTX PRO 6000 Blackwell, where a chunk takes about 150 ms. These numbers are not a benchmark against the four-minute clip: the hardware differs, and a distilled streaming model gives up some picture quality for speed. They are the difference between waiting for a video and talking to one.

What we learned building Mirage

Four people can direct a lot of agents. Each of us worked through AI coding agents, and every change went through a pull request: 185 merged and 617 commits on main in about a day. The agents coordinated on a pinned GitHub issue that served as a message board. Our job was mostly to decide what to build and to check that what came back was right.

Measure on the video, not the logs. We ran a test GPU next to the live one. On the test GPU, agents measured every change with fixed seeds, frame sheets and a vision model that graded real frames, and it scored 47 of 47 on frames with known contents. On the live GPU, people tested by hand all night. Before the reader redesign went live, we replayed 879 steps of real sessions through the old and new code.

Most ideas did not survive measurement. torch.compile, three and four denoising steps for the first chunk, the full Wan decoder and a setting to keep the camera framing all looked promising, and we rejected each of them on numbers.

A fast default and a smart fallback beat one path that is both. At one point a new sentence waited up to five and a half seconds for the language model to think, which made the diffusion model look slow when it was not. Answering expected sentences from a table, and sending only the rest to Claude with less thinking, kept the demo at about a third of a second without giving up open-ended commands.

Limits

Mirage still has clear limits. Everyone in the room steers the same video. The shot re-frames on every command, because a cleared memory forgets the camera along with the scene. The 1.3B model cannot draw a specific person: ask for Jensen Huang and you get a man with grey hair in a black leather jacket. And the picture is soft next to large offline models. A larger streaming model would help with the last two, at a cost in speed we have not yet found a way to pay.

Video diffusion models got good before they got fast. We think the more interesting step now is making them responsive, so that the model keeps listening while it draws.

Prior art. Mirage builds directly on Training-Free Interactive World Models. The video model is Wan 2.1 (1.3B) made causal and few-step by Causal Forcing, which follows Self Forcing. The memory recache we compared against comes from LongLive, the decoder is TAEHV, and the text encoder is umT5. The four-minute figure is from the Wan 2.1 README. All other numbers were measured by us on our own runs.

Acknowledgements. Mirage was built at MadHacks 2026 by Arunjay, Ishaan, Anirudh and Prateek. Ishaan led the steering work inside the model, Anirudh built the demo page and voice input, Prateek built the command understanding and the studio page, and Arunjay led the team and built the real-time engine. The code is at github.com/Arunjay4213/MadHacks, and the Devpost page is here.

All posts