This repository contains the official PyTorch implementation for the ICLR2026 paper *"Test-Time Iterative Error Correction for Efficient Diffusion Models".
Our code is high based on CacheQuant (CVPR2025). We high appreacite their contribution!
@article{liu2025cachequant,
title={CacheQuant: Comprehensively Accelerated Diffusion Models},
author={Xuewen Liu and Zhikai Li and Qingyi Gu},
journal={arXiv},
year={2025}
}
Create and activate a suitable conda environment named E by using the following command:
cd IEC
conda env create -f environment.yaml
conda activate IECPre-trained models for DDPM are automatically downloaded.
For LDM experiments, download pre-trained models to mainldm/models/ldm following the instructions in the latent-diffusion and stable-diffusion repos.
Please download original datasets used for evaluation from each dataset’s official website.
Here, we proivde an example to apply our IEC to the CacheQuant. Note the IEC has a very simple code as shown in the function 'p_sample_ddim_implicit_2' in './mainldm/ldm/models/diffusion/ddim.py'.
- Obtain DPS and Calibration
python ./mainldm/sample_cachequant_imagenet_cali.py- Get Cached Features
python ./mainldm/sample_cachequant_imagenet_predadd.py- Calculate DEC for Cache
python ./err_add/imagenet/cache_draw.py --error cache- Get Quantized Parameters
python ./mainldm/sample_cachequant_imagenet_params.py- Calculate DEC for Quantization
python ./err_add/imagenet/cache_draw.py --error quant- Acceleration and Sample
python ./mainldm/sample_cachequant_imagenet_quant.py <--recon>The --recon to use reconstruction.
If you find this work useful in your research, please consider citing our paper:
@inproceedings{zhong2025test,
title={Test-Time Iterative Error Correction for Efficient Diffusion Models},
author={Zhong, Yunshan and Qi, Yanwei and Zhang, Yuxin},
booktitle={International Conference on Learning Representations},
year={2026}
}