FastWan 2.2 TI2V-5B for ONNX Runtime Web

FastVideo's FastWan2.2-TI2V-5B (Wan 2.2 TI2V-5B, DMD-distilled to three steps), exported for ONNX Runtime Web on WebGPU, as Jean runs it in a browser tab: 5-second films at 16 frames a second, 832 × 480, 480 × 832 or 640 × 640, from a description, in about 90 seconds on an M3 Max in Chrome and 3.4 minutes in Safari 27. How it was made and measured: spikes/films in Jean's repository (py/export_film.py, findings.md).

Files

Folder What Size
tokenizer/ umT5's tokenizer, as FastWan's 21 MB
text_encoder/embedding.i8, embedding.scale.f16 umT5-XXL's embedding, a row of int8 per token and its fp16 scale, looked up by the caller 1.05 GB
text_encoder/layers_00_08.onnx, layers_08_16.onnx, layers_16_24.onnx (+ .data0) umT5-XXL's encoder, eight layers each, 8-bit (MatMulNBits, blocks of 32, symmetric, accuracy level 1), wo computed in fp32 as transformers keeps it; the last with the final norm 3 × 1.66 GB
transformer/transformer.onnx (+ .data0–.data2) the transformer, its blocks 8-bit (as above), its embedders and output fp16, attention as com.microsoft.MultiHeadAttention, no tensor of more than four dimensions 5.43 GB
decoder/taehv.onnx madebyollin's TAEHV taew2_2, fp16, four dimensions (MIT, decoder/LICENSE) 20 MB

Running it

  • Text: tokenize the description (truncated to 512 tokens), look up each token's row × its scale, run the three graphs in turn on hidden [1, tokens, 4096] (fp16; a graph's fp32 output cast to fp16 for the next), then pad the result with zeros to [1, 512, 4096].
  • Latent: [48, 21, H/16, W/16] for 81 frames. Tokens are its points 2 × 2: token (t, h, w) holds channel-major latent[c][t][2h + i][2w + j] (c, then i, then j), 192 numbers.
  • Transformer: patches [1, N, 192] fp16, timestep [1] int64, text [1, 512, 4096] fp16, rope_cos and rope_sin [1, N, 1, 128] fp32 → out [1, N, 192], each token's numbers in the order (i, j, c). The rotary tables: 44 numbers for the frame, 42 for the row, 42 for the column, each axis's frequencies 1 / 10000^(2k / its numbers), each angle's cosine and sine repeated twice, and the sines at even places negated.
  • Sampler (FastVideo's DMD): timesteps 1000, 757, 522, whose sigmas are 1, 0.756757 and 0.521739 (FlowMatchEulerDiscreteScheduler(shift=8)'s nearest). At each, x0 = x − σ·out; then x = σ_next·noise + (1 − σ_next)·x0 with fresh noise; no guidance.
  • Decoder: the latent as [21, 48, H/16, W/16] (no denormalizing) → frames [81, 3, H, W] in 0…1.

Accuracy

Against FastWan in PyTorch (bf16), same noise: the text encoder's output at cosine 0.994–0.998; the transformer's first pass at 0.998 (fp16 itself: 0.9995). A three-step sampler makes any difference a slightly different take: judged by eye, films look as PyTorch's do. TAEHV is 26.4 dB from Wan 2.2's own decoder on the same latent.

Licence

Apache 2.0, as Wan 2.2, FastWan and umT5; the decoder is MIT (TAEHV, Ollin Boer Bohan).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for jean-is/FastWan2.2-TI2V-5B-ONNX

Quantized
(4)
this model