diff-sampler
diff-sampler copied to clipboard
An open-source toolbox for fast sampling of diffusion models. Official implementations of our works published in ICML, NeurIPS, CVPR.
diff-sampler
diff-sampler is an open source toolbox for fast sampling from diffusion models. This repository includes official implementations of the following works:
- A strong baseline for fast sampling of diffusion models with ODE solvers
- (CVPR 2024) Fast ODE-based Sampling for Diffusion Models in Around 5 Steps
Zhenyu Zhou, Defang Chen, Can Wang, Chun Chen
Requirements
- This codebase mainly refers to the codebase of EDM. To install the required packages, please refer to the EDM codebase.
- This codebase supports the pre-trained diffusion models from EDM, ADM, Consistency models, LDM and Stable Diffusion. When you want to load the pre-trained diffusion models from these codebases, please refer to the corresponding codebases for package installation.
Supported ODE Solvers for Diffusion Models
| Name | Max Order | Source | Location |
|---|---|---|---|
| Euler | 1 | Denoising Diffusion Implicit Models | diff-solvers-main |
| Heun | 2 | Elucidating the Design Space of Diffusion-Based Generative Models | diff-solvers-main |
| DPM-Solver-2 | 2 | DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps | diff-solvers-main |
| AMED-Solver | 2 | Fast ODE-based Sampling for Diffusion Models in Around 5 Steps | amed-solver-main |
| DPM-Solver++ | 3 | DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps | diff-solvers-main |
| UniPC | 3 | UniPC: A Unified Predictor-Corrector Framework for Fast Sampling of Diffusion Models | diff-solvers-main |
| DEIS | 4 | Fast Sampling of Diffusion Models with Exponential Integrator | diff-solvers-main |
| iPNDM | 4 | Fast Sampling of Diffusion Models with Exponential Integrator | diff-solvers-main |
| iPNDM_v | 4 | The variable-step version of the Adams–Bashforth methods | diff-solvers-main |
| AMED-Plugin | 4 | Fast ODE-based Sampling for Diffusion Models in Around 5 Steps | amed-solver-main |
Pre-trained Diffusion Models
We perform sampling on a variaty of pre-trained diffusion models from different codebases including EDM, ADM, Consistency models, LDM and Stable Diffusion. The tested pre-trained models are listed below:
| Codebase | Dataset | Resolusion | Pre-trained Models | Description |
|---|---|---|---|---|
| EDM | CIFAR10 | 32 | edm-cifar10-32x32-uncond-vp.pkl | |
| EDM | FFHQ | 64 | edm-ffhq-64x64-uncond-vp.pkl | |
| EDM | ImageNet | 64 | edm-imagenet-64x64-cond-adm.pkl | |
| Consistency Models | LSUN_bedroom | 256 | edm_bedroom256_ema.pt | Pixel-space |
| ADM | ImageNet | 256 | 256x256_diffusion.pt and 256x256_classifier.pt | Classifier-guidance. |
| LDM | LSUN_bedroom | 256 | lsun_bedroom.pt and vq-f4 model | Latent-space |
| Stable Diffusion | MS-COCO | 512 | stable-diffusion-v1-4 | Classifier-free-guidance |
FID Statistics
For facilitating the FID evaluation of diffusion models, we provide our FID statistics of various datasets. They are collected on the Internet or made by ourselves with the guidance of the EDM codebase.
Citation
If you find this repository useful, please consider citing the following paper:
@article{zhou2023fast,
title={Fast ODE-based Sampling for Diffusion Models in Around 5 Steps},
author={Zhou, Zhenyu and Chen, Defang and Wang, Can and Chen, Chun},
journal={arXiv preprint arXiv:2312.00094},
year={2023}
}