Mage-Flow W4A8 + ARA for ComfyUI
A 4-bit Mage-Flow that runs on ComfyUI's native quantized kernels, with an accuracy recovery adapter that pulls it back toward BF16 and an optional INT8 text encoder that cuts another 3.7 GB of VRAM.
A 4-bit build of microsoft/Mage-Flow
in ComfyUI’s own asym_w4a8_int8 format, so it runs on stock ComfyUI kernels:
8.23 GB → 2.97 GB for the transformer. On its own the 4-bit model draws a
different image than BF16. A small accuracy recovery adapter (ARA), 99 MB,
removes about 40% of that drift. An optional INT8 ConvRot text encoder
brings peak VRAM from 12.6 GB down to 8.9 GB.
| Transformer | LPIPS vs BF16 | Peak VRAM | s / image | |
|---|---|---|---|---|
| Comfy-Org INT8 | 4.16 GB | 0.037 | 9.0 | |
| W4A8 without ARA | 2.97 GB | 0.194 | 9.0 | |
| W4A8 + ARA | 2.97 GB + 99 MB | 0.117 | 12.6 GB | 10.0 |
| W4A8 + ARA + INT8 encoder | 2.97 GB + 99 MB | 0.116 | 8.9 GB | 10.3 |
Measured in ComfyUI on 24 held-out prompts, 1024 px, 30 steps, RTX 5090 Laptop (24 GB).
How it works
- 4-bit blocks, 8-bit modulation: the 144 block linears use a 16-level codebook with groups of 16 and ConvRot rotation, with INT8 activations. The 24 modulation layers are very sensitive and stay in INT8.
- ARA from a closed form: for each layer, the quantization error and the
covariance of that layer’s real inputs give the best low-rank correction
directly, as the SVD of
E·C^½. No training needed for a strong start. - Distillation fine-tune: 1,800 steps against the BF16 model on its own generations, including long caption-style prompts. The training backend reproduces ComfyUI’s quantized layers bit for bit.
- Runtime residual, not a merge: the correction is smaller than one 4-bit step, so merging it into the weights and requantizing rounds most of it away. A small custom node adds it next to the quantized layer at runtime instead, for about 10% extra generation time.
Pick your text encoder
The same model and adapter work with the official BF16 text encoder or with my INT8 ConvRot version. The INT8 encoder is not lossless on its own, but on top of the 4-bit model it adds no measurable drift on average (0.116 vs 0.117), while single images change in small ways in either direction. The model card shows both side by side, so you can choose.
BF16, Comfy-Org INT8, W4A8 + ARA with the BF16 encoder, W4A8 + ARA with the INT8 encoder:


- Hugging Face: SearchingMan/Mage-Flow-W4A8-ARA
- ComfyUI node: kgonia/ComfyUI-MageFlow-ARA
- Workflow: ComfyUI workflow