Alokia / diffusion-DDIM-pytorch

This is a pytorch implementation of Denoising Diffusion Implicit Models
59 stars 9 forks source link
ddim deep-learning diffusion-models image-generation

Denoising Diffusion Implicit Models

This is a pytorch implementation of DDIM. The original paper is here https://arxiv.org/abs/2010.02502 .

This code is almost identical to DDPM, see here: https://github.com/Alokia/diffusion-DDPM-pytorch

how to use

Almost all the parameters that can be modified are listed in the config.yml file. You can modify the relevant parameters as needed, and then run the train.py file to start training.

After training, run the generate.py file to generate the results. These are the parameters of generate.py :

Some generated images

python generate.py -cp "checkpoint/mnist.pth" -bs 16 --interval 3 --show -sp
"data/result/mnist_sampler.png" --sampler "ddim" --steps 50

python generate.py -cp "checkpoint/mnist.pth" -bs 256 --show -sp "data/result/mnist_result.png" --nrow 16 --result_only --sampler "ddim" --steps 50

python generate.py -cp "checkpoint/cifar10.pth" -bs 16 --interval 10 --show -sp "data/result/cifar10_sampler.png" --sampler "ddim" --steps 200 --method "quadratic"

python generate.py -cp "checkpoint/cifar10.pth" -bs 256 --show -sp "data/result/cifar10_result.png" --nrow 16 --result_only --sampler "ddim" --steps 200 --method "quadratic"