A video or audio generator is an image generator with a time axis, and almost every design choice exists to make that axis affordable: a causal video VAE folds 4 frames into one latent frame so that a 5 s clip becomes about 33,000 space-time tokens for a flow-matching transformer, and a neural codec turns each second of sound into 100 to 600 discrete tokens for a language model, or into a short continuous latent for flow.
You need: the image denoiser this page extends (patchify, DiT, adaLN, MMDiT, 2-D RoPE ids, FLOPs per pass) on Latent diffusion and diffusion transformers; the objectives and samplers on Diffusion from zero and Flow matching; VAEs, VQ and residual quantisation of images (RQ-VAE) on Autoencoders and VAEs. One network that reads and writes text, images and speech is Native multimodal and any-to-any models. Release dates, licences and status of every model named here are on the root's Model map tab (Topic: generative-and-multimodal), including Sora's discontinuation in 2026 (app closed 2026-04-26, API scheduled to end 2026-09-24, from secondary reports).
Video: Wan 2.1's default clip through its VAE and 1 × 2 × 2 patches (sections 1 to 4). Audio: the running sentence through EnCodec 24 kHz at 6 kbps (sections 6 to 8). Highlighted: what the generator actually sees, the number every cost on this page follows from. All counts derived from the configs.
The running examples. Video: the topic's public-domain test image p01_cat (scikit-image's "chelsea", CC0) turned into two 17-frame 256 × 256 clips by sliding a crop across it, slowly (2 pixels per frame) and fast (14 pixels per frame), sent through Wan 2.1's video VAE (126.9M parameters, Apache 2.0) on the CPU, plus the configs of seven open video denoisers. Audio: one LibriSpeech sentence ("I hope he doesn't work too hard said Shaggy", 3.67 s, utterance 1272-135031-0008, CC BY 4.0) and a 3.5 s synthesised music phrase, through three open neural codecs, EnCodec 24 kHz, DAC 44.1 kHz and Mimi, at every number of codebooks. Everything measured ran on an Apple M1 Pro CPU; files and scripts are in this page's src/.
| Video | Speech, music, sound | |
|---|---|---|
| Raw size | 5 s of 480 × 832 at 16 fps: 81 frames, 97 million numbers | 3.67 s at 24 kHz: 88,080 numbers (samples) |
| Compressor | Causal video VAE: 8 × 8 in space, 4 in time, 16 channels (Wan 2.1) | Neural codec: 75 frames a second, 1 to 32 codebooks of 1,024 (EnCodec); or a mel spectrogram, or a continuous audio VAE |
| What the generator sees | 32,760 tokens for that clip (Wan 2.1 1.3B, 1 × 2 × 2 patches): tokens per second of video | 600 tokens a second at 6 kbps (EnCodec, 8 codebooks); 100 a second for Mimi at 1.1 kbps |
| Generator | A transformer denoiser trained with flow matching (Wan, HunyuanVideo, LTX, Movie Gen) or diffusion (CogVideoX) | A language model over codec tokens (AudioLM, VALL-E, MusicGen, Moshi) or flow / diffusion over mel or latents (F5-TTS, Stable Audio) |
| What fails | Motion and time: identity drift, objects appearing or vanishing, broken physics, quality falling past the trained length | Metallic or muffled timbre at low bitrates, mispronounced or skipped words, voice drift in long takes |
| How it is judged | Human preference (arenas, A/B tests), VBench; FVD with care | MUSHRA or MOS listening tests; word error rate and speaker similarity for speech; FAD, CLAP score |
Raw video: 81 × 480 × 832 × 3 = 97,044,480 numbers. Token counts from the configs and diffusers v0.41.0 pipeline defaults (section 1); codec rates from the codec configs (section 7).
The problem. Wan 2.1's default clip (480 × 832 pixels, 81 frames, about 5 s at 16 frames per second) is 97 million numbers, and neighbouring frames are almost the same picture. An image VAE applied to every frame (8 × 8 smaller in space) still leaves 81 latent frames; with 2 × 2 patches that is 81 × 30 × 52 = 126,360 tokens, most of them repeating the frame before. Attention cost grows with the square of the token count, so redundancy across time is the first thing to remove.
A causal video VAE. The image VAE (Autoencoders and VAEs) with 3-D convolutions, so it also shrinks the time axis: every open model on this page compresses time by 4 (or 6, or 8) as well as space by 8 (or 16, or 32). Two details recur:
diffusers v0.41.0 models/autoencoders/autoencoder_kl_wan.py, lines : the encode loop. The first call sees only frame 0; each later call sees 4 frames plus the cached features of everything before.
Then patches. The denoiser cuts the latent into space-time patches: Wan, HunyuanVideo and Movie Gen use 1 × 2 × 2 (one latent frame, 2 × 2 latent pixels), so each token stands for 4 × 16 × 16 = 1,024 pixels across 4 frames. Sora's report: "spacetime patches which act as transformer tokens. This scheme works for images too since images are just videos with a single frame" (OpenAI, Feb 2024, archived) vendor. With time compression ct, space compression cs and patch size p, a clip of F frames at H × W becomes
tokens = (1 + (F − 1) / ct) × H / (cs p) × W / (cs p)
For Wan 2.1's default: 21 × 30 × 52 = 32,760, about a quarter of the per-frame count. The pipeline computes the first factor the same way (num_latent_frames = (num_frames - 1) // self.vae_scale_factor_temporal + 1, pipeline_wan.py:341).
What temporal compression costs, measured. Both 17-frame clips through Wan 2.1's VAE become a latent of 16 × 5 × 32 × 32 (5 = 1 + 16 / 4), 48 times fewer numbers, then are decoded and compared frame by frame with PSNR (peak signal-to-noise ratio in decibels; higher is closer, every 6 dB halves the typical error).
Frame 0, encoded alone, comes back at dB in both clips. With slow motion the other frames stay close (mean dB): four nearly identical frames share one latent frame cheaply. With fast motion every later frame drops to about dB on average, rippling with the group size of 4: one latent frame has to describe four quite different pictures with the same 16 channels. That is why fast motion is where video generators blur first. The PSNRs transfer to any hardware (same weights, float32); the timings in the closed block at the end do not.
"Ratio" is how many input numbers (3 colours × pixels × frames) each latent number replaces; "pixels per token" includes the denoiser's patch. Read from seven open configs and Movie Gen's paper.
Every combination of size, frames and model: the Space-time patch calculator. VAE losses, KL and quantised latents: Autoencoders and VAEs.
The problem. Each token must see the rest of its frame (to draw a coherent picture) and the same object in other frames (to move smoothly). Full 3-D attention lets every token attend to every other token in the clip, at a cost that grows with the square of the token count N: for Wan 2.1 1.3B's default clip, N = 32,760, so one layer forms N2 = 1.07 billion query-key pairs per head.
The older answer: factorise. Factorised attention splits one layer into spatial attention (within its own latent frame) followed by temporal attention (the same position in the other frames). Video Diffusion Models did this inside a U-Net: "we insert a temporal attention block that performs attention over the first axis" with the spatial axes treated as batch (Ho et al. 2022); Latte compared four ways of splitting the two inside a video DiT, and alternating spatial and temporal blocks "performs the best" (a plot, not a table: Ma et al. 2024, Fig 5). With f latent frames of s tokens, the pairs fall from (fs)2 to fs2 + sf2: about 21 times fewer for Wan's default clip.
The current answer: full attention. Every open model from 2024 on uses it (CogVideoX, HunyuanVideo, Mochi, LTX-Video, Wan, Movie Gen). CogVideoX's argument: separated attention "requires extensive implicit transmission of visual information" (Yang et al. 2024, Sec 2.2): an object moving diagonally is at a different position in the next frame, so a temporal layer that looks only at the same position cannot follow it directly. Full attention became affordable because the VAE took most of the tokens out (section 1) and FlashAttention-style kernels never store the N2 matrix; the price is compute, and section 4 shows attention becomes the largest term.
Positions in 3-D. Most of these models use 3-D RoPE: the head's channels are split into three groups, each rotated by one coordinate (frame, row, column). HunyuanVideo splits a 128-wide head 16 / 56 / 56 (rope_axes_dim), Wan 44 / 42 / 42 (h_dim = w_dim = 2 * (attention_head_dim // 6), transformer_wan.py:368). Movie Gen is the exception: "factorized learnable positional embedding" (Polyak et al. 2024, Sec 3.1.3). How the ids are built and why rotation gives relative positions: Latent diffusion and diffusion transformers (section 7) and Positional Encodings.
DiT, adaLN-Zero, MMDiT and double and single stream blocks: Latent diffusion and diffusion transformers; attention kernels: Writing kernels: ... FlashAttention.
A video denoiser takes three kinds of condition, and each enters at a different place in the sequence: text through attention, an image as latent frame 0, sound as a second stream aligned in time.
The levers the open models pulled. All of them are a latent transformer with full attention and flow matching (CogVideoX: diffusion with v-prediction); they differ in where they spend tokens and parameters.
The arc in one line: factorised U-Nets (2022) to diffusion transformers on space-time patches (2024) to flow-matching transformers that also make sound (2025 to 2026). Closed models disclose almost nothing: Sora's report says "Model and implementation details are not included in this report"; Veo 3's model card says "latent diffusion ... applied to the temporal audio latents, and the spatio-temporal video latents", trained on TPUs with JAX (model card) vendor.
Parameters: counted from each config on the meta device (diffusers 0.41.0, no weights), except Movie Gen (stated). Default clip: diffusers v0.41.0 pipeline defaults or the model card; tokens from the formula in section 1 (Movie Gen's 8 × 8 × 8 VAE has no separate first frame). Release dates, licences and status: the root's Model map tab.
The arithmetic. One denoiser pass over N video tokens costs about
FLOPs per pass ≈ 2 P N + 4 L N2 D
where P is the parameter count (every weight used once per token: one multiply and one add), L the number of blocks and D the attention width (query-key scores plus the weighted sum of values, each N2D multiply-adds per layer). A clip costs that times the sampling steps times the passes per step (2 with classifier-free guidance). The first term grows with the clip's length, the second with its square. The image version, fitted to eleven image denoisers, is on Latent diffusion and diffusion transformers (section 9).
Checked against a real count. Wan 2.1 1.3B's config instantiated on the meta device (no weights) and run once at its default clip under PyTorch's FLOP counter: TFLOP, of which TFLOP () are the attention matrix products. The formula gives TFLOP (): it charges all 1.42B parameters to every video token, including the text cross-attention's key and value projections that act on the 512 text tokens only, and it leaves out cross-attention's scores. So attention is about two thirds of the compute even at 480p and 5 s; at HunyuanVideo's 720p and 129 frames the formula puts it at .
Where else the time goes, and the levers. The text encoder runs once and the VAE decoder once per clip, but a video decoder is heavy: in the measured run of section 1, decoding 17 small frames took longer than encoding them. The published speed-ups attack each factor: fewer steps by distillation (CausVid distils 50 steps to 4; HunyuanVideo 1.5 ships 8 or 12 step variants), fewer tokens by a stronger VAE (LTX-Video, Wan 2.2's 5B model), cheaper attention by sparsity (HunyuanVideo 1.5's SSTA, 1.87 times end to end, vendor), and lower resolution plus a separate upsampler (Movie Gen to 1080p, HunyuanVideo 1.5's few-step super-resolution).
Derived from configs and defaults with the formula above (not run here: the weights are not needed for counting). "Per clip" multiplies by the default steps and passes; HunyuanVideo embeds guidance in the model, so one pass per step.
Any model, resolution, duration and step count: the Space-time patch calculator. Serving costs and batching: Topic: inference-and-serving.
The problem. Inside one clip, full attention keeps things consistent: every frame sees every other. The failures are temporal: identity drift (a face or a shirt slowly changing), objects that appear or vanish, physics that does not hold. Sora's own report: it "does not accurately model the physics of many basic interactions, like glass shattering", and shows "incoherencies that develop in long duration samples or spontaneous appearances of objects" (OpenAI, Feb 2024, archived) vendor. Independent physics tests agree: on Physics-IQ "the best model scoring 29.5%" where real videos score 100 (Motamed et al. 2025) independent; on VideoPhy the best model, CogVideoX-5B, follows both the caption and physical laws in 39.6% of cases (Bansal et al. 2024) independent.
Why length is hard. Models train on clips of 5 to 16 s because tokens, and attention with their square, grow with duration (section 4). A longer video needs a bigger window (Movie Gen trained to 16 s; LTX-2 reaches 20 s with audio) or generation in pieces, each conditioned on the frames before. That works like a language model writing text, with the same weakness: the model trained on clean real frames now conditions on its own imperfect ones, errors accumulate, and quality drifts (exposure bias; FramePack calls the result "drifting").
How to check. Generate past the training length and plot a per-frame quality score and an identity score (similarity of a face or object embedding to frame 1) against time: drift shows as a slope. VBench-Long and the "dynamic degree" dimension exist because a frozen video scores well on many per-frame metrics (section 9).
Each row is one denoising step, each column one chunk of frames; darker means noisier. Illustration of the published schemes (no run here).
The problem. Audio is a waveform: air pressure measured tens of thousands of times a second (the sample rate: 16 kHz for speech recognition, 24 kHz for most speech generation, 44.1 or 48 kHz for music). The Shaggy sentence is 3.67 s, so 58,720 samples at 16 kHz or 88,080 at 24 kHz; ten seconds of speech is 240,000 numbers, against a few dozen text tokens for the same words. Nothing can attend over that directly.
The spectrogram. Cut the waveform into short overlapping windows, take each window's Fourier transform, keep the magnitude, pool the frequencies into bands spaced like human hearing (the mel scale: fine at low frequencies, coarse at high), and take the log. Whisper: "an 80-channel log-magnitude Mel spectrogram representation is computed on 25-millisecond windows with a stride of 10 milliseconds" (Radford et al. 2022, Sec 2.2); large-v3 uses 128 bins. The result is an image, 80 numbers per 10 ms, about 30 times shorter than the 16 kHz waveform.
The catch: phase. A magnitude spectrogram throws away each frequency's phase, so it cannot be played back directly. A vocoder turns a spectrogram back into a waveform; HiFi-GAN "uses a mel-spectrogram as input and upsamples it through transposed convolutions until the length of the output sequence matches the temporal resolution of raw waveforms", reaching MOS 4.36 against 4.45 for the real recordings, "167.9 times faster than real-time on a single V100 GPU" (Kong et al. 2020) vendor. Because phase is free, a vocoder's output can sound right while matching the original waveform poorly sample by sample, which is why waveform error (SNR) is a poor quality measure for generated audio (section 7).
From spectrograms to today's two representations. Text-to-speech from 2017 to 2022 predicted a mel spectrogram and called a vocoder (Tacotron 2: 80 mel channels, 12.5 ms hop, WaveNet vocoder). Today two representations dominate: discrete codec tokens (section 7), which turn audio into a language-model problem, and continuous latents from an audio VAE (Stable Audio Open: 64 numbers per frame at 21.5 frames a second for 44.1 kHz stereo, Evans et al. 2024), which turn it into a diffusion problem, exactly like an image VAE.
Top: the waveform at 24 kHz drawn as its minimum and maximum in every 10 ms. Below: 64 mel bands from 0 to 12 kHz (bottom to top) at 20 ms steps, brightness = log power over 70 dB, computed on this page's data (codec/make_assets.py). The source is a 16 kHz recording, so it holds nothing above 8 kHz (the top eighth of the bands holds only faint energy leaked by the resampler, 37 dB below the total).
What a neural codec is. An autoencoder for sound with a discrete bottleneck. A convolutional encoder strides through the waveform (EnCodec: 320 samples per step, so 24,000 / 320 = 75 frames a second, each a 128-number vector); a quantiser replaces each vector with codebook indices; a decoder turns the indices back into a waveform. It is trained with reconstruction losses on waveform and mel spectrograms plus adversarial losses from discriminators that look at the spectrogram at several scales, which is what makes it sound natural rather than merely close (SoundStream 2021, EnCodec 2022, DAC 2023, Mimi 2024).
Why residual quantisation. One codebook of 1,024 gives each frame log2(1,024) = 10 bits; spending 80 bits a frame (6 kbps) with one codebook would need 280 entries. Residual vector quantisation (RVQ) chains several small codebooks: the first quantises the vector, the second quantises what the first missed, and so on, so 8 codebooks of 1,024 give 80 bits with 8,192 stored vectors. Bits per codebook per second in EnCodec's code: bw_per_q = math.log2(self.codebook_size) * self.frame_rate = 10 × 75 = 750 bit/s, so 1.5 kbps is 2 codebooks and 24 kbps is 32. The image version (RQ-VAE) and VQ training tricks are on Autoencoders and VAEs.
transformers v5.20.1 models/encodec/modeling_encodec.py, lines . Each stage picks the nearest codebook vector (Euclidean distance, line ) and subtracts it; the bitrate formula is line .
Bitrate scalability for free. During training the number of codebooks is drawn at random per example (quantiser dropout, introduced with SoundStream), so the decoder learns to work from any prefix of the chain. That is why one model serves 1.5 to 24 kbps, and why a token generator can predict the first codebooks first: they carry the most.
mel_l1 (spectral error) is the mean absolute difference of log10 mel power (80 bands, floored 60 dB below the clip's peak): 0.1 is about 1 dB of average spectral error. resid is the share of the encoder vector's energy that the first k codebooks leave unexplained. Measured on Apple M1 Pro CPU (PyTorch 2.14.1, transformers 5.20.1, 4 threads).
The heart of codec/run_codecs.py and lines of its output.
Semantic tokens. A codec trained only to reconstruct sound has no reason to put what is said into its first codebook rather than the voice's timbre or the room. Mimi (Kyutai's codec for Moshi) runs at only 12.5 frames a second with codebooks of 2,048 and distils a speech model into its first codebook: "we distill semantic information from a self-supervised model (WavLM ...) into the first level of the RVQ", using "a plain VQ and ... an RVQ with 7 levels in parallel" (Défossez et al. 2024, Sec 3.3). At 8 codebooks that is 1.1 kbps and 100 tokens a second, rated MUSHRA 81.0 against 74.3 for SpeechTokenizer at 4 kbps (Table 4) vendor. Measured here, Mimi's first codebook alone gives a smeared spectrogram (error ; listen in the RVQ codec explorer): it carries content, not timbre; 8 codebooks reach at 1.1 kbps, close to EnCodec at 1.5 kbps () with two thirds of the tokens per second (100 against 150).
Every codec, bitrate and clip, with players and the token rates of nine codec settings: the RVQ codec explorer.
EnCodec 24 kHz, decoded from the first k codebooks of one encoding. Left: the log-mel spectrogram of the reconstruction above the original; right: spectral error against bitrate. The counters add how much of the encoder's vector the first k stages leave unexplained. Toggle to Opus, the standard non-neural codec, at about the same bitrate; the controls set k.
Route 1: a language model over codec tokens. Once audio is tokens, generating it is next-token prediction, and everything known about language models applies (prompts, sampling temperature, KV caches, streaming). The difficulty is that each frame has several codebooks, so the question is in what order to predict them.
Moshi (Kyutai, 2024) is full duplex: it "always listens and always generates sound", modelling its own Mimi tokens and the user's as parallel streams plus a text stream it writes as an "inner monologue", 17 tokens per 80 ms step (1 text + 8 + 8). A 7B temporal transformer runs once per step and a small depth transformer generates the codebooks within the step; "a theoretical latency of 160ms, 200ms in practice" (Défossez et al. 2024) vendor. Mimi's 12.5 frames a second are what make one big forward pass per 80 ms affordable.
Rows are token streams, columns are 80 ms steps (Mimi's 12.5 frames a second). The temporal transformer reads everything up to the previous step once per step; the depth transformer then emits this step's own tokens one after another, text first. In the current step (outlined) the user's codes have just been heard (solid) and Moshi's are still to be generated (faint). Structure from the Moshi paper; token counts from the Mimi config. The same frame set against a three-model cascade, the native-or-pipeline question: Native multimodal and any-to-any models, section 9.
Route 2: flow or diffusion over continuous audio. The image recipe, applied to a spectrogram or an audio latent. F5-TTS trains a DiT with flow matching to fill in masked mel frames; the text is "simply padded with filler tokens to the same length as input speech", with no duration model or aligner; 336M parameters, about 95K hours of speech, "an inference RTF of 0.15" (real-time factor: 10 s of speech in 1.5 s, on an RTX 3090 at 16 steps) (Chen et al. 2024) vendor. Stable Audio Open generates "variable-length (up to 47s) stereo audio at 44.1kHz" with a 156M VAE, a 109M T5 text encoder and a 1,057M DiT, trained on Creative Commons recordings; it cannot produce intelligible speech or lyrics (Evans et al. 2024).
Training: a random span of the mel frames is masked and the model learns the flow that fills it, seeing the rest of the audio and the whole padded text. Inference: the prompt recording is the unmasked part, its transcript plus the new text is padded with filler tokens, and the total length must be chosen before sampling (the "fixed or estimated length" weakness in the table below). Frame counts illustrative.
| Codec tokens + language model | Continuous latent or mel + flow / diffusion | |
|---|---|---|
| Examples | AudioLM, VALL-E, MusicGen, Bark, Moshi, CSM, Dia | F5-TTS, Stable Audio Open, Movie Gen Audio, LTX-2's audio stream, Veo 3 ("temporal audio latents") |
| Strength | Streaming, prompting and in-context voice cloning, one model with text (any-to-any) | Parallel generation of the whole clip, fewer steps, no quantisation loss, easy joint generation with video latents |
| Weakness | Hundreds of tokens per second; errors accumulate in long takes; quality capped by the codec | Fixed or estimated length, harder to stream, no KV-cache reuse |
Small and fast. Not every speech model is large: Kokoro-82M (StyleTTS 2 with an ISTFTNet decoder, Apache 2.0) and Chatterbox Turbo (350M, MIT; the narration engine of this knowledge base's explainer videos) run comfortably on a laptop.
One network for text, images and speech: Native multimodal and any-to-any models; flow matching itself: Flow matching.
Human judgement is still the reference for both media; every automatic number measures one slice of quality and has a known blind spot. The Fréchet scores (FVD, FAD), their sample-count and preprocessing traps and the evidence on how well they track people are taught once, on Evaluating generative models (its section 9); this table keeps what is specific to each medium.
| Measure | What it does | Blind spot |
|---|---|---|
| FVD | The Fréchet distance on features of I3D, an action-recognition network, so each clip is scored as a whole (Unterthiner et al. 2018) | Mostly scores single frames: a motionless video can score well (content bias, Ge et al. 2024) independent |
| VBench | 16 dimensions (subject consistency, motion smoothness, temporal flickering, dynamic degree, spatial relationship and others), each scored by its own model (Huang et al. 2023); its total is what Wan's 86.22% refers to | Each dimension inherits its scoring model's errors; a total hides which dimension moved |
| Human A/B, arenas | Movie Gen, finding that FVD did not track human scores, evaluated with human A/B tests on its public 1003-prompt Movie Gen Video Bench; blind pairwise arenas (the Artificial Analysis Video Arena, Elo from human votes) are the closest thing to an independent ranking | Arenas move weekly, so this page does not copy them; vendor A/B tests choose their own prompts |
| MOS, MUSHRA | Listening tests: MOS (mean opinion score, 1 to 5) for speech naturalness; MUSHRA (0 to 100, with a hidden reference and low-pass anchors) for codecs, as in the EnCodec and Mimi tables of section 7 | Slow and costly to run |
| WER, speaker similarity | For speech generation: word error rate of an ASR model on the output (VALL-E used HuBERT-Large, F5-TTS Whisper-large-v3) and speaker similarity between output and prompt from a speaker-verification network (WavLM-based in both) | Say nothing about prosody or naturalness |
| FAD, CLAP score | FAD (Fréchet Audio Distance) is the Fréchet recipe on VGGish audio embeddings (Kilgour et al. 2018); CLAP score measures text-audio agreement with a contrastive audio-text model, the audio cousin of CLIPScore | Moderate agreement with listeners; both depend on the feature network |
The two numbers measured on this page (spectral error and SNR) are sanity checks of a codec on one clip, not quality scores.
FID, KID, CLIPScore, preference models, FVD and FAD with their pitfalls: Evaluating generative models; video benchmarks for VLMs: Long-context and multimodal benchmarks.
A causal video VAE needs the first frame plus whole groups. diffusers does not fail, it changes your request: . Ask for 80 frames from Wan and you get 81; from LTX-Video (8 per group) the rule is 8k + 1. Check the frame count of the output, and pick 4k + 1 yourself.
Height and width must be multiples of the VAE factor times the patch: (Wan, 8 × 2), and 32 for LTX-Video. 720p is 1280 × 720 for Wan 2.1 (720 / 16 = 45) but 1280 × 704 for Wan 2.2's 5B model, whose VAE plus patch divides by 32.
Measured: the 16 kHz LibriSpeech samples passed straight to EnCodec 24 kHz encode and decode without error, and come out as s instead of s, 1.5 times faster and higher: . The feature extractor would have stopped it: . Resample first (this page uses scipy.signal.resample_poly), and assert the rate wherever audio enters a model.
Real errors from this page's run: and . Bitrate is codebooks × frames per second × bits per code, so only a few values exist per model.
Measured: EnCodec at 24 kbps has a lower SNR than Opus at 12 kbps on the same sentence but a closer spectrogram, and its own listening test ranks it far above (section 7). Adversarially trained decoders do not reproduce phase. Use mel distance for quick checks, MUSHRA or MOS for decisions.
Wan 2.2's 5B model makes 720p clips with fewer tokens (27,280 for 121 frames) than Wan 2.1's 1.3B makes at 480p and 81 frames (32,760), because its VAE plus patch is 32 × 32 in space. And attention is about two thirds of the compute at these sizes, so doubling the duration roughly quadruples it. Count tokens with the formula in section 1, then FLOPs (section 4).
Mochi's card says its VAE "causally compresses videos to a 128x smaller size, with an 8x8 spatial and a 6x temporal compression to a 12-channel latent space"; those factors give 3 × 8 × 8 × 6 / 12 = 96, not 128 (the card does not show its arithmetic). LTX-Video's "1:192" and Wan 2.2's "64" do reproduce (section 1, closed table). Recompute from the factors.
FVD depends on frame count, resolution, the feature network and the number of samples, and it rewards good single frames over motion: a frozen video can score well (section 9). Compare only at identical settings, add a motion measure (VBench's dynamic degree), and run a human or arena comparison for decisions.
Sora's app closed in April 2026 and its API was scheduled to end in September 2026 (secondary reports; the root's Model map tracks status). Keep an open fallback and your own evaluation set, so switching is a measured decision.
Measured on Apple M1 Pro, all on the CPU (float32, 4 threads, no GPU lock needed): the three codecs at every depth on two clips, the Opus baselines (libopus through PyAV), Wan 2.1's VAE on two 17-frame clips, the FLOP count of Wan 2.1 1.3B on meta tensors, and parameter counts of seven configs. Wan's VAE took s to encode and s to decode 17 frames at 256 × 256, with peak memory GB, over this topic's 6 GB guideline, so a rerun should use smaller clips or the VAE's tiling.
Transfers exactly: codes, reconstructions and their spectral errors and SNRs (same weights, float32; a GPU may differ in the last digits), PSNR per frame, parameter and FLOP counts, token counts. Does not transfer: the timings (a laptop CPU, one clip at a time). The listening players use 32 kbps MP3 copies (the page has no network and must stay small), which add their own coding on top; every number was computed on the decoders' raw output. Not run here: any video denoiser (the smallest, Wan 2.1 1.3B, generates one 480p clip in minutes on a large GPU and would teach less than the arithmetic), and any speech or music generator.
Both cut tokens, but the VAE is trained to reconstruct, so it learns what to keep (a moving edge) and what to drop (a static background repeated over 4 frames); a bigger patch is a fixed linear projection that loses detail uniformly. Latte found tubelet-style patches "notably" worse than per-frame patches; LTX-Video moved patching into the VAE for the same reason.
Factorised is about 20 times cheaper at Wan's default size but a token can only see its own frame or its own position over time, so diagonal motion must be relayed through layers. Full attention sees everything and is what every 2024 to 2026 open model uses; it is affordable because the VAE leaves tens of thousands of tokens, not hundreds of thousands, and FlashAttention avoids storing N2. Above that, sparse or sliding-tile attention (HunyuanVideo 1.5) is the middle ground.
So that an image is a valid 1-frame video (joint image and video training, and image-to-video conditioning on a clean first latent), and so the encoder can be causal: each later group of 4 frames is encoded with a cache of features from earlier frames only. Hence 4k + 1 frames.
161 frames at 16 fps become 1 + 160 / 4 = 41 latent frames of 90 × 160, patched 2 × 2: 41 × 45 × 80 = 147,600 tokens, against 75,600 for 5 s. Tokens about double, attention FLOPs about quadruple (3.8 times).
Bits add up across stages while storage adds linearly: 8 codebooks of 1,024 give 80 bits per frame with 8,192 vectors, where one codebook would need 280. Quantiser dropout makes every prefix decodable, so one model gives many bitrates and a generator can predict coarse codebooks first.
Tokens and a language model when you need streaming, voice cloning by prompt, or one model shared with text (dialogue agents, any-to-any). Flow or diffusion over mel or latents when you can generate the whole utterance at once and want speed and robustness (F5-TTS: RTF 0.15, no aligner). The deciding factors are usually latency, length control and how the model is served.
SNR compares waveforms sample by sample, so any phase shift counts as error; hearing is mostly insensitive to phase. Neural codecs are trained with spectral and adversarial losses that reward sounding right, so their waveforms differ while their spectrograms match.
Work backwards from tokens. At Wan 2.1 14B's design (8 × 8 × 4 VAE, 2 × 2 patches) 5 s at 720p is 75,600 tokens and about 6,800 TFLOP per pass, so 50 steps with guidance is about 680,000 TFLOP: far beyond a minute on any single GPU. Levers in order of size: a stronger VAE (32 × 32 in space, as Wan 2.2 5B or LTX: 4 to 10 times fewer tokens, quadratic gain in attention); a smaller denoiser (2 to 5B); step and guidance distillation (50 × 2 passes down to 4 to 8 single passes); sparse attention; generate at 480p and upsample. Verify with the calculator, then measure: a published check is LTX-Video's 2 s for 121 frames at 768 × 512 on an H100 with a 1.9B model and 1:8192 compression.
A causal codec with a low frame rate and semantic first codebook (Mimi: 12.5 Hz, 80 ms frames, 8 codebooks), a model that runs once per frame and generates the codebooks within the frame with a small depth model, full duplex so it can listen while speaking, and text tokens predicted alongside audio for content. Moshi's budget: 80 ms frame plus 80 ms acoustic delay = 160 ms theoretical, 200 ms measured on an L4. A cascade (ASR, LLM, TTS) is simpler to build but adds each stage's latency and loses tone.
Extend in chunks conditioned on previous frames, and fight drift: train with per-frame noise levels (Diffusion Forcing) or on your own rollouts (Self Forcing), compress old context (FramePack), keep identity anchors (a reference image or keyframes generated first and filled in between). Check with a per-frame identity score over time.
How many tokens a clip becomes and what one denoiser pass and one whole clip cost, for any of eight video models at any size, length and step count. Presets are each model's own defaults, read from its diffusers config and pipeline (or paper). Extends Reading section 1 and section 4.
Formula: tokens = latent frames × (H / cs / p) × (W / cs / p), latent frames = 1 + (F − 1) / ct (Movie Gen: F / 8); FLOPs per pass = 2 P N + 4 L N2 D, checked against PyTorch's FLOP counter on Wan 2.1 1.3B (Reading section 4). Text tokens, cross-attention, the VAE and the text encoder are not included. Parameter counts from the configs on the meta device (Movie Gen: stated). Sizes the VAE and patch cannot divide are rounded down, as the latent grid would be, and flagged.
Two clips through three neural audio codecs at every depth of their residual codebook chains, with Opus as the classical baseline: look at the spectrograms, read the errors, listen. Everything measured on this page's run (Apple M1 Pro CPU); extends Reading section 7.
Players use 32 kbps MP3 copies of the decoder output (the page has no network and must stay small); only some depths have a player. Spectrograms: 64 mel bands, 0 to 12 kHz, 20 ms steps, 70 dB range.
Tokens per second = frames per second × codebooks; bitrate = that × log2(codebook size). Each row recomputes the bitrate the source states. Frame rates and codebooks: the configs used here (EnCodec, DAC, Mimi) and the papers (SoundStream, AudioLM, VALL-E, MusicGen).
This page's tabs, the parent topic and its tabs, the sibling pages, the knowledge base pages this one leans on, the papers and code behind it and the best outside resources, each with an approximate time. Outside sources are marked maker (by the people who built the method or model) or third-party. Links checked on 2026-10-17.
Space-time latents and causal video VAEs (measured), full against factorised attention, conditioning and the open models' levers, cost with one slider, long video, spectrograms, neural codecs and RVQ (measured), codec language models and flow speech, evaluation; mistakes, provenance and interview rehearsal in closed blocks. 28 min, plus 17 in closed blocks
Tokens, FLOPs and attention share for eight video models at any size, length and step count. 10 min
Two clips through EnCodec, DAC and Mimi at every depth, Opus as baseline, spectrograms and players; token rates of seven codecs. 10 to 15 min with listening
The whole topic as a map: the one-screen comparison of every family, with video and audio as one stop on it. Its Model map tab holds release dates, licences and statuses of every video and audio model named here (Sora's shutdown included). The image versions of the VAE and of flow matching, run on the topic's own data, are on Autoencoders and VAEs and Flow matching.
The image denoiser this page extends: patchify, adaLN-Zero, MMDiT, double and single streams, 2-D and 3-D RoPE ids, and FLOPs per pass of eleven image models. 33 min, plus 15 in closed details
VAEs, VQ-VAE and its training tricks, RQ-VAE (residual quantisation on images), image tokenizers. 40 min, plus 17 in closed details
The objective most video and many speech models now train with. 43 min, plus 17 in closed details
Noise schedules, v-prediction and zero terminal SNR (CogVideoX uses both), samplers, guidance and distillation to few steps. 43 min, plus 20 in closed details
One network that reads and writes text, images and speech; speech in and out. 37 min, plus 12 in closed details
Video as input to a VLM: frames, tokens and their cost. 33 min, plus 11 in closed details
FID and its pitfalls in depth, with FVD and FAD (section 9), CLIPScore, preference models. 27 min, plus 8 in closed details
RoPE in depth; video models split it over time, height and width. 40 min, plus 21 in closed details
Why full attention over 100,000 tokens fits in memory. about 26 min
The attention kernel that dominates a video model's compute. 34 min, plus 15 in closed details
The ELBO and diffusion maths behind every VAE and denoiser here. about 23 min
Batching and serving costs; streaming generation with KV caches. 34 min, plus 3 in closed details
Peak against sustained throughput, for checking speed claims like those in Reading section 4. 31 min, plus 3 in closed details
Video understanding benchmarks for VLMs (the other direction from this page). about 27 min
The "spacetime patches" framing; no architecture numbers. 15 min
The most complete public recipe: data, TAE, 30B flow model, scaling, evaluation, audio. 2 to 3 hours; Sec 3 for video
Causal VAE, DiT, data pipeline, efficiency; the open baseline. 1.5 hours
VAE comparison table, dual then single stream, MLLM text encoder. 1 hour
3-D causal VAE, expert transformer, the case against separated attention. 1 hour
Compression-first design: 1:192 VAE, decoder that denoises. 45 min
Factorised space-time attention, and four ways to split it. 40 min each
Long and streaming video: per-frame noise, causal students, training on rollouts, compressed context, chunk-wise generation. 30 to 60 min each
What a closed lab discloses: latent diffusion over audio and video latents, evaluation sets. 10 min
Neural codecs with RVQ, quantiser dropout and spectrogram discriminators. 45 min each
Language models over audio tokens: hierarchies, AR plus NAR, delay patterns. 45 min each
Semantic distillation into the first codebook, full duplex, inner monologue. 1.5 hours
Flow matching on mel for speech; latent diffusion for sound and music. 40 min each
The vocoder: mel back to waveform with periodic discriminators. 30 min
The metric and why it favours good frames over motion. 30 min each
16 dimensions with their scoring models; leaderboard. 20 min
Blind pairwise human votes ranked by Elo; the closest thing to independent rankings. 5 min, changes weekly
FID's recipe on VGGish audio features. 20 min
The causal VAE loop and the frame and size rules quoted on this page. 30 min
RVQ in under 40 lines; Mimi's split semantic and acoustic quantisers. 30 min
A careful survey of the pre-2024 video diffusion line (factorised U-Nets, cascades, inflation). 40 min
Waveforms, spectrograms, ASR and TTS with code. several hours