This implementation supports the paper "Towards Accurate Binarization of Diffusion Model". [PDF]
Establish a virtual environment and install dependencies as referred to latent-diffusion.
- Replace the existing
main.py
in the LDM with our version ofmain.py
. - Place
openaimodel_ours.py
andours_util.py
in the directory./ldm/modules/diffusionmodules
. - Place
ddpm_ours.py
in the directory./ldm/models/diffusion
- run
bash train.sh
- Results under 4-bit activation quantization on LSUN-Bedrooms.
- Results for LDM-4 on LSUN-Bedrooms in unconditional generation by DDIM with 100 steps.
- Samples generated by the binarized DM baseline and BinaryDM under W1A4 bit-width.
- Our codebase builds on latent-diffusion and stable-diffusion. Thanks for open-sourcing!
If you find BinaryDM is useful and helpful to your work, please kindly cite this paper:
@misc{zheng2024accurate,
title={Towards Accurate Binarization of Diffusion Model},
author={Xingyu Zheng and Haotong Qin and Xudong Ma and Mingyuan Zhang and Haojie Hao and Jiakai Wang and Zixiang Zhao and Jinyang Guo and Xianglong Liu},
year={2024},
eprint={2404.05662},
archivePrefix={arXiv},
primaryClass={cs.CV}
}