This repository provides an unofficial PyTorch implementation of the paper Mean Flows for One-step Generative Modeling on the CIFAR-10 dataset.
# Clone this repository
git clone https://github.com/Boo-0102/MeanFlow.git
cd MeanFlow
# Create and activate a conda environment:
conda create -n meanflow python==3.10
conda activate meanflow
# Install dependencies
pip install -r requirements.txtUnconditional
- To train an unconditional model, run the following script:
cd MeanFlow
sh scripts/train.shConditional
- To train a class-conditional model with CFG, run the following script:
cd MeanFlow
sh scripts/train_cfg.shUnconditional
cd MeanFlow
sh scripts/sample.shConditional
cd MeanFlow
sh scripts/sample_cfg.sh- To generate samples and calculate the FID score for a trained unconditional model, run:
cd MeanFlow
sh scripts/evaluate.shThis implementation is based on or inspired by the code from the following repositories:
If you find this implementation useful, please cite the original paper:
@article{geng2025mean,
title={Mean Flows for One-step Generative Modeling},
author={Geng, Zhengyang and Deng, Mingyang and Bai, Xingjian and Kolter, J Zico and He, Kaiming},
journal={arXiv preprint arXiv:2505.13447},
year={2025}
}