Compressed Image Generation with Denoising Diffusion Codebook Models

Guy Ohayon, Hila Manor, Tomer Michaeli, Michael Elad

Introduction

Standard Denoising Diffusion Models (DDMs) have revolutionized image synthesis by iteratively refining Gaussian noise into high-fidelity images. However, from an information-theoretic perspective, sampling from an infinite, continuous Gaussian distribution at every step is highly redundant. If a model uses 1,000 sampling steps and chooses between just two fixed noise realizations at each step, it could theoretically produce $2^{1000}$ unique images—a number far exceeding the atoms in the observable universe.

Denoising Diffusion Codebook Models (DDCM) address this redundancy by replacing continuous noise with a fixed, finite "codebook" of noise vectors. This discretization allows any pre-trained diffusion model to be repurposed as a state-of-the-art perceptual image codec, enabling high-quality image generation and restoration directly from a compact stream of discrete indices.

The DDCM Framework

The core innovation of DDCM is the discretization of the noise space used during the diffusion process. Instead of drawing fresh noise $z_i \sim \mathcal{N}(0, I)$ at each timestep $i$, the model utilizes a pre-defined, fixed codebook $C_i$ containing $K$ Gaussian noise vectors.

The DDCM pipeline: Selection rules guide the choice of indices from a fixed codebook to perform either image generation or compression.

Sampling and Compression

To generate an image, the model selects an index $k_i$ from the codebook at each step. The resulting sequence of indices $(k_T, \dots, k_1)$ serves as a compact "bit-stream" representation of the image.

To compress an existing image $x_0$, the authors employ a greedy selection strategy. At each diffusion step, the algorithm chooses the codebook index $k_i$ that maximizes the inner product with the current residual error (the difference between the target image and the model's current prediction). For higher bitrates, "Matching Pursuit" is used to select a convex combination of $M$ codebook elements, providing finer control over the rate-distortion tradeoff.

A significant advantage of DDCM is its zero-shot versatility. Because it only modifies the sampling process, it can be applied to any pre-trained diffusion model (e.g., Stable Diffusion, DDPM) without requiring additional training or fine-tuning.

Key Results and Applications

The researchers evaluated DDCM across diverse benchmarks, including ImageNet, MS-COCO, and standard compression datasets like Kodak and CLIC2020.

DDCM demonstrates high-fidelity performance across image compression, text-to-image generation, and restoration tasks at high compression ratios.

Generative Performance and Compression

On ImageNet (256x256), DDCM with a small codebook ($K=64$) achieved FID scores nearly identical to standard DDPMs using infinite noise. This suggests that the continuous noise space is indeed highly redundant for natural image manifolds.

In compression tasks, DDCM achieves state-of-the-art perceptual performance. At low bitrates (approx. 0.1 bpp), it produces images with superior visual quality—measured by lower FID and LPIPS—compared to traditional codecs like BPG and recent neural methods.

Image Restoration

DDCM excels in "zero-shot" restoration tasks such as 4x super-resolution, colorization, and face restoration. By searching the discrete codebook for indices that optimize specific quality metrics (like NIQE), the model can restore highly degraded images while simultaneously providing a compressed representation of the output. On the WIDER-Test dataset, DDCM outperformed specialized face restoration models like PMRF in terms of no-reference quality scores.

Insights and Future Directions

DDCM reveals that discrete indices can function as a "language" for images, potentially allowing Transformers to predict these tokens for complex generative tasks. Furthermore, the discrete nature of the codebook enables gradient-free guidance, allowing optimization for non-differentiable image quality metrics.

Future work may address current bottlenecks, such as the reconstruction limits imposed by underlying VAEs in latent diffusion models. Improving the "greedy" search with global optimization strategies and applying entropy coding to the index stream could further enhance compression efficiency. Additionally, moving from fixed Gaussian codebooks to "learned" codebooks via dictionary learning presents a promising path for even more efficient image representations.

Summary updated

BibTeX
@inproceedings{ohayon2025compressed,
  author = {Guy Ohayon and Hila Manor and Tomer Michaeli and Michael Elad},
  title = {{Compressed Image Generation with Denoising Diffusion Codebook Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=cQHwUckohW},
}
Figure