Papers › Q-Diffusion: Quantizing Diffusion Models

Q-Diffusion: Quantizing Diffusion Models

8 Feb 2023ICCV 2023 1arXiv:2302.04304archive 2025-07-28

Xiuyu Li, Yijiang Liu, Long Lian, Huanrui Yang, Zhen Dong, Daniel Kang, Shanghang Zhang, Kurt Keutzer

Diffusion models have achieved great success in image synthesis through iterative noise estimation using deep neural networks. However, the slow inference, high memory consumption, and computation intensity of the noise estimation model hinder the efficient adoption of diffusion models. Although post-training quantization (PTQ) is considered a go-to compression method for other tasks, it does not work out-of-the-box on diffusion models. We propose a novel PTQ method specifically tailored towards the unique multi-timestep pipeline and model architecture of the diffusion models, which compresses the noise estimation network to accelerate the generation process. We identify the key difficulty of diffusion model quantization as the changing output distributions of noise estimation networks over multiple time steps and the bimodal activation distribution of the shortcut layers within the noise estimation network. We tackle these challenges with timestep-aware calibration and split shortcut quantization in this work. Experimental results show that our proposed method is able to quantize full-precision unconditional diffusion models into 4-bit while maintaining comparable performance (small FID change of at most 2.34 compared to >100 for traditional PTQ) in a training-free manner. Our approach can also be applied to text-guided image generation, where we can run stable diffusion in 4-bit weights with high generation quality for the first time.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2302.04304")

Code

Syntology Ran 2 of 13 code samples harvested from 1 repository linked to this paper; 11 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran with no contract checked.

By repository: official repository: 13 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Xiuyu-Li/q-diffusion officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

13 samples harvested; 2 ran; 0 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
1ran
11unverified

Licence: 0 of the 13 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from Xiuyu-Li/q-diffusion. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

UniformAffineQuantizer Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository ran fingerprinted MIT (permissive) · b1f777eef42a5751 · report
cross_attn_forward Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository ran · our draft was wrong MIT (permissive) · 636ef4c5379e7a36 · report
BaseQuantBlock Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · dad79c1a08cbe8d8 · report
QuantAttentionBlock Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · d406d4870faffc99 · report
QuantAttnBlock Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · e991182a9dc84857 · report
QuantBasicTransformerBlock Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · b9cdfa2e3669f486 · report
QuantModel Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · 3c9100bc42b81ec4 · report
QuantModule Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · aef5c9cd9fed32b2 · report
QuantQKMatMul Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · 6b043f103278e7f6 · report
QuantResBlock Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · b62b76ac8c39127e · report
QuantResnetBlock Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · 377acce7bef4d383 · report
QuantSMVMatMul Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · e7511e8abc27d090 · report
get_specials Xiuyu-Li/q-diffusion/qdiff/quant_model.py official repository unverified MIT (permissive) · 79c9744c0f2f7be1 · report

Tasks

Image GenerationNoise EstimationQuantization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

DiffusionSPEED

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections