$ account zhuyu-cs
MeanFlow is a PyTorch implementation of a novel single-step flow matching model for high-quality image generation. The codebase provides a complete pipeline for training and evaluating SiT (Scalable Interpolant Transformer) models on ImageNet 256x256 and CIFAR-10, with a specific focus on achieving competitive FID scores in a single sampling step. Key components include a custom loss function with bootstrap and classifier-free guidance, a flexible time-sampling strategy, and distributed training/evaluation scripts using Accelerate. The repository also contains preprocessing utilities to convert ImageNet into VAE-encoded latent LMDB databases. While primarily a research codebase, it demonstrates strong engineering practices with clean module separation, EMA tracking, and comprehensive argument configuration. The implementation closely reproduces the MeanFlow paper results but requires significant computational resources (multiple GPUs, large storage) to run.