What is Mage
Mage is Microsoft's open-source 4B-parameter multimodal model family, comprising the streaming video/image understanding model Mage-VL and the image generation and editing model Mage-Flow. Mage-VL reduces visual tokens by 75% through Codec-Native encoding, speeds up inference by 3.5x, and supports real-time video understanding; Mage-Flow supports native-resolution generation and instruction editing, with the Turbo version achieving 4-step sampling and 0.6-second image generation on a single A100 GPU.
Mage's Main Features
-
Image Generation: Supports text-to-image generation at any native resolution from 512–2048, with the Turbo version achieving 4-step sampling and 0.6-second image generation on a single A100 GPU.
-
Image Editing: Supports instruction-based editing such as background replacement, style transfer, material replacement, and element addition/removal, with mask-based local modifications.
-
Multimodal Understanding: Covers question answering and captioning for images, documents, and videos, and supports real-time streaming video understanding for live streams and surveillance.
Mage's Technical Principles
- Mage-VL's Codec-Native Encoding: Drawing on H.264/HEVC video encoding principles, Mage-ViT distinguishes I keyframes (fully preserved) from P predicted frames (only changed regions preserved), reducing visual tokens by over 75%; combined with a bionic dual-system architecture (System 1 lightweight event gateway monitors changes, System 2 causal decoder completes reasoning), video inference is up to 3.5x faster without losing spatiotemporal context.
- Mage-Flow's Native-Resolution Generation: Based on Mage-VAE (reconstruction quality on par with FLUX.2 at lower cost) and NR-MMDiT (native-resolution diffusion Transformer, no size-bucket training required), trained with Rectified Flow matching; provides Base, RL-aligned, Turbo distilled acceleration (4-step sampling), and Edit editing branches, achieving high-quality image generation and instruction editing at 4B parameters.
Follow WeChat and reply "open source" to join theAI Open-Source Project Community Group
How to Use Mage
- Clone the Repository: Clone the
microsoft/Magecode repository from GitHub to your local environment. - Install Dependencies: Install the required Python dependencies and runtime environment according to the project README.
- Download Weights: Download the pre-trained weights of Mage-VL (understanding) or Mage-Flow (generation/editing) from Hugging Face.
- Load the Model: Load the corresponding model based on the task type and configure inference parameters (such as resolution and sampling steps).
- Execute the Task: Input text prompts, images, or video streams to perform generation, editing, or multimodal understanding tasks.
- Save the Results: Retrieve and save the model's output images, video descriptions, or question-answering results.
Mage's Core Advantages
-
Small Parameters, Big Capabilities: With only 4B parameters, it simultaneously covers high-quality image generation/editing and streaming video understanding, without relying on blindly stacking parameters.
-
Extreme Codec-Native Compression: Reduces visual tokens by 75%, speeds up video inference by up to 3.5x, and natively supports real-time live streaming and surveillance scenarios.
-
Native-Resolution Generation: Supports direct output at any resolution from 512–2048 without size-bucket training, with image details and text rendering on par with larger models.
-
Ultra-Fast Sampling: The Turbo version needs only 4 steps to generate a 1024×1024 image in under 0.6 seconds on a single A100 GPU.
-
Full-stack open-source friendly: The code, weights, and paper are all open source under a permissive license, suitable for academic fine-tuning and deployment with small-to-medium compute.
-
Low hardware barrier: The 4B scale greatly reduces deployment costs and provides a feasible solution for multimodal capabilities on edge devices.
Mage's project address
- Project website:https://microsoft.github.io/Mage/
- GitHub repository:https://github.com/microsoft/Mage
- HuggingFace model library:https://huggingface.co/collections/microsoft/mage
Comparison of Mage with similar competing products
| Dimension | Mage(4B) | Qwen3-VL-4B |
|---|---|---|
| Capability scope | Simultaneously covers image generation, editing, streaming video, and image-text understanding | Focuses on image/video/document understanding, does not support image generation |
| Video processing | Native streaming understanding, 75% token compression, 3.5x inference speedup | Supports conventional video frame sampling understanding, but streaming real-time performance is weaker |
| Image generation | Mage-Flow supports text-to-image, instruction editing, and generation at arbitrary resolutions | No image generation capability |
| Deployment cost | 4B unified architecture, a single A100 GPU can run the full generation + understanding pipeline | 4B understanding model, requires an additional generation model to cover Mage's full pipeline |
Mage's application scenarios
-
Real-time livestreaming/sports commentary: Streaming video understanding can analyze livestream footage in real time and automatically generate commentary and data Q&A.
-
Intelligent surveillance and security: Performs real-time abnormal event detection and alerts on surveillance video, greatly reducing manual inspection costs.
-
E-commerce product image generation: Quickly generates high-quality product hero images, scene images, and multi-style variants, and supports instruction-based local modifications.
-
Social media content creation: One-click completion of poster generation, style transfer, element addition and removal, and other operations, lowering the design barrier.
-
Edge device multimodal assistant: The small 4B parameter size is suitable for deployment on phones, IoT, and other edge devices, providing localized image-text-video understanding services.