Gorio Tech Blog search

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

|

Contents

This article explains the key points of Mage-Flow: An Efficient Native-Resolution Foundation Model for Image Generation and Editing.

  • 2026-07-21 (arXiv)
  • Zhang, Xinjie, Zhang, Peng, Zheng, Shicheng, Guo, Jinghao, Jia, Zhaoyang, Shen, Yifei, Guo, Xun, Luo, Yuxuan, Li, Jiahao, Xie, Wenxuan, et al.
  • Microsoft Mage Team
  • Paper
  • Project Page

Read this article in Korean


Summary

  • Mage-Flow is a 4B-scale stack for text-to-image generation and instruction-based editing, combining Mage-VAE, a native-resolution MMDiT trained with rectified flow, packed sequences, and fused CUDA kernels. Its 4-step Turbo variants are reported to generate and edit 1024² images on one NVIDIA A100 in 0.59 s and 1.02 s, respectively.

1 Introduction

The paper addresses the training, adaptation, and deployment cost of large visual generators. It proposes a shared compact stack rather than scaling the image backbone to tens of billions of parameters.

Related work covers diffusion and MMDiT generators, instruction-based editors, visual tokenizers, preference post-training, and few-step distillation. Mage-Flow is positioned as an efficient specialist generator-editor rather than a unified understanding-and-generation model.

2.1 Image Generation Foundation Models

The generation literature has moved from pixel-space and U-Net latent diffusion toward diffusion Transformers and rectified-flow models. Mage-Flow uses a 4B generator co-designed with a lightweight VAE.

2.2 Tokenization for Image Generation

Mage-VAE targets VAE latency and memory at high resolution. It produces 16×-downsampled, 128-channel Transformer-ready latents with one-step diffusion-style encoding and decoding.

2.3 Post-training for Image Generation

The post-training stage uses Diffusion-NFT, an online negative-aware method for flow-matching generators. Capability-specific rewards target text rendering, aesthetics, semantic adherence, and editing fidelity.

2.4 Distillation for Image Generation

For four-step inference, the paper applies Decoupled DMD with VFM-based adversarial perceptual guidance. The stated aim is to retain the multi-step teacher’s quality and instruction following under strong trajectory compression.

3 Mage-Flow Stack

The stack consists of Mage-VAE, a 4B Native-Resolution MMDiT, and training/inference optimizations. Mage-VAE supplies compact latents while the backbone models packed text and image sequences across native sizes.

3.1 Mage-VAE: Lightweight Image Tokenizer

Mage-VAE is intended to remove tokenizer overhead in high-resolution and few-step pipelines. It uses one-step diffusion-style encoding and decoding plus regularization toward the FLUX.2-VAE latent distribution.

3.1.1 Architecture

The decoder is a fully convolutional one-step pixel-diffusion model with convolutional diffusion blocks and a decoupled pixel diffusion head. The encoder is its dual: patch embedding followed by convolutional diffusion blocks conditioned on pixels.

3.1.2 KL regularization with an anchor latent distribution

Instead of a standard Gaussian prior, Mage-VAE aligns its posterior with patchified FLUX.2-VAE latents. It directly emits 16×-downsampled, 128-channel latents that internalize FLUX.2 patchification.

3.1.3 Training

Training uses separate multi-step flow-matching pre-training, one-step decoder distillation with reconstruction, DMD, and projected-GAN losses, then joint optimization with anchor-latent KL regularization. Appendix A adds an encoder warm-up with the decoder fixed.

Connects FLUX.2-VAE anchor latents to the symmetric Mage-VAE and its three training stages.

Mage-VAE anchor space, architecture, and staged training process.
Mage-VAE anchor space, architecture, and staged training process.

3.1.4 Evaluation

On CLIC 2020 and FFHQ, Mage-VAE reports reconstruction quality comparable to FLUX.2-VAE while using about 12.3× fewer encoding and 22.3× fewer decoding kMACs per pixel. Tokenizer-swapping experiments report close downstream generation and editing results.

Mage-VAE uses 173/215 kMACs per pixel for encoding/decoding versus FLUX.2-VAE's 2134/4798 while reporting close reconstruction metrics.

Mage-VAE reconstruction quality, parameter counts, and encoding and decoding complexity.
Mage-VAE reconstruction quality, parameter counts, and encoding and decoding complexity.

Swapping Mage-VAE and FLUX.2-VAE while holding the backbone fixed yields close generation and editing scores.

Cross-tokenizer compatibility for generation and instruction-based editing backbones.
Cross-tokenizer compatibility for generation and instruction-based editing backbones.

3.2 Native-Resolution MMDiT

NR-MMDiT is a 4B MMDiT with modality-specific normalization and projection layers and joint self-attention. Its defining training mechanism is native-resolution packing rather than a single resolution bucket per update.

3.2.1 Model Architecture and Native Packing

Variable-length latent and prompt sequences are packed under a fixed token budget. FlashAttention variable-length kernels and per-sample 2D RoPE preserve sample boundaries; packed conditional and unconditional CFG branches yield 1.09×–1.15× measured speedups.

Depicts packed variable-length image and text sequences and the joint-attention MMDiT block.

Mage-Flow architecture and Native-Resolution MMDiT block design.
Mage-Flow architecture and Native-Resolution MMDiT block design.

Packing conditional and unconditional CFG branches reduces inference time by 1.09×–1.15×.

Inference efficiency of packed classifier-free guidance evaluation.
Inference efficiency of packed classifier-free guidance evaluation.

3.2.2 Conditioning and rectified-flow training

A frozen Qwen3-VL-4B-Instruct encoder supplies conditioning, and the model is trained with rectified flow matching in Mage-VAE space. Editing concatenates instruction embeddings, source latents, and noisy target latents, uses frame-aware 3D RoPE, and applies loss only to target tokens.

3.3 Training Infrastructure

The system fuses repeated memory-bound operator chains in Mage-VAE, Qwen3-VL, and NR-MMDiT. On one 8-GPU NVIDIA B200 node, the full configuration raises MFU from 13.88% to 29.28%, reduces memory from 175.45 GB to 141.44 GB per GPU, and reduces step time from 1.9285 s to 0.7775 s.

Mage-VAE and full fusion reduce step time to 0.7775 s and memory to 141.44 GB per GPU.

Training-efficiency ablation for Mage-VAE and fused CUDA kernels.
Training-efficiency ablation for Mage-VAE and fused CUDA kernels.

4 Data Collection and Curation

Separate pipelines curate image-text pairs for generation and source-image/instruction/target-image triples for editing. Both target quality, safety, semantic alignment, diversity, and capability coverage.

4.1 Text-to-Image Data Collection and Filtering

The generation pipeline starts from roughly 10B open-source pairs and retains about 1.3B after filtering, SSCD/FAISS deduplication, multi-granularity recaptioning, and concept-aware synthesis. Thresholds become stricter from 256² through 1024² and SFT stages.

Illustrates filtering, deduplication, recaptioning, synthesis, and four caption granularities.

Text-to-image data processing and multi-granularity captioning pipeline.
Text-to-image data processing and multi-granularity captioning pipeline.

Documents stricter pixel, aesthetic, watermark, and content thresholds in later stages.

Sample-level filtering thresholds for pre-training and supervised fine-tuning.
Sample-level filtering thresholds for pre-training and supervised fine-tuning.

4.2 Image-Editing Data Collection and Filtering

The editing corpus begins with roughly 90M triples: about 50M open-source and 40M synthesized in-house. Three Qwen3.5-9B experts vote on each triple; about 45M survive and are balanced across a manually defined taxonomy of 19 edit categories.

Shows the final concept mixtures for generation and editing pre-training.

Generation and editing pre-training data composition.
Generation and editing pre-training data composition.

Shows three-expert majority-vote filtering, edit tagging, and category balancing.

Editing-triple filtering, voting, tagging, and balancing pipeline.
Editing-triple filtering, voting, tagging, and balancing pipeline.

5 Training

Generation and editing share Mage-VAE latents, the 4B backbone, and rectified-flow training, differing in conditioning and data mixtures. The pipeline produces Base, Diffusion-NFT-aligned, and four-step Turbo checkpoints.

Shows Base checkpoints branching into aligned and four-step Turbo generation and editing models.

Shared Mage-Flow generation and editing training pipeline.
Shared Mage-Flow generation and editing training pipeline.

5.1 Pre-training and Supervised Fine-tuning

Generation training progresses through 1.2B pairs at 256 × 256, 600M under a 512-pixel native-aspect-ratio regime, 300M under a 1024-pixel regime, and SFT on 150M pairs. Editing uses 35M triples plus 35M generation pairs, then 20M triples plus 10M generation pairs; multi-image examples are at most 0.5% of editing data.

Illustrates one image-and-text-conditioned editor producing semantic, appearance, restoration, and structural outputs.

Unified image-editing capabilities and representative outputs.
Unified image-editing capabilities and representative outputs.

5.2 Diffusion-NFT Post-training

Generation post-training uses about 20K prompts split across text rendering, aesthetics, and semantic understanding. Editing interleaves editing and generation updates at 4:1, scores about 30K editing prompts with RationalRewards, and runs for 300 optimizer steps.

5.3 Few-step Distillation

Turbo students are initialized from frozen aligned teachers and trained with Decoupled DMD plus a DINOv2/CLIP feature discriminator. The reported setup uses w = 7.5 and λGAN = 0.13; adversarial guidance improves several generation and text-editing metrics, while general-editing effects are mixed.

Separates Decoupled DMD's classifier-free augmentation and distribution-matching gradients from adversarial guidance.

Few-step distillation with Decoupled DMD and adversarial guidance.
Few-step distillation with Decoupled DMD and adversarial guidance.

Removing adversarial guidance lowers several generation and text-editing scores, but changes are not uniform on general editing.

Effect of adversarial perceptual guidance in four-step distillation.
Effect of adversarial perceptual guidance in four-step distillation.

Generation-data mixing improves Turbo ImgEdit from 4.20 to 4.38, while GEdit changes are mixed.

Effect of mixing generation data during editing training.
Effect of mixing generation data during editing training.

Breaks down generation and editing data used for Turbo distillation.

Composition of generation and editing distillation sets.
Composition of generation and editing distillation sets.

6 Experiments

Experiments evaluate generation on eight benchmarks and editing on ImgEdit-Bench, GEdit-Bench, and TextEdit-Bench. Comparisons include Base, aligned, and Turbo variants alongside closed-source, unified, and specialist systems.

6.1 Experimental Setup

Mage-Flow-Base, Mage-Flow, and Mage-Flow-Turbo use 30, 20, and 4 denoising steps. Editing Base and aligned models use 30 steps and Edit-Turbo uses 4; the benchmarks cover generation, text rendering, editing adherence, preservation, and visual quality.

6.2 Quantitative Results

The results describe a quality-efficiency trade-off rather than universal leadership. Mage-Flow reports 0.90 GenEval at 20 steps and Turbo 0.88 at four steps; Edit-Turbo reports 4.38 ImgEdit, 8.271 GEdit-EN, and 8.264 GEdit-CN at four steps.

Plots score against A100 latency with marker area representing peak memory for generation and editing systems.

Quality, inference speed, and peak-memory comparison for generation and editing.
Quality, inference speed, and peak-memory comparison for generation and editing.

6.2.1 Text-to-image generation

Mage-Flow’s 0.90 GenEval is the highest reported open-source score in Table 8. It reports competitive results on DPG-Bench, TIIF-Bench, OneIG, LongText, and CVTG-2K; the latter is 0.887 for Mage-Flow and 0.873 for Turbo.

Reports eight generation benchmarks, including 0.90 GenEval for Mage-Flow and 0.88 for Turbo.

Text-to-image generation results across eight benchmarks.
Text-to-image generation results across eight benchmarks.

Reports short- and long-prompt instruction-following breakdowns on TIIF-Bench.

TIIF-Bench testmini results by instruction-following category.
TIIF-Bench testmini results by instruction-following category.

Reports Mage-Flow's 0.887 CVTG-2K average and Turbo's 0.873.

Multi-region English text-rendering results on CVTG-2K.
Multi-region English text-rendering results on CVTG-2K.

Separates English and Chinese OneIG results by alignment, text, reasoning, style, and diversity.

Fine-grained generation results on OneIG-EN and OneIG-CN.
Fine-grained generation results on OneIG-EN and OneIG-CN.

6.2.2 Instruction-based image editing

Mage-Flow-Edit is competitive with larger specialist systems. Edit-Turbo reaches 8.271 GEdit-EN and 8.264 GEdit-CN, while the 30-step aligned editor reports stronger TextEdit-Bench totals of 14.14 Synthetic and 16.26 Real-World.

Compares editing results across ImgEdit, GEdit, and TextEdit benchmarks.

Instruction-based image-editing results across ImgEdit, GEdit, and TextEdit.
Instruction-based image-editing results across ImgEdit, GEdit, and TextEdit.

Shows category-level ImgEdit performance and Edit-Turbo's 4.38 overall score.

ImgEdit-Bench results by editing category.
ImgEdit-Bench results by editing category.

Shows Edit-Turbo's 8.271 GEdit-EN and 8.264 GEdit-CN scores with semantic-consistency and perceptual-quality components.

Semantic consistency, perceptual quality, and overall GEdit-Bench scores.
Semantic consistency, perceptual quality, and overall GEdit-Bench scores.

Shows the 30-step aligned editor outperforming Turbo on TextEdit totals.

TextEdit-Bench results on synthetic and real-world subsets.
TextEdit-Bench results on synthetic and real-world subsets.

6.3 Qualitative Results

Qualitative galleries show native-resolution generation, English and Chinese text rendering, and diverse source-conditioned edits. They are illustrative examples rather than controlled measurements.

6.3.1 Text-to-image visualizations

Generation galleries cover cuisine, landmarks, wildlife, imaginative subjects, portraits, and English and Chinese text at varied native aspect ratios. Text-focused examples include packaging, posters, covers, and signage.

Shows native-resolution samples at square, portrait, landscape, and 4:1 aspect ratios, including English and Chinese text.

Native-resolution editorial, photorealistic, food, bilingual text, portrait, and stylized-art samples.
Native-resolution editorial, photorealistic, food, bilingual text, portrait, and stylized-art samples.

Native-aspect-ratio mosaic shows cuisine and architecture samples.

Native-resolution cuisine and world-landmark gallery.
Native-resolution cuisine and world-landmark gallery.

Shows wildlife, scenery, fantastical creatures, and surreal composites.

General and imaginative generation gallery.
General and imaginative generation gallery.

Shows portraits with varied ages, presentation, attire, and settings.

Portrait and people generation gallery.
Portrait and people generation gallery.

Shows English text on packaging, books, posters, signage, and interface-like designs.

English text-rendering generation gallery.
English text-rendering generation gallery.

Shows Chinese and bilingual text in signs, books, packaging, and posters.

Chinese and multilingual text-rendering gallery.
Chinese and multilingual text-rendering gallery.

6.3.2 Instruction-based editing visualizations

Editing galleries show object and localized edits, scene and camera changes, appearance transformations, human-centered edits, restoration, low-level outputs, and conditional reconstruction. The paper states that displayed edit types are supported bidirectionally.

Shows source-centric editing examples for background, color, count, font, structure-aware outputs, and action edits.

Source-centric image-editing examples spanning semantic and structure-aware operations.
Source-centric image-editing examples spanning semantic and structure-aware operations.

Extends the showcased edits to material, style, removal, retouching, weather, depth, tone, viewpoint, and Canny edges.

Additional material, style, restoration, viewpoint, and multi-type editing examples.
Additional material, style, restoration, viewpoint, and multi-type editing examples.

Shows text changes, count edits, additions, removals, replacement, and extraction.

Localized content and object-editing gallery.
Localized content and object-editing gallery.

Shows background, camera, action, viewpoint, scale, and composite scene transformations.

Scene, subject, and camera-transformation gallery.
Scene, subject, and camera-transformation gallery.

Shows tone, style, material, and color transformations.

Appearance and artistic-rendering gallery.
Appearance and artistic-rendering gallery.

Shows try-on, facial and hair edits, memes, portraits, and creative composite edits.

Human-centered and creative-editing gallery.
Human-centered and creative-editing gallery.

Shows paired degradation and restoration operations including flare, rain, haze, blur, grayscale, and low light.

Bidirectional degradation and restoration gallery.
Bidirectional degradation and restoration gallery.

Shows sketches, pose, Canny, HED, depth, segmentation, normal maps, and conditional reconstruction.

Low-level vision and conditional-reconstruction gallery.
Low-level vision and conditional-reconstruction gallery.

7 Conclusion

The conclusion attributes efficiency to joint tokenizer, backbone, packing, and systems design. Future work includes more robust multi-image editing, stronger multilingual long-text rendering, and agentic visual-creation integration.

At 4096², Mage-VAE reports 149.6/375.0 ms encoding/decoding on an 80GB A100, while several baselines take far longer or are OOM.

VAE encoding and decoding latency across resolutions.
VAE encoding and decoding latency across resolutions.

The scientific-diagram mixture assigns 70% of weight to two SciFormaData-700K resolutions.

Scientific-diagram fine-tuning data mixture.
Scientific-diagram fine-tuning data mixture.

Fine-tuned Mage-Flow-SciForma reports 61.61 overall versus 40.80 for zero-shot Mage-Flow-Base.

SciFormaBench-2K results for zero-shot and fine-tuned models.
SciFormaBench-2K results for zero-shot and fine-tuned models.

Shows generated scientific diagrams with neural layouts, temporal modules, graph frameworks, and pipelines.

Scientific diagram generation results of Mage-Flow-SciForma.
Scientific diagram generation results of Mage-Flow-SciForma.

Compares zero-shot Mage-Flow-Base, fine-tuned Mage-Flow-SciForma, and SciForma-9B-Base.

Qualitative comparison of scientific diagram generation models.
Qualitative comparison of scientific diagram generation models.

Appendix

  • The appendix specifies Mage-VAE objectives and latency, reward evaluators, the recaptioning prompt, and scientific-diagram fine-tuning. Mage-VAE reports 149.6/375.0 ms encoding/decoding at 4096² on an 80GB A100; fine-tuned Mage-Flow-SciForma reports 61.61 overall on SciFormaBench-2K.

Brief Thoughts

The paper provides component-level ablations for tokenizer cost, packed CFG, kernel fusion, data mixing, and adversarial guidance. Key caveats are reliance on model-based evaluators and curated examples, plus benchmark-dependent effects of adversarial guidance and generation-data mixing.