Papers
Topics
Authors
Recent
Search
2000 character limit reached

Mage-Flow: An Efficient Native-Resolution Foundation Model for Image Generation and Editing

Published 21 Jul 2026 in cs.CV, cs.AI, cs.LG, cs.MM, and eess.IV | (2607.19064v1)

Abstract: Large-scale visual generators are increasingly capable but costly to train, fine-tune, and deploy. We introduce Mage-Flow, a compact 4B-scale generative stack for efficient text-to-image generation and instruction-based image editing. The stack is built from two co-designed components: Mage-VAE, a lightweight high-fidelity latent tokenizer, and a Native-Resolution Multimodal Diffusion Transformer trained with rectified flow matching. Mage-VAE uses one-step diffusion-style encoding and decoding with anchor-latent regularization, preserving the reconstruction quality of strong public VAEs while reducing tokenization cost by more than an order of magnitude. Together with native-resolution packing and stack-level CUDA kernel fusion, the stack supports flexible-resolution training and improves end-to-end training throughput by about 2.5×2.5\times. Built on this foundation, we develop a complete model family with Base, RL-aligned, and Turbo variants for both generation and editing. Diffusion-NFT improves prompt following, text rendering, aesthetic quality, and editing fidelity, while few-step distillation with adversarial perceptual guidance produces 4-step Turbo models for low-latency inference. Despite its compact scale, Mage-Flow and Mage-Flow-Edit achieves competitive performance across standard generation and editing benchmarks. More importantly, the Turbo variants make high-resolution generation and editing practical for interactive use: at $10242$ resolution on a single NVIDIA A100 GPU, Mage-Flow-Turbo generates an image in 0.59s, and Mage-Flow-Edit-Turbo edits an image in 1.02s, while maintaining a small memory footprint. These results show that careful tokenizer--backbone--system co-design can deliver strong high-resolution generation and editing within an efficient 4B model family.

Summary

  • The paper introduces a co-designed 4B system combining the Mage-VAE tokenizer with a native-resolution diffusion transformer, achieving competitive generation and editing quality at substantially lower compute than larger models.
  • Mage-VAE matches FLUX.2-VAE reconstruction quality while using about 12.3× fewer encoding MACs per pixel and 22.3× fewer decoding MACs, while kernel fusion delivers a 2.49× training speedup.
  • The paper’s four-step Turbo models enable 0.59-second 1024² generation and 1.02-second editing on a single A100, though Chinese text rendering and complex text editing remain weaker than leading systems.

Overview and motivation

Mage-Flow is a compact 4B-parameter generative stack for text-to-image generation and instruction-based image editing, built by the Microsoft Mage team. The paper's central position is that competitive visual generation does not require the 6B–80B backbones of recent open-source systems (Z-Image at 6B, Qwen-Image at 20B, FLUX.2 at 32B, HunyuanImage-3.0 at 80B); instead, efficiency should come from co-designing the tokenizer, the diffusion backbone, and the training system under a fixed compute budget (2607.19064). The stack comprises two components: Mage-VAE, a lightweight latent tokenizer, and a 4B Native-Resolution Multimodal Diffusion Transformer (NR-MMDiT) trained with rectified flow matching. From this shared stack, the authors derive six checkpoints — Base, RL-aligned, and 4-step Turbo variants for both generation (Mage-Flow) and editing (Mage-Flow-Edit).

Mage-VAE: one-step diffusion-style tokenization with anchor-latent regularization

Mage-VAE treats the tokenizer as a learned image codec rather than a conventional autoencoder. The decoder is a fully convolutional pixel-diffusion model pre-trained with a compression-oriented objective and distilled to a single step, following CoD-Lite's observation that compression-oriented pre-training transfers better to learned codecs than generation-oriented pre-training at small scale. The encoder is constructed as the architectural dual of the decoder: a one-step diffusion model that generates latents conditioned on pixels. Crucially, instead of a standard Gaussian-prior KL, Mage-VAE regularizes its posterior toward an anchor latent distribution induced by FLUX.2-VAE, internalizing FLUX.2's 2×2\times patchification by directly producing 16×16\times-downsampled latents with 128 channels.

The quantitative claims are strong. On CLIC 2020 (~2K native resolution) and FFHQ at 102421024^2, Mage-VAE matches or exceeds FLUX.2-VAE reconstruction quality (e.g., FFHQ PSNR of 40.67 vs. 40.47) while requiring approximately 12.3×12.3\times fewer encoding MACs/pixel and 22.3×22.3\times fewer decoding MACs/pixel (173/215 kMACs/px versus 2134/4798). Baseline VAEs become extremely slow or run out of memory at 409624096^2, whereas Mage-VAE remains efficient. A cross-tokenizer ablation further shows that swapping Mage-VAE and FLUX.2-VAE in fixed downstream backbones yields comparable generation and editing scores, indicating that anchor-latent supervision preserves the latent geometry required by FLUX.2-style generators. This compatibility claim depends on the assumption that the anchor distribution adequately captures the target generator's latent structure; the ablation covers only FLUX.2-Klein-4B and Mage-Flow-Turbo backbones, so generalization to other architectures is not established.

Native-resolution MMDiT and packed inference

The NR-MMDiT follows SD3-style MMDiT blocks with modality-specific normalization and projections but joint self-attention. Its distinguishing feature is native-resolution packing inspired by NiT: images of arbitrary resolutions and aspect ratios are encoded, flattened into variable-length latent sequences, and packed into single batches under a fixed token budget using FlashAttention variable-length kernels and per-sample 2D RoPE. Text conditions are likewise packed rather than padded. This removes the bucket-quantization mismatch of conventional training and lets one checkpoint generalize across output sizes from $512$ up to $2048$ per side, including extreme 4:14{:}1 aspect ratios such as 512×2048512\times2048. The same packing mechanism enables evaluating conditional and unconditional CFG branches in one forward pass, yielding consistent 1.09×–1.15× inference speedups without altering the denoising trajectory.

For editing, the conditioning format extends 2D RoPE with a frame dimension 16×16\times0 over source and target tokens, and the loss is computed only on target tokens, so Mage-Flow-Edit initializes directly from Mage-Flow-Base without additional modules.

Training infrastructure and kernel fusion

The paper argues that architecture-level efficiency alone is insufficient: repeated memory-bound operator chains (normalization, adaptive modulation, RoPE application, gating, residual additions) dominate overhead. Fusing these chains across Mage-VAE, the frozen Qwen3-VL text encoder, and NR-MMDiT raises model FLOP utilization from 33.20% to 77.26%, reduces peak per-GPU memory from 175.45 GB to 141.44 GB, and delivers a 2.49× end-to-end training speedup on an 8-GPU B200 node. Replacing FLUX.2-VAE with Mage-VAE alone accounts for a 1.41× speedup; fusing the DiT blocks contributes the largest incremental gain.

Data pipelines

The generation corpus starts from roughly 10B raw image–text pairs and retains about 1.3B pairs after sample-level filtering (with thresholds progressively tightened from the 16×16\times1 stage through SFT), SSCD-based cross-sample deduplication against both intra-corpus duplicates and held-out benchmark indices, multi-granularity Qwen3-VL captioning (phrase-, entity-, composition-, and photographic-level), and concept-aware synthesis for long-tail capabilities such as bilingual text rendering. Pre-training proceeds through 16×16\times2 (1.2B pairs), 16×16\times3-pixel native-aspect-ratio (600M), and 16×16\times4-pixel (300M) stages, followed by SFT on 150M curated samples.

The editing pipeline aggregates ~90M (source, instruction, target) triples — ~50M open-source plus ~40M synthesized in-house — and filters them with three independent Qwen3.5-9B experts under partially overlapping rubrics, retaining a triple only on majority vote; this yields a 45M-triple pool tagged across a manually defined taxonomy of 19 edit categories and rebalanced by sampling rate. Editing adaptation mixes editing data with generation data (35M+35M, then 20M+10M), which the ablations show mainly benefits broad robustness of the Turbo editor (ImgEdit improves from 4.20 to 4.38) while GEdit changes are mixed — a nuance the authors state explicitly rather than overclaiming.

Post-training: Diffusion-NFT alignment

Both branches use Diffusion-NFT, which performs negative-aware fine-tuning on the forward process without likelihood estimation or solver constraints. For generation, a ~20K prompt pool spans text rendering (scored by PaddleOCR-VL-1.5 via capped Levenshtein similarity), aesthetic quality, and semantic understanding (both scored by binary-criterion Qwen3.5-27B judges), with advantages normalized separately per reward type. A two-stage schedule shifts the mixture toward harder multi-line text-rendering prompts (1:1:1 → 2:4:1) over 200 optimizer steps. For editing, a joint stream interleaves four editing updates per generation update (4:1), with editing rollouts scored by RationalRewards across instruction adherence, out-of-region preservation, plausibility, and text quality. Notably, Mage-Flow achieves the best overall GenEval score among all compared systems (0.90) after alignment, with a particularly strong positional-relations score of 0.93.

Few-step distillation

Turbo variants distill the aligned teachers into 4-step students using Decoupled DMD — separating the CFG-augmentation term (16×16\times5) from the distribution-matching term with independent noise schedules — augmented with adversarial perceptual guidance from a feature discriminator over frozen DINOv2 and CLIP spaces (16×16\times6). The ablation shows adversarial guidance consistently helps generation and text editing (e.g., LongText-CN rises from 0.783 to 0.801; TextEdit-Syn from 11.64 to 12.77) but has mixed effects on general GEdit benchmarks, a limitation the paper concedes directly. Distillation uses ~200K curated prompt–image pairs for generation and ~250K editing samples (3:1 editing-to-generation mix) for editing.

Benchmark results

Across eight generation benchmarks, Mage-Flow (20 steps) attains GenEval 0.90 — the highest reported — CVTG-2K of 0.887 (second-best open-source, approaching 32B FLUX.2-dev at 0.893), and strong TIIF and LongText results, despite being 5–20× smaller than leading competitors. Chinese long-text rendering remains comparatively weaker (LongText-CN 0.823 vs. Qwen-Image's 0.946), which the authors acknowledge as a data-supplementation gap. On editing, Mage-Flow-Edit-Turbo reaches GEdit-Bench overall scores of 8.271 (EN) and 8.264 (CN) with only 4 steps, surpassing 20B-scale editors such as Qwen-Image-Edit-2511 and FireRed-Image-Edit-1.0 under the same protocol, and ImgEdit of 4.38. TextEdit-Bench is the weakest area relative to closed-source systems (14.14 synthetic / 16.26 real-world for the full-step editor, below Nano-Banana and Seedream 4.0).

The headline efficiency result concerns interactive latency: on a single A100 at 16×16\times7, Mage-Flow-Turbo generates in 0.59 s and Mage-Flow-Edit-Turbo edits in 1.02 s, with peak GPU memory around 18–20 GB — the lowest among compared models, several of which require two GPUs (FLUX.2-dev).

Transferability: scientific diagram generation

An appendix demonstrates rapid vertical adaptation. Fine-tuning Mage-Flow-Base for 130K steps on a balanced SciForma-700K mixture yields Mage-Flow-SciForma, which reaches an Overall score of 61.61 on SciFormaBench-2K versus 40.80 zero-shot (+20.81 points, with arrow accuracy improving by 24.70), matching a 9B domain-specific baseline. This supports the claim that the compact stack is practical for domain adaptation, though the authors note the single-stage recipe could be improved with multi-stage fine-tuning or M-DPO.

Limitations and open questions

Several limitations are stated or evident. Adversarial perceptual guidance during distillation does not uniformly improve general editing metrics, leaving open how to regularize few-step editors without trading off GEdit performance. Generation-data mixing during editing training helps ImgEdit but not GEdit consistently, so the mechanism behind this asymmetry is unresolved. Chinese long-text rendering lags English substantially, pointing to remaining gaps in bilingual data coverage. Layout preservation and complex text replacement on TextEdit-Bench remain below closed-source leaders. Finally, the tokenizer-compatibility argument rests on ablations limited to FLUX.2-lineage backbones; whether anchor-latent distillation transfers to other generator families is untested.

Conclusion

Mage-Flow demonstrates that tokenizer–backbone–system co-design can deliver competitive high-resolution generation and editing at 4B scale: a VAE matching FLUX.2-VAE fidelity at ~12–22× lower compute, a 2.49× faster training pipeline via kernel fusion, and Turbo variants enabling sub-second interactive inference on a single A100. The evidence supports the paper's thesis that backbone scaling is not the only route to strong visual generation, while its own ablations identify few-step editing quality and multilingual text rendering as the areas where the compact design still trails larger and closed-source systems.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 1 tweet with 2 likes about this paper.