Skip to content

shenoynikhil/tinydiffusion

Repository files navigation

tinydiffusion

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!

Setup

# install env with uv (lightning fast!)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
source .venv/bin/activate

Generative Models

  • Conditional Flow Matching [1][2]:
python 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>

WIP

  • Consistency Models
  • Inductive Moment Matching

Acknowledgements

  • DiT from meta for Diffusion transformers.

About

Simple Diffusion Implementations for Educational Purposes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages