RectifiedFlow is a unified PyTorch library for implementing Rectified Flow models, a type of generative model that learns ordinary differential equations to transform data between distributions. The library provides a modular framework for training various architectures (MLP, UNet, DiT, LightningDiT) on different datasets, with support for multiple sampling algorithms and interpolation schemes. Key features include a symbolic solver for affine interpolation equations, utilities for converting between different interpolation schemes while preserving rectified flow properties, and a flexible sampler base class for implementing custom integration methods. The codebase demonstrates strong software engineering practices with clear separation of components, comprehensive documentation through examples, and active maintenance.
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.