TFMQ-DM: Temporal Feature Maintenance Quantization for Diffusion Models

Yushi Huang, Ruihao Gong, Jing Liu, Tianlong Chen, Xianglong Liu
11/1/2023
99 citations
diffusion-flowquantization-pruning

Official code: ModelTC/TFMQ-DM (112 stars, Jupyter Notebook, Apache-2.0, last commit 2025-09-29).

Abstract

The Diffusion model, a prevalent framework for image generation, encounters significant challenges in terms of broad applicability due to its extended inference times and substantial memory requirements. Efficient Post-training Quantization (PTQ) is pivotal for addressing these issues in traditional models.

Show full abstract

Different from traditional models, diffusion models heavily depend on the time-step t to achieve satisfactory multi-round denoising. Usually, t from the finite set {1, …, T} is encoded to a temporal feature by a few modules totally irrespective of the sampling data. However, existing PTQ methods do not optimize these modules separately. They adopt inappropriate reconstruction targets and complex calibration methods, resulting in a severe disturbance of the temporal feature and denoising trajectory, as well as a low compression efficiency. To solve these, we propose a Temporal Feature Maintenance Quantization (TFMQ) framework building upon a Temporal Information Block which is just related to the time-step t and unrelated to the sampling data. Powered by the pioneering block design, we devise temporal information aware reconstruction (TIAR) and finite set calibration (FSC) to align the full-precision temporal features in a limited time. Equipped with the framework, we can maintain the most temporal information and ensure the end-to-end generation quality. Extensive experiments on various datasets and diffusion models prove our state-of-the-art results. Remarkably, our quantization approach, for the first time, achieves model performance nearly on par with the full-precision model under 4-bit weight quantization. Additionally, our method incurs almost no extra computational cost and accelerates quan-tization time by 2.0× on LSUN-Bedrooms 256 × 256 compared to previous works. Our code is publicly available at https://github.com/ModelTC/TFMQ-DM.

View on arXivView PDF

Code Implementations(1)

ModelTC/TFMQ-DMOfficial100%
Apache-2.0

[CVPR 2024 Highlight & TPAMI 2025] This is the official PyTorch implementation of "TFMQ-DM: Temporal Feature Maintenance Quantization for Diffusion Models".

1125Jupyter Notebook, PythonMar 9, 20241 years agoApache-2.0
cvprcvpr2024ddimdiffusion-modelshighlight+6 more

Similar Papers

Cite this paper

@article{huang2023tfmqdm,
  title  = {TFMQ-DM: Temporal Feature Maintenance Quantization for Diffusion Models},
  author = {Yushi Huang and Ruihao Gong and Jing Liu and Tianlong Chen and Xianglong Liu},
  year   = {2023},
  eprint = {2311.16503},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2311.16503},
  journal = {CVPR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.16503.svg)](https://codeofpaper.com/paper/2311.16503)

Discussion