Yixuan Zhu*
$\dagger$ , Haolin Wang* , Ao Li, Wenliang Zhao*, Yansong Tang, Jingxuan Niu, Lei Chen$\ddagger$ , Jie Zhou, Jiwen Lu* Equal contribution
$\dagger$ Project leader$\ddagger$ Corresponding author
The repository contains the official implementation for the paper "InstaRevive: One-Step Image Enhancement via Dynamic Score Matching" (ICLR 2025).
We propose InstaRevive, a straightforward yet powerful image enhancement framework that employs score-based diffusion distillation to harness potent generative capability and minimize the sampling steps.
- Release model and inference code.
- Release code for training dataloader.
We recommend you to use an Anaconda virtual environment. If you have installed Anaconda, run the following commands to create and activate a virtual environment.
conda create -n instarevive python==3.9.0
conda activate instarevive
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia
git clone https://github.com/EternalEvan/InstaRevive.git
cd InstaRevive
pip install -r requirements.txtPlease download our pretrained checkpoints from this link and put them under ./weights. The file directory should be:
|-- checkpoints
|--|-- InstaRevive_v1.ckpt
...
You can test InstaRevive with following commands:
python inference.py --ckpt ./weights/InstaRevive_v1.ckpt --input /data/testdata/ --output ./outputs/bsr_exp --sr_scale 4- Quick Test
For a quick test, we collect some test samples in ./assets. You can run the demo for real-world ISR:
python inference.py --ckpt ./weights/InstaRevive_v1.pth --input ./assets/inputs/ --output ./outputs/bsr_exp --tiled --sr_scale 1You can use --tiled for patch-based inference and use --sr_scale tp set the super-resolution scale, like 2 or 4. You can set CUDA_VISIBLE_DEVICES=1 to choose the devices.
The evaluation process can be done with one Nvidia GeForce RTX 3090 GPU (24GB VRAM). You can use more GPUs by specifying the GPU ids.
We would like to express our sincere thanks to the author of DiffBIR for the clear code base and quick response to our issues.
We also thank PixArt, Real-ESRGAN and LoRA, for our code is partially borrowing from them.
Please cite us if our work is useful for your research.
@misc{zhu2025instarevive,
title={InstaRevive: One-Step Image Enhancement via Dynamic Score Matching},
author={Yixuan Zhu, Haolin Wang, Ao Li, Wenliang Zhao, Yansong Tang, Jingxuan Niu, Lei Chen, Jie Zhou, Jiwen Lu},
year={2025},
eprint={2504.00508},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
This code is distributed under an MIT LICENSE.
