explaingit

xingyu-zheng/mrflow

Analysis updated 2026-05-18

273PythonAudience · researcherComplexity · 4/5Setup · hard

TLDR

MrFlow speeds up AI image generation models by generating a low-resolution image first, upscaling it, then quickly refining it, without any retraining.

Mindmap

mindmap
  root((MrFlow))
    What it does
      Staged low-res then high-res sampling
      Training free acceleration
      Uses Real-ESRGAN upscaling
    Tech stack
      Python
      PyTorch
      Diffusers
    Use cases
      Speed up image generation models
      Combine with distilled models
      Reproduce paper results
    Audience
      Researchers
      ML engineers
    Setup
      Needs pretrained checkpoints
      Requires GPU environment

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Speed up an existing pretrained text-to-image diffusion model without retraining it.

USE CASE 2

Reproduce the speedup results reported in the MrFlow research paper on models like Qwen-Image and FLUX.

USE CASE 3

Combine MrFlow's staged sampling with already-distilled fast models such as Pi-Flow for even greater speedups.

USE CASE 4

Generate high-resolution images while shifting most of the computation to a cheaper low-resolution stage.

What is it built with?

PythonPyTorchDiffusersTransformers

How does it compare?

xingyu-zheng/mrflowadrienbrault/geekmagic-hacskarpathy/researchlei
Stars273274274
LanguagePythonPythonPython
Last pushed2013-05-03
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/52/53/5
Audienceresearchervibe coderresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires downloading large pretrained model checkpoints and Real-ESRGAN weights separately, scripts need file paths edited by hand before running.

No license information is stated in the README.

In plain English

MrFlow is the official code for a research paper that speeds up AI image generation models without retraining them. The models it works with, called flow-matching diffusion models, normally create an image by gradually refining it over many steps, and doing this at full resolution is slow. MrFlow changes the order of operations: it first generates a low-resolution version of the image, which is fast, then uses a separate tool called Real-ESRGAN to upscale that image, and finally runs a short refinement pass at full resolution to restore fine detail. Most of the expensive work happens at low resolution, and only a small amount happens at high resolution. Because no training or fine-tuning is needed, MrFlow can be dropped onto an existing pretrained model. The authors report it works with several popular image models, including Qwen-Image, FLUX.1-dev, FLUX.2 Klein, and Z-Image, and it can even be combined with already-accelerated distilled models such as Pi-Flow and FLUX-schnell. Reported end-to-end speedups range from about 8 times faster on FLUX.1-dev to as much as 25 times faster on Qwen-Image when paired with Pi-Flow, measured across the whole process including text encoding and image decoding, not just the core generation step. The repository ships two minimal example scripts, one for Qwen-Image and one for FLUX.1-dev, where a person edits the file paths to point at their own downloaded model checkpoint and the Real-ESRGAN upscaling weights, then runs the script from the command line. Additional example scripts for other supported models live in a separate examples folder. Using MrFlow requires a working Python environment with PyTorch, the Diffusers library, and Transformers already installed, along with the pretrained model files themselves, which are not included in the repository and must be downloaded separately. The project accompanies a published research paper on arXiv and is aimed at people already working with these image generation models who want faster results.

Copy-paste prompts

Prompt 1
Help me set up a Python environment with PyTorch and Diffusers to run MrFlow.
Prompt 2
Explain what the 12plus1 setting means in MrFlow's staged sampling.
Prompt 3
Walk me through pointing the qwen_image_mrflow.py script at my own model checkpoint.
Prompt 4
Show me how MrFlow combines with Pi-Flow to speed up Qwen-Image.

Frequently asked questions

What is mrflow?

MrFlow speeds up AI image generation models by generating a low-resolution image first, upscaling it, then quickly refining it, without any retraining.

What language is mrflow written in?

Mainly Python. The stack also includes Python, PyTorch, Diffusers.

What license does mrflow use?

No license information is stated in the README.

How hard is mrflow to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is mrflow for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.