Simple implementations of Diffusion/Flow-Matching styled models. This is mostly for educational purposes. The implementations are not optimized for performance but rather for readability.
Please open an issue if you have suggestions for improvements!
# install env with uv (lightning fast!)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
source .venv/bin/activatepython flow_matching.py <cifar10|mnist>- Denoising Diffusion Probabilistic Models (DDPM) and Denoising Diffusion Implicit Models (DDIM) [1][2]:
python ddpm.py <mnist|cifar10> [--sampling_type {ddpm,ddim}] [--ddim_steps 50] [--ddim_stochasticity] [--T 1000]- Mean Flows for One-Step Generative Modelling [1]:
python mean_flow.py <mnist|cifar10>- Consistency Models
- Inductive Moment Matching
- DiT from meta for Diffusion transformers.