CoD
Collection
Collection of Compression-oriented Diffusion Models and its Applications • 2 items • Updated
CoD-Lite is a real-time, lightweight diffusion-based image codec. Unlike prior diffusion codecs that rely on billion-parameter foundation models and multi-step sampling, CoD-Lite achieves competitive perceptual quality with a compact architecture (28M encoder + 52M decoder) and one-step decoding, enabling 60 FPS encoding and 42 FPS decoding at 1080p on a single A100 GPU.
For real-time performance:
For maintaining compression quality:
| Model | Checkpoint |
|---|---|
| CoD-Lite (pre-trained) | CoD_Lite_pretrain.pt |
| BPP | Downsampling | Codebook Bits | Config | Checkpoint |
|---|---|---|---|---|
| 0.0039 | 32x | 4 | CoD_Lite_bpp_0_0039.yaml |
CoD_Lite_bpp_0_0039.pt |
| 0.0078 | 32x | 8 | CoD_Lite_bpp_0_0078.yaml |
CoD_Lite_bpp_0_0078.pt |
| 0.0156 | 16x | 4 | CoD_Lite_bpp_0_0156.yaml |
CoD_Lite_bpp_0_0156.pt |
| 0.0312 | 16x | 8 | CoD_Lite_bpp_0_0312.yaml |
CoD_Lite_bpp_0_0312.pt |
| 0.1250 | 8x | 8 | CoD_Lite_bpp_0_1250.yaml |
CoD_Lite_bpp_0_1250.pt |
| 0.5000 | 4x | 8 | CoD_Lite_bpp_0_5000.yaml |
CoD_Lite_bpp_0_5000.pt |
All runtimes measured at 0.0312 bpp.
| Device | 720x480 (Enc/Dec) | 1920x1024 (Enc/Dec) | 3840x2160 (Enc/Dec) |
|---|---|---|---|
| NVIDIA A100 GPU | 6 / 13 ms | 16 / 24 ms | 63 / 75 ms |
| NVIDIA RTX 2080Ti GPU | 9 / 21 ms | 46 / 47 ms | 200 / 208 ms |
| AMD EPYC 9V84 CPU | 58 / 65 ms | 287 / 202 ms | 1343 / 837 ms |
git clone https://github.com/microsoft/GenCodec.git
cd GenCodec/CoD_Lite
conda create -n cod_lite python=3.12
conda activate cod_lite
pip install -r requirements.txt
# Download all CoD-Lite models
huggingface-cli download zhaoyangjia/CoD_Lite --local-dir ./pretrained/CoD_Lite
# Download a specific bitrate model
huggingface-cli download zhaoyangjia/CoD_Lite CoD_Lite_bpp_0_0312.pt CoD_Lite_bpp_0_0312.yaml --local-dir ./pretrained/CoD_Lite
Encode images into .cod bitstreams:
python -m finetuned_one_step_codec.inference compress \
--ckpt ./pretrained/CoD_Lite/CoD_Lite_bpp_0_0312.pt \
--config ./pretrained/CoD_Lite/CoD_Lite_bpp_0_0312.yaml \
--input <image_dir> --output <bitstream_dir>
Decode .cod bitstreams back to images:
python -m finetuned_one_step_codec.inference decompress \
--ckpt ./pretrained/CoD_Lite/CoD_Lite_bpp_0_0312.pt \
--config ./pretrained/CoD_Lite/CoD_Lite_bpp_0_0312.yaml \
--input <bitstream_dir> --output <recon_dir>
Compress and decompress in a single pass:
python -m finetuned_one_step_codec.inference evaluate \
--ckpt ./pretrained/CoD_Lite/CoD_Lite_bpp_0_0312.pt \
--config ./pretrained/CoD_Lite/CoD_Lite_bpp_0_0312.yaml \
--input <image_dir> --output <recon_dir>
@article{jia2026codlite,
title = {Real-Time Diffusion-Based Generative Image Compression},
author = {Jia, Zhaoyang and Xue, Naifu and Zheng, Zihan and Li, Jiahao and Li, Bin and Zhang, Xiaoyi and Guo, Zongyu and Zhang, Yuan and Li, Houqiang and Lu, Yan},
journal = {arXiv preprint arXiv:2604.12525},
year = {2026}
}
MIT