Mage-Flow: An Efficient Native-Resolution Foundation Model for Image Generation and Editing
Mage-Flow (Microsoft) is a compact 4B-parameter open-source stack for text-to-image generation and instruction-based image editing, built from two co-designed components: Mage-VAE, a lightweight latent tokenizer using one-step diffusion-style encode/decode with anchor-latent regularization, and NR-MMDiT, a Native-Resolution Multimodal Diffusion Transformer trained with rectified flow matching. Native-resolution packing plus stack-level CUDA kernel fusion delivers ~2.5× end-to-end training throughput improvement. The model ships as Base + RL-aligned + Turbo variants for both generation and editing, with 4-step Turbo distilled via adversarial perceptual guidance. Headline: 1024² image in 0.59s and 1024² edit in 1.02s on a single A100, competitive with 9B–20B baselines on GenEval, CVTG-2K, and GEdit at 4B scale.
Key claims
Section titled “Key claims”- Mage-VAE is a one-step diffusion-style encoder/decoder with anchor-latent regularization that matches strong public VAEs on reconstruction quality while using ~12× fewer encode MACs / pixel and ~22× fewer decode MACs / pixel [§Method; project page “Mage-VAE”].
- NR-MMDiT is a single 4B shared backbone that supports flexible canvases from 512 to 2048 pixels including extreme aspect ratios, via variable-length image + text packing that avoids rigid resolution buckets and padding [§Method; project page “Native-Resolution MMDiT”].
- Packed CFG evaluates the conditional and unconditional branches in one forward pass rather than two — halving inference-time CFG cost at the cost of longer packed sequences [project page “Native-Resolution MMDiT”].
- Stack-level CUDA kernel fusion combined with native-resolution packing improves end-to-end training throughput by ~2.5× [§Method].
- The model family ships in three variants for both generation and editing: Base (rectified flow matching pretraining), RL-aligned (Diffusion-NFT post-training for prompt following, text rendering, aesthetic quality, and editing fidelity), and Turbo (4-step distillation with adversarial perceptual guidance) [§Method; project page “Model Family”].
- Mage-Flow-Turbo (4B, 4 steps) scores GenEval 0.88 and CVTG-2K 0.873, competitive with or beating Qwen-Image (20B, 0.87 / 0.829), FLUX.2-Klein-9B (0.86 / 0.424), and Z-Image-Turbo (6B, 0.82 / 0.859) [project page Table 1].
- Mage-Flow-Edit-Turbo (4B) scores GEdit-EN 8.271 and GEdit-CN 8.264, beating FireRed-Image-Edit-1.0 (20B, 7.943 / 7.887) and Qwen-Image-Edit-2511 (20B, 7.877 / 7.819) while running at 4B [project page Table 2].
- Latency at 1024² on a single A100: Mage-Flow-Turbo generates in 0.59s; Mage-Flow-Edit-Turbo edits in 1.02s [project page “Quality vs latency”].
Method
Section titled “Method”Mage-Flow decomposes the standard latent-diffusion pipeline into three co-designed pieces:
-
Mage-VAE replaces the standard convolutional VAE encoder/decoder with a one-step diffusion-style encoder and decoder trained with anchor-latent regularization. Anchor latents constrain the learned latent space toward a generation-ready shape. The one-step formulation removes the tokenizer’s compute bottleneck at high resolution (12–22× fewer MACs/pixel than strong public VAEs) without giving up reconstruction quality.
-
NR-MMDiT (Native-Resolution Multimodal Diffusion Transformer) is a dual-stream MMDiT that packs variable-length image tokens and text tokens into the same shared 4B backbone, so one set of weights covers 512²–2048² and extreme aspect ratios. Rectified flow matching is used as the training objective. During inference, CFG is packed: the conditional and unconditional branches are evaluated in a single forward pass over the packed token sequence.
-
Training and post-training pipeline. Base pretraining is followed by (a) Diffusion-NFT RL post-training for improved prompt following, text rendering, aesthetics, and editing fidelity, and (b) 4-step distillation with adversarial perceptual guidance to produce the Turbo variants. The same three-stage pipeline is applied to both the generation and editing branches, yielding six shipped checkpoints total (Base / RL / Turbo × Gen / Edit).
The stack-level engineering — native-resolution packing plus custom CUDA kernel fusion across the pipeline — is credited for the ~2.5× training-throughput improvement independent of the algorithmic contributions.
Results
Section titled “Results”- Text-to-image at 1024² (4-step Turbo, single A100):
Model Params GenEval CVTG-2K Mage-Flow-Turbo 4B 0.88 0.873 Z-Image-Turbo 6B 0.82 0.859 Qwen-Image 20B 0.87 0.829 FLUX.2-Klein-9B 9B 0.86 0.424 Mage-Flow-Turbo leads on both metrics at the smallest parameter count [project page Table 1]. - Instruction-based image editing:
Model Params GEdit-EN GEdit-CN Mage-Flow-Edit-Turbo 4B 8.271 8.264 FireRed-Image-Edit-1.0 20B 7.943 7.887 JoyAI-Image-Edit 16B 8.276 8.125 Qwen-Image-Edit-2511 20B 7.877 7.819 Mage-Flow-Edit-Turbo edges the 4B model into first on GEdit-CN and second (essentially tied) on GEdit-EN against the 20B leader [project page Table 2]. - Latency at 1024² on A100: 0.59s for generation Turbo, 1.02s for editing Turbo, at 4B parameters and a small memory footprint [project page].
- Training throughput: ~2.5× end-to-end improvement attributed jointly to native-resolution packing and stack-level CUDA kernel fusion [§Method].
- Tokenizer efficiency: ~12× fewer encode MACs/pixel, ~22× fewer decode MACs/pixel vs strong public VAEs at matched reconstruction quality [project page].
Why it’s interesting
Section titled “Why it’s interesting”Mage-Flow is a full-stack 4B challenger that plays the same “compact + engineered + open” hand as Z-Image: An Efficient Image Generation Foundation Model with Single-Stream Diffusion Transformer but stacks the levers differently: Z-Image’s win came from a single-stream DiT + Wan-VAE + aggressive distillation, while Mage-Flow keeps a dual-stream MMDiT and instead invests the efficiency budget in a one-step tokenizer (Mage-VAE with 12–22× fewer MACs/pixel) and native-resolution packing with CUDA fusion. The 4B-Turbo results (GenEval 0.88, GEdit 8.27) match or beat 9B–20B baselines like Qwen-Image, FLUX.2-Klein, and Qwen-Image-Edit-2511, which sharpens the “size is not the moat” thesis this wiki has been tracking through Krea 2 (Krea 2 Technical Report) and Ideogram 4.0 (Ideogram 4.0 Technical Details: Open model at the forefront of design). It also composes cleanly with the diffusion-serving-optimization frontier (Run FLUX.1-dev three times faster, FastVideo: Create a 5s 1080p Video in 4.5s on a Single GPU): the algorithmic 4-step distillation and packed-CFG one-forward-pass trick are complementary to graph-fusion / FP4 / SGLang Diffusion serving stacks that haven’t yet touched a native-resolution model at this size. The Diffusion-NFT RL stage puts Mage-Flow in the same post-training bucket as Uniworld-V2 (Uniworld-V2: Reinforce Image Editing with Diffusion Negative-aware Finetuning and MLLM Implicit Feedback).
See also
Section titled “See also”- Z-Image: An Efficient Image Generation Foundation Model with Single-Stream Diffusion Transformer — 6B single-stream Z-Image-Turbo, the closest “compact + open” comparator with a different architectural bet
- Qwen-Image Technical Report — the 20B Qwen-Image baseline Mage-Flow-Turbo overtakes at 5× fewer parameters
- FireRed-Image-Edit: A General-Purpose Image Editing Model — the 20B open editing baseline Mage-Flow-Edit-Turbo overtakes at 5× fewer parameters
- Native-Resolution Image Synthesis — earlier native-resolution DiT (NiT) with dynamic tokenization + packed full-attention; Mage-Flow scales the same idea to 4B open weights + Turbo distillation
- Uniworld-V2: Reinforce Image Editing with Diffusion Negative-aware Finetuning and MLLM Implicit Feedback — Diffusion-NFT is the RL objective used in Mage-Flow’s RL-aligned variant
- Align Your Flow: Scaling Continuous-Time Flow Map Distillation — flow-map / rectified-flow distillation lineage that Turbo’s 4-step distillation sits within
- Diffusion Distillation — Turbo variants are 4-step students of the Base + RL-aligned teachers
- Diffusion training efficiency — 2.5× training throughput via native-resolution packing + CUDA kernel fusion
- Diffusion serving optimization — 0.59s @ 1024² on A100; packed-CFG is a per-model complement to framework-level serving
- Dual-stream diffusion transformer — NR-MMDiT is the dual-stream variant, native-resolution
- Classifier-Free Guidance variants — packed CFG evaluates both branches in one forward pass
- Open foundation-model releases — MIT-licensed code + upcoming HF weights collection