Denoising Diffusion PyTorch is a clean, readable PyTorch implementation of Denoising Diffusion Probabilistic Models (DDPM), the technique that kicked off the modern wave of diffusion-based image generation. Maintained by Phil Wang (lucidrains), it has gathered over 10,000 stars on GitHub and remains one of the most forked and studied diffusion codebases in the open-source community, with the repository still actively updated in 2026.
The library implements the full DDPM pipeline described in the original paper by Ho et al.: a forward process that gradually adds Gaussian noise to an image, and a learned reverse process that removes it step by step to synthesize new samples. It uses denoising score matching to estimate the gradient of the data distribution, followed by Langevin-style sampling to draw images from the learned distribution. The code is intentionally compact and hackable, which is why it shows up in so many research projects, course assignments, and follow-up papers. It supports both unconditional generation and classifier-free guidance setups, and the training loop can be pointed at your own image dataset with minimal ceremony. Because the implementation follows the math closely instead of hiding it behind abstractions, it doubles as executable documentation for how diffusion models really work.
Free. Denoising Diffusion PyTorch is fully open source under the MIT license โ install it from PyPI or clone the GitHub repository and there is nothing to pay, no hosted tier, and no usage limits.
Researchers, students, and ML engineers who want to understand diffusion models from the inside, prototype new generative-model ideas, or need a dependable DDPM baseline for experiments rather than a black-box image-generation service.