Wan2.2-TI2V-5B Turbo · FLF2V · MLX int4
Ready-to-run first + last frame → video for Apple Silicon (MLX), built from Wan-AI/Wan2.2-TI2V-5B with the 4-step Turbo distillation LoRA merged in.
| File | What | Size |
|---|---|---|
model.safetensors | TI2V-5B transformer, Turbo LoRA merged (incl. its bias/norm deltas), int4 g64 | 2.9 GB |
t5_encoder_q8.safetensors | umT5-XXL text encoder, int8 g64 (cos-sim 0.997 vs fp32) | 6.0 GB |
vae.safetensors | Wan2.2 VAE (encoder + decoder), fp32 file, decoded in fp16 | 2.8 GB |
generate_flf2v.py | generator (fork of mlx_video's generate_wan.py) | |
vae_stream.py | low-memory frame-by-frame causal VAE decode | |
build_model.py | script that produced these weights |
Usage
Requires mlx-video (the mlx_video package with
models/wan), mlx, transformers (for the google/umt5-xxl tokenizer), ffmpeg.
hf download bahae98/Wan2.2-TI2V-5B-Turbo-FLF2V-MLX-int4 --local-dir wan-flf2v
cd wan-flf2v
python generate_flf2v.py --model-dir . \
--image first.png --last-image last.png \
--prompt "A young woman raises both arms above her head, static camera" \
--width 832 --height 480 --num-frames 49 --seed 42 --output-path out.mp4
Defaults are already set for Turbo: 4 steps, Euler, shift 5 (timesteps 999/937/833/624),
CFG off. Prompt embeddings are cached in t5_cache/, so a repeated prompt skips the text encoder.
Measured (M1 Pro, 32 GB, 832×480, 49 frames)
| Phase | Time | MLX peak |
|---|---|---|
| T5 (int8; 0 if cached) | ~10 s | 7.0 GB |
| Image encode (first + last) | 3.6 s | 4.5 GB |
| Denoise, 4 steps | ~99 s | 5.5 GB |
| VAE decode (streaming fp16) | ~120 s | 13.9 GB |
| Total | ~230 s | ~15 GB process footprint |
Stock mlx_video on the same model/settings: 284 s and a 30–34 GB footprint. The gains come
from bf16/int8 T5 instead of an fp32 upcast, frame-by-frame causal VAE decode that matches the
stock decoder's output, a per-tap eval in CausalConv3d (the lazy loop held 10–12 GB of im2col
buffers), copying causal-cache slices (MLX slices are views that keep their parent alive), and an
fp16 VAE (64.6 dB PSNR vs fp32).
How FLF works here, and its limits
TI2V-5B is trained to hold only the first latent frame fixed. This pipeline also fixes the last latent frame to the end image (encoded as a static 5-frame clip, so it's a proper temporal latent). Since the model wasn't trained for that:
- Large pose/action changes work well. Example: arms down → arms up, smooth on every seed tried.
- A pure camera zoom can hold still and then snap to the end frame in the last ~4 frames, depending on the seed. Try another seed.
--last-mode inpaint(noised last frame) and--start-step 1(crossfade prior, 20% faster) are experimental. Inpaint was worse; the crossfade removes the snap but can double-expose the middle frames.
For FLF-trained quality, use the 14B Wan2.1-FLF2V-14B-720P.
Credits and licenses
- Base: Wan-AI/Wan2.2-TI2V-5B (Apache-2.0); umT5-XXL (Apache-2.0).
- Turbo: the 4-step Wan2.2-TI2V-5B Turbo distillation, as the ComfyUI-format LoRA
Wan22_TI2V_5B_Turbo_lora_rank_64. Check the upstream Turbo release's license before using these weights commercially. - Code:
generate_flf2v.pyis derived from mlx-video'sgenerate_wan.py(see its license).