Instructions to use mlx-community/FastFrames-L-bf16-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/FastFrames-L-bf16-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download mlx-community/FastFrames-L-bf16-mlx --local-dir FastFrames-L-bf16-mlx
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
FastFrames-L (14B), MLX port
An unofficial community port of FastFrames-L to MLX, for text-to-video on Apple silicon Macs. It is not made, reviewed or endorsed by Apple, and it has no relationship with Apple.
Research use only, non-commercial. FastFrames-L (generator, KV refinement network and pixel decoder) is released under the Apple Machine Learning Research Model License, which allows use, modification and redistribution only for non-commercial scientific research. That applies to this port as a whole. See LICENSE-APPLE-AMLR before you use it.
Apple Machine Learning Research Model is licensed under the Apple Machine Learning Research Model License Agreement.
From a text prompt it makes a 5 second clip: 81 frames at 832x480, 16 fps. The code is a
generalisation of mlx-community/FastFrames-S-bf16-mlx
and still runs FastFrames-S (--model S) bit-identically to that port.
You need a Mac with 96 GB of memory or more for the default bf16 weights: a full clip peaks at
60 GiB. With --q8 (8-bit DiT weights) the peak is 48 GiB, which should fit a 64 GB Mac, but that
has only been run on a 128 GB machine.
Samples
Made with run.py at its default settings on an M5 Max. Click a preview for the mp4.
The prompts are four of the demo prompts in Apple's FastFrames repository; the .json next to each
clip has the full prompt and the seed. The clips are not the same as Apple's for those prompts,
because the noise comes from MLX's generator.
FastFrames-S on top, FastFrames-L below, same prompt and seed (two of the S port's sample prompts,
in tools/prompts.jsonl):
Quick start
Needs Python 3.10 or newer (tested with 3.12; the macOS system Python 3.9 is too old for MLX),
ffmpeg on the PATH, and about 45 GB of disk for the weights.
pip install -U huggingface_hub
hf download mlx-community/FastFrames-L-bf16-mlx --local-dir FastFrames-L-bf16-mlx
cd FastFrames-L-bf16-mlx
pip install -r requirements.txt # brew install ffmpeg, if you don't have it
python ffmlx/run.py "A red fox trotting through fresh snow in a pine forest, morning light" 3 fox.mp4 --model L
This repository holds the code, not the weights. Apple's files are used unmodified, so on the
first run run.py downloads them into the Hugging Face cache:
fastframes-l/{dit,kv_refiner,pixel_decoder}.safetensorsfrom apple/FastFrames-L (30.6 GB). The Hub's SHA-256 of each file is checked against the release this port was validated with, and the run stops if they differ.umt5_xxl.safetensorsfrom mlx-community/FastFrames-S-bf16-mlx (11.4 GB), and the umT5 tokenizer from Wan-AI/Wan2.1-T2V-1.3B (a few MB).
The first run is a 42 GB download. Run hf auth login first: in our clean-machine test an anonymous
download slowed to under 1 MB/s after the first 10 GB and took five hours. An interrupted download
starts the current file again.
If you already have the files, --weights DIR (or FASTFRAMES_MLX_WEIGHTS) points at a directory
holding the four of them under those names; tools/check_weights.py builds one from a manual
download of Apple's repo. A JSON line with the timings is printed and saved next to the mp4.
Useful options:
--frames Nsets the number of latent frames (default 21, which gives 81 video frames).Nlatent frames give4N - 3video frames, so--frames 5makes a 17-frame test clip in about 15 s and 41 GiB.--q8uses 8-bit weights for the DiT's projection matrices: 48 GiB peak instead of 60 GiB, at about the same speed and with a small accuracy cost (see Accuracy). The first use builds a 15.4 GB file in~/.cache/fastframes-mlxfrom Apple's checkpoint, which takes a few seconds once the checkpoint is on disk.python ffmlx/quantize.py --model Lbuilds it ahead of time.--model Sruns FastFrames-S with the same code (weights from the S port's repo).--referenceruns the plain port (ff_ref.py) instead of the fast path.--opts xcollapse=0 --decoder-dtype bf16reproduces Apple's released settings where this port deviates from them (see below).python ffmlx/batch.py tools/prompts.jsonl out/ --model Lmakes several clips with one model load.
Text embeddings are cached in ~/.cache/fastframes-mlx/emb (FASTFRAMES_MLX_CACHE moves it), so a
repeated prompt skips the 11 GB text encoder.
Performance
Measured on an Apple M5 Max with 128 GB, mlx 0.32.4, one clip of 81 frames:
| FastFrames-S | FastFrames-L | |
|---|---|---|
| Rollout | 10.6β13.5 s | 81.5 s (80β86 s over five clips) |
| Per latent frame (4 video frames) | 0.3β0.7 s | 2.65 s, rising to 4.8 s as the cache fills |
| Peak memory during the rollout | 10.6 GiB | 60.0 GiB |
| Peak memory at 5 / 9 latent frames | 40.7 / 45.5 GiB (1.21 GiB per latent frame) | |
| Decoding 81 frames | 0.44 s | 0.21 s |
The 60 GiB is 28.5 GiB of weights, 25 GiB of self-attention KV cache (40 layers, 32,760 tokens) and working memory. L runs close to the GPU's matrix-multiply throughput (about 41 TFLOP/s in bf16 at these sizes); a late frame costs about as much in self-attention over the cache as in the linear layers.
With --q8 the weights take 15.4 GiB instead of 28.5 GiB: 47.8 GiB peak for a full clip, 28.4 GiB at
5 latent frames. mx.quantized_matmul runs at the same rate as the bf16 matrix multiply at these
sizes, and a 17-frame clip took 14.8 s against 14.2 s in bf16.
Accuracy
Against Apple's code. Apple's PyTorch modules (
CausalWanModelwithFastOps,KVRefinementNetwork,BridgedPixelDecoder,FlowMatchScheduler) were run on CPU in fp32 at full depth, driven by Apple's ownFastFrames.rolloutloop, with the released weights and shared noise and prompt embedding, for 3 latent frames (9 DiT calls). The MLX port in fp32:plain port fast path first DiT call, pre-head features, relative L2 error 3.3e-6 6.4e-6 last DiT call (9th) 7.1e-5 2.6e-4 decoded pixels of the whole rollout, PSNR 90.9 dB 79.8 dB bridged decoder on the reference's own features, PSNR 130.8 dB Text encoder. Token ids are identical to Apple's tokenizer wrapper on the four prompts in
tools/prompts.jsonl, and the fp32 embeddings match Apple'sT5Encoderto 3β5e-6 relative error.FastFrames-S regression. With S weights the code gives the same uint8 frames, decoder features and KV cache as the original S port, bit for bit, on both code paths.
bf16 against fp32. The default bf16 run and an fp32 run with the same noise give 15.9 dB and 18.6 dB PSNR on two prompts at 17 frames, the same scene and subject with different motion detail. Generation is chaotic (each frame is generated from the cached frames before it), so this measures the spread between two valid runs, not a quality loss. The S port reports 14β25 dB for the same comparison.
8-bit weights (
--q8). On the first latent frame over eight seeds, against an fp32 run with the same noise, the median relative error of the decoder features is 0.114 with 8-bit weights and 0.097 in bf16 (frame PSNR 25.0 dB and 25.3 dB). The seeds range from 0.06 to 0.15 in bf16, so the 8-bit cost is small next to the seed-to-seed spread. Over a full clip the 8-bit and bf16 runs drift apart in motion detail like any two runs do; the scene, subject and rendered text stay the same (bf16 on top, 8-bit below, same prompt and seed):Not tested: agreement with Apple's bf16 CUDA output, which needs an NVIDIA GPU. Noise comes from MLX's generator, so clips are not seed-compatible with Apple's.
tools/ has the scripts for all of this (parity_torch.py, parity_mlx.py, compare.py,
parity_t5_*.py, precision_study.py, q8_study.py). The docstring of each says how to run it. One thing to know:
on M5 GPUs, MLX's fp32 matmul is only accurate to about 8e-4 (bf16 matmul is exact). The fp32 checks
were run with MLX_METAL_GPU_ARCH=applegpu_g16s, which selects the exact fp32 kernels.
Model Derivative and modifications
This repository is a Model Derivative of the Apple Machine Learning Research Model FastFrames-L, as
defined in its licence. It contains no retraining or fine-tuning and no weights of its own: Apple's
three fastframes-l/*.safetensors files are downloaded from Apple's repository and used as they
are. The changes are in the inference code:
- Re-implementation in MLX, following the structure of Apple's reference code in
ml-fastframes.
ffmlx/ff_ref.pyis the plain port,ffmlx/ff_mlx.pythe faster default path,ffmlx/ff_kernels.pythe Metal kernels. Model sizes are read from the weights, and the sampling recipe of each model (timesteps, noise order) is selected from the DiT's width. - Precision. Inference runs in bf16 with norms, RoPE and activations computed in fp32 and biases fused into the matrix multiply, mirroring where PyTorch's bf16 autocast rounds.
- Decoder in fp32 (Apple: bf16). On identical inputs the two decoders agree to 56.8 dB.
- Cross-attention padding collapse (
xcollapse, on by default). The prompt embedding is zero-padded to 512 tokens, so every padding position has the same key and value. The port attends to the real tokens plus one padding key weighted by the log of the padding count, in fp32. This is mathematically equal to the original softmax but changes the rounding. - Skipped last cache repair. The KV refinement of the final frame is never read, so it is skipped.
- Optional 8-bit weights (
--q8, off by default). The 400 projection matrices of the DiT blocks are packed as 8-bit affine values in groups of 64 (mx.quantize). The packed file is built on your machine from Apple's checkpoint and is not distributed here; it is itself a Model Derivative under the same licence. - Fused QKV,
mx.compileof elementwise chains, a Metal kernel for the decoder's depthwise convolution and a per-prompt embedding cache. None of these changes the output.
Limitations
- 60 GiB of memory for a full clip (48 GiB with
--q8). Other large GPU jobs running at the same time will push the Mac into swap. - English prompts only were tested. Long, detailed prompts work best.
- Clips are 5 seconds. Longer clips are not supported.
- Tested on one machine (M5 Max, 128 GB, macOS 27, mlx 0.32.4).
Files
| file | what |
|---|---|
ffmlx/run.py |
one clip from the command line |
ffmlx/batch.py |
several prompts and seeds, models loaded once |
ffmlx/ff_mlx.py |
the default (fast) MLX pipeline |
ffmlx/ff_ref.py |
the plain MLX port and the recipes; ff_mlx.py builds on it |
ffmlx/ff_kernels.py |
Metal kernels: decoder depthwise conv, flash attention |
ffmlx/quantize.py |
builds the 8-bit DiT file for --q8 |
tools/ |
weight check, parity and precision tools, sample prompts |
samples/ |
sample clips (mp4), previews (gif), prompts and seeds (json) |
LICENSE-APPLE-AMLR |
Apple Machine Learning Research Model License (FastFrames-L, this derivative) |
LICENSE-APACHE-2.0 |
Apache License 2.0 (Wan2.1 umT5 encoder and tokenizer) |
Licences
- FastFrames-L generator, KV refinement network and pixel decoder: from apple/FastFrames-L, Apple Machine Learning Research Model License (LICENSE-APPLE-AMLR, included verbatim). Research purposes only; no commercial use.
- Text encoder and tokenizer: umT5-XXL from Wan-AI/Wan2.1-T2V-1.3B (the same file as in the 14B repo), Apache License 2.0 (LICENSE-APACHE-2.0). The MLX conversion of the encoder is the one in mlx-community/FastFrames-S-bf16-mlx.
Because the pipeline includes the Apple components, use of this repository as a whole is limited to the research purposes the Apple licence allows.
Credits
- FastFrames by Gene Chou, Guandao Yang, Fujun Luan, Lars Mescheder, Wei Dong, Stephan R. Richter and Vladlen Koltun (Apple). Project page, code, model.
- This FastFrames-L port by abeansits.
- The FastFrames-S MLX port by the authors of mlx-community/FastFrames-S-bf16-mlx, which this code extends.
- Wan2.1 by the Wan team. Code, model.
If you use this port in research, please cite the original work:
@article{chou2026fastframes,
title = {FastFrames: Video Generation at Interactive Latency},
author = {Chou, Gene and Yang, Guandao and Luan, Fujun and Mescheder, Lars and
Dong, Wei and Richter, Stephan R. and Koltun, Vladlen},
journal = {arXiv preprint arXiv:2611.23226},
year = {2026}
}
@article{wan2.1,
title = {Wan: Open and Advanced Large-Scale Video Generative Models},
author = {Wan Team},
year = {2025}
}






