This is the official pytorch implementation for the paper: Towards Accurate Post-training Quantization for Diffusion Models. (CVPR24 Poster Highlight)
- python>=3.8
- pytorch>=1.12.1
- torchvision>=0.13.0
- other packages like numpy, tqdm and math
You can get full-precision pretrained models from DDIM and DDPM.
The following experiments were performed in GeForce RTX 3090 with 24GB memory.
You can run the following command to generate 50000 CIFAR-10 32*32 images in low bitwidths with differentiable group-wise quantization and active timestep selection.
sh sample_cifar.sh
After generation, you can run the following command to evaluate IS and FID.
python -m pytorch_fid <dataset path> <image path>
We thank the authors of following works for opening source their excellent codes.