Skip to content

jp-guo/OSCAR

Repository files navigation

OSCAR: One-Step Diffusion Codec Across Multiple Bit-rates

Jinpei Guo, Yifei Ji, Zheng Chen, Kai Liu, Min Liu, Wang Rao, Wenbo Li, Yong Guo, and Yulun Zhang, "OSCAR: One-Step Diffusion Codec Across Multiple Bit-rates", NeurIPS, 2025

[paper] [supplementary material]

🔥🔥🔥 News

  • 2025-05-20: This repo is released.

Setup

Environment

conda env create -f environment.yml
conda activate oscar

Models

Please download the following models and place them in the model_zoo directory.

  1. SD-2.1
  2. OSCAR

Abstract: Pretrained latent diffusion models have shown strong potential for lossy image compression, owing to their powerful generative priors. Most existing diffusion-based methods reconstruct images by iteratively denoising from random noise, guided by compressed latent representations. While these approaches have achieved high reconstruction quality, their multi-step sampling process incurs substantial computational overhead. Moreover, they typically require training separate models for different compression bit-rates, leading to significant training and storage costs. To address these challenges, we propose a one-step diffusion codec across multiple bit-rates. termed OSCAR. Specifically, our method views compressed latents as noisy variants of the original latents, where the level of distortion depends on the bit-rate. This perspective allows them to be modeled as intermediate states along a diffusion trajectory. By establishing a mapping from the compression bit-rate to a pseudo diffusion timestep, we condition a single generative model to support reconstructions at multiple bit-rates. Meanwhile, we argue that the compressed latents retain rich structural information, thereby making one-step denoising feasible. Thus, OSCAR replaces iterative sampling with a single denoising pass, significantly improving inference efficiency. Extensive experiments demonstrate that OSCAR achieves superior performance in both quantitative and visual quality metrics.


Training

Training consists of two stages. In the first stage, we train hyper-encoders. In the second stage, we fine-tune both hyper-encoders and OSCAR's UNet with LoRA.

First Stage

Update the training configuration file and training script with appropriate values. You should select one bpp value from the predefined list in rate_config.py. Once the configuration is updated, run the training command as follows:

bash train_hyper_enc.sh

Second Stage

Update the configuration file and training script with appropriate values, specify the hyper-encoder checkpoint from the first stage, and launch training:

bash train.sh

Testing

Specify the paths to the OSCAR checkpoints, as well as the dataset directory in test.sh, then run:

bash test.sh

Results

 Quantitative Comparisons (click to expand)

 Visual Comparisons (click to expand)

Citation

If you find the code helpful in your research or work, please cite our work.

@article{guo2025oscar,
    title={OSCAR: One-Step Diffusion Codec Across Multiple Bit-rates},
    author={Guo, Jinpei and Ji, Yifei and Chen, Zheng and Liu, Kai and Liu, Min and Rao, Wang and Li, Wenbo and Guo, Yong and Zhang, Yulun},
    journal={arXiv preprint arXiv:2505.16091},
    year={2025}
}

Acknowledgements

This code is built on PerCo and CODiff.

About

[NeurIPS'25] OSCAR: One-Step Diffusion Codec Across Multiple Bit-rates

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •