## Video generation

*Images, video and audio*

*Last edited: 13 November 2026*

A typical video model stores a clip as blocks, each covering a few frames and a patch of the picture, and denoises all of them at once, like the image in “Image generation”, with time as an extra dimension. That is why the length of a clip is fixed in advance, usually from a few seconds to a dozen or so, and longer films are assembled from separate shots or extensions.

**In plain words:** A typical video model does not shoot a film frame by frame. It gets a stack of sheets covered in random dots, one sheet for each moment of the clip, and in round after round it corrects the whole stack at once, so the first sheet can adjust to the last. The stack has a fixed thickness. When extending, the model gets only the last sheets of the previous stack, so it can miss earlier details and repeat the errors on those sheets.

### Video tokens

- A video autoencoder (a 3D VAE) compresses both the picture within a frame and the sequence of frames over time. It stores the clip as a grid (the compressed representation from “How models generate images, video and audio”), in which one frame of the grid, called a latent frame below, replaces several film frames. Like a video codec such as H.264, it relies on neighbouring frames being similar. Wan and HunyuanVideo turn 4 film frames into one latent frame, and Movie Gen turns 8. Within the picture, Movie Gen’s autoencoder turns a square of 8×8 pixels into one cell of the grid, and the transformer joins cells into 2×2 squares, as in image models, so one token is a block of 8 frames × 16×16 pixels. A token’s position is three numbers: time, row and column.
- A worked example for Wan 2.1 at 720p: a clip of 81 frames, about 5 s at 16 frames per second. The autoencoder stores the first frame on its own. That makes a single photo a valid “film” too, so the same model can be trained on photos. The autoencoder compresses the remaining 80 frames four at a time, which gives 21 latent frames in total. Each latent frame contains 80×45 = 3,600 tokens, giving 75,600 tokens for the clip. As in Movie Gen, each grid cell represents an 8×8-pixel patch, and Wan joins the cells into 2×2 squares, so each token covers a 16×16-pixel patch of the 1280×720 picture. An LLM computes each token once, while a video model computes all of them again in each of about 50 steps. Tokens of different models cannot be compared, because each model’s token covers a different slice of the film. *Wan 2.1, 720p: 81 film frames give 21 latent frames of 3,600 tokens each, 75,600 in total. Each token covers a 16×16-pixel patch across 4 film frames, except in the first latent frame, where it covers just one film frame.*
- Strong compression in time has a price: one latent frame holds the motion of 4–8 film frames, so the autoencoder struggles most to reconstruct fast motion and fine detail (the Movie Gen authors say so directly).

### Why models generate the whole clip at once, and why clips are short

*Interactive widget on the page: The whole clip at once or in chunks: when frames are final.*

- Unlike an LLM, the model does not append its output to the prompt. A text encoder supplies prompt vectors. Any known frames are supplied up front, and the output must match them; these frames are described below. The model runs about 50 steps. That is the default in Movie Gen and HunyuanVideo (2024) and in Wan (2025). Distilled variants, described below, run a few steps, and providers of closed models do not publish the number. After the last step the autoencoder’s decoder turns the grid into film frames.
- Image-to-video generation and clip extension supply known frames: the first frame, the last frame, or frames from the end of the previous clip. Models take them in different ways. HunyuanVideo-I2V puts the first frame into the grid as already clean, with noise level zero. Wan gets the known frames as an extra input, together with a mask that says which frames are known. The model generates the rest of the clip so that it matches the known frames.
- The first reason a clip is short: the attention cost grows with the square of the number of tokens. A clip twice as long means about four times the attention cost in every step, and one four times as long about sixteen times. The Wan authors write that at a million tokens, which in that model corresponds to about a minute of 720p film, attention takes up to 95% of the compute time in training (see “Attention”).
- The second reason: data. A video model is usually trained first on photos, then on short low-resolution clips, and finally on longer 720p clips. Movie Gen was trained on clips of 4–16 s, each a single shot. The model has never seen continuous two-minute shots, so it does not know what they should look like.
- The third reason: the range of positions. Movie Gen’s time positions cover 32 latent frames, that is 256 film frames, which at 16 frames per second is exactly 16 s. Going beyond the trained range degrades quality, as in an LLM (see “Attention”: positions and RoPE).
- Product limits are of a similar order (as of November 2026): Google’s Gemini Omni Flash gives 3–15 s per call, and open models usually 5–20 s. Providers do not say whether a given limit comes from quality, cost or the rules of the service.

### A longer film

*Interactive widget on the page: A long film: extending one clip or separate shots.*

- To extend a clip, the model takes its final frames as known frames and generates the continuation; the diagram above shows the Gemini Omni Flash limits. Extending needs a separate model call: unlike the “In chunks” mode in the widget, the model gets only the end of the film and does not reuse the earlier computation stored in a KV cache. Veo 3.1, the predecessor of Gemini Omni Flash, was shut down in the Gemini API on 22 October 2026. It appended 7 s at a time, up to 148 s in total, but received only the last second as input. So a longer file can be assembled from extensions, but it will not be one consistent shot of whatever length you want.
- Drift is errors adding up: each extension adds small distortions to the ones it received as input. The model was trained on real frames. When extending a clip, it receives its own generated frames, including their errors, and treats them as real frames (exposure bias; in LLMs, this is sometimes reduced by training on the model’s own outputs, see “Distillation”).
- Forgetting occurs because the model sees only the final segment of the film. Anything absent from that segment has to be generated again from the prompt if it comes back into view. Cutting off the oldest history of an LLM conversation works in a similar way (see “The context window and agents”). The authors of FramePack (2025), a method for generating long video, describe the trade-off: longer memory helps preserve a character’s appearance, but also retains earlier errors for longer. On top of that, each extension is generated without a plan of the whole film.
- What helps: a known first and last frame (in Gemini Omni Flash a separate option for clips of 3–10 s), the same reference image with every extension instead of the end of the film alone (Gemini Omni Flash accepts up to 6 reference images), and splitting the film into shots of a few seconds, generated separately with the same references.
- There are also causal models: they generate a clip in chunks of a few latent frames, like the “In chunks” mode in the widget above, and keep the keys and values of finished chunks in a KV cache, as an LLM does (see “The generation loop and KV cache”). Each frame can then attend to every frame in its own chunk, including later ones, and to frames in earlier chunks, whereas an LLM token can attend only to itself and earlier tokens. A chunk takes a few steps instead of 50, because such a model was trained to reproduce in a few steps the output of a model that takes 50 (step distillation). Separately, it is trained on its own generated frames (on-policy), so that it drifts less. Self Forcing (2025) generates 17 film frames per second at 832×480 on one H100 GPU, faster than the 16 frames per second needed for playback. LongLive (2025) generates films of up to 240 s this way. That speed makes it possible to react to the user live, at the cost of lower resolution and one GPU for every stream. Such services already exist, e.g. Decart’s real-time API (Lucy models, live video over WebRTC), but the providers do not disclose the architecture.

### Audio, typical errors and working with the API

- Audio can be generated separately or together with the picture. Movie Gen Audio (2024) is a separate model that takes a finished video and adds sound effects and music, without speech. Google described Veo 3 (2025) as diffusion on a compressed representation of video and a compressed representation of audio, but does not disclose how it synchronises the two streams. In the open LTX-2 (2026), the video and audio streams exchange information in every transformer block, so lip movement and sound are generated together. According to the LTX-2 authors, in clips longer than about 20 s picture and sound can drift out of sync.
- The models studied in the VideoJAM paper (Meta, 2025; two diffusion models of the authors’ own) often got motion and physics wrong. Training rewards frames that look good, not motion that obeys the laws of physics. A video model does not simulate physics, so when the motion has to be physically accurate, you need a recording or a simulation.
- Character consistency: no token carries an explicit object identifier, so the model has to keep a character’s appearance from frame to frame by itself, and after the face has been covered or turned away it may reconstruct it differently. Supply a reference image of the character, and overlay exact text and logos after generation (see the compression in time above).
- API charges are per second of video, at a rate that depends on the resolution and the model variant, although the compute cost grows faster than the clip length. You can set the number of steps in your own deployment and in services that host open models; closed APIs usually do not let you set it. Iterate cheaply (4 s, low resolution, a cheaper model variant), generate the final version once at the target resolution, and add the rejected attempts to the cost of the accepted clip.
- Generation is an asynchronous job that takes from a dozen or so seconds to a few minutes: for Veo 3.1 Google stated 11 s to 6 min, and the file was available for 2 days. So you need a queue or polling for the job status, and you should store the finished output yourself. Services disappear quickly: the Sora 2 API was shut down on 24 September 2026, less than a year after launch, and Veo 3.1 in the Gemini API a month later, so keep prompts and references on your side and call the provider through your own interface, so that you can switch providers.

### Check yourself

**Question:** How does a model turn a prompt into a video clip, and why does one clip usually last only from a few seconds to a dozen or so?

**Short answer:** The autoencoder compresses the film in time as well, e.g. 4 frames into one latent frame, and the transformer divides the grid into tokens: blocks of a few frames and a patch of the picture, about 15,000 tokens per second of 720p film in Wan 2.1. A typical model denoises the whole clip at once, so the length is fixed in advance. A clip is short because the attention cost grows with the square of the number of tokens, and because the models were trained on shots of up to a dozen or so seconds and have a limited range of positions. Longer films are assembled from shots or extensions. When extending a video, the model receives only its final segment. Errors can therefore accumulate, and characters absent from that segment may look different when they reappear.

### Follow-up questions

- **An ad has to run for 40 s, and the model gives at most 15 s at a time. How do you build it?** Break the ad down into shots of a few seconds and generate each one separately, with the same reference image of the product and the character, then join them with cuts. Colour drift and changes to faces can accumulate over repeated extensions, and visible seams can appear at the joins. Services also cap the total length, for example at 30 s in Gemini Omni Flash. Use an extension only where the motion has to carry on smoothly, and watch every join.
- **After the third extension the colours are oversaturated and the main character has a different face. What do you change?** This is drift and forgetting: when extending the film, the model receives only its final segment and treats the generated frames, including their errors, as real footage. Go back to the last good extension and continue from there with a reference image of the character, or with a known first and last frame, instead of the end of the film alone. If that does not help, replace the extension with a new shot after a cut.
- **A product needs an avatar that reacts to the user live. Is a typical video API enough?** Usually not. A typical API generates the whole clip at once and takes tens of seconds or minutes to return it, so it cannot react in the middle of a conversation. You need a service that generates and streams the video chunk by chunk, fast enough to react as things happen. That is how causal models with a KV cache work, as described in the Self Forcing and LongLive papers, at the cost of lower resolution. Real-time services already exist, e.g. Decart’s API; check that the provider has such a mode, and not just a faster typical model.
- **A clip has to show on-screen text with a price and water being poured into a glass. What do you watch out for?** Overlay the caption after generation, because the autoencoder compresses several film frames into one latent frame, and small text in motion is what it reconstructs worst. Models often get the motion of the water and the hand holding the glass wrong, because training rewards how frames look rather than physical accuracy. Generate a few short versions at low resolution, pick the best one, only then generate the version at the target resolution, and count the cost per accepted clip.

### Sources

- [Meta: Movie Gen: A Cast of Media Foundation Models (2024)](https://arxiv.org/abs/2410.13720)
- [Alibaba: Wan: Open and Advanced Large-Scale Video Generative Models (2025)](https://arxiv.org/abs/2503.20314)
- [Zhang et al.: FramePack, forgetting and drift in long video (2025)](https://arxiv.org/abs/2504.12626)
- [Huang et al.: Self Forcing: Bridging the Train-Test Gap in Autoregressive Video Diffusion (2025)](https://arxiv.org/abs/2506.08009)
- [Google: Gemini Omni, video generation (documentation, as of November 2026)](https://aistudio.google.com/docs/omni)

Interactive page: https://howaiworks.dev/video-generation/
