https://github.com/EternalEvan/InstaRevive
This is the official implementation of InstaRevive: One-Step Image Enhancement via Dynamic Score Matching
https://github.com/EternalEvan/InstaRevive
Last synced: about 2 months ago
JSON representation
This is the official implementation of InstaRevive: One-Step Image Enhancement via Dynamic Score Matching
- Host: GitHub
- URL: https://github.com/EternalEvan/InstaRevive
- Owner: EternalEvan
- License: mit
- Created: 2025-02-27T13:21:37.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-04-21T09:15:18.000Z (2 months ago)
- Last Synced: 2025-04-21T10:26:04.379Z (2 months ago)
- Language: Python
- Size: 1.87 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-diffusion-categorized - [Code
README
# InstaRevive: One-Step Image Enhancement via Dynamic Score Matching (ICLR 2025)
> [Yixuan Zhu](https://eternalevan.github.io/)\* $\dagger$, [Haolin Wang](https://howlin-wang.github.io/)\* , [Ao Li](https://rammusleo.github.io/), [Wenliang Zhao](https://wl-zhao.github.io/)\*, [Yansong Tang](https://andytang15.github.io/), Jingxuan Niu, [Lei Chen](https://andytang15.github.io/) $\ddagger$, [Jie Zhou](https://scholar.google.com/citations?user=6a79aPwAAAAJ&hl=en&authuser=1), [Jiwen Lu](http://ivg.au.tsinghua.edu.cn/Jiwen_Lu/)
>
> \* Equal contribution Β $\dagger$ Project leader Β $\ddagger$ Corresponding author[**[Paper]**](https://openreview.net/pdf?id=G1CN7R5qwE)
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.
## π To-Do List
* [x] Release model and inference code.
* [x] Release code for training dataloader.## π‘ Pipeline

## πQuick Start
### βοΈ 1. InstallationWe recommend you to use an [Anaconda](https://www.anaconda.com/) virtual environment. If you have installed Anaconda, run the following commands to create and activate a virtual environment.
``` bash
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 nvidiagit clone https://github.com/EternalEvan/InstaRevive.git
cd InstaRevive
pip install -r requirements.txt
```### ποΈ 2. Download Checkpoints
Please download our pretrained checkpoints from [this link](https://cloud.tsinghua.edu.cn/d/ae6cf15eb5984d3db933/) and put them under `./weights`. The file directory should be:
```
|-- checkpoints
|--|-- InstaRevive_v1.ckpt
...
```### π 4. Test & Evaluation
You can test InstaRevive with following commands:
```bash
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:
```bash
python inference.py --ckpt ./weights/InstaRevive_v1.pth --input ./assets/inputs/ --output ./outputs/bsr_exp --tiled --sr_scale 1
```
You 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.
## π«° Acknowledgments
We would like to express our sincere thanks to the author of [DiffBIR](https://github.com/XPixelGroup/DiffBIR) for the clear code base and quick response to our issues.
We also thank [PixArt](https://github.com/PixArt-alpha/PixArt-sigma), [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) and [LoRA](https://github.com/cloneofsimo/lora), for our code is partially borrowing from them.
## π Citation
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}
}
```
## π LicenseThis code is distributed under an [MIT LICENSE](./LICENSE).