Zongsheng Yue, Kang Liao, Chen Change Loy
:star: If you've found InvSR useful for your research or projects, please show your support by starring this repo. Thanks! :hugs:
This study presents a new image super-resolution (SR) technique based on diffusion inversion, aiming at harnessing the rich image priors encapsulated in large pre-trained diffusion models to improve SR performance. We design a \textit{Partial noise Prediction} strategy to construct an intermediate state of the diffusion model, which serves as the starting sampling point. Central to our approach is a deep noise predictor to estimate the optimal noise maps for the forward diffusion process. Once trained, this noise predictor can be used to initialize the sampling process partially along the diffusion trajectory, generating the desirable high-resolution result. Compared to existing approaches, our method offers a flexible and efficient sampling mechanism that supports an arbitrary number of sampling steps, ranging from one to five. Even with a single sampling step, our method demonstrates superior or comparable performance to recent state-of-the-art approaches.
invsr can be created and activated with:conda create -n invsr python=3.10
conda activate invsr
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
pip install -U xformers==0.0.27.post2 --index-url https://download.pytorch.org/whl/cu121
pip install -e ".[torch]"
pip install -r requirements.txt
python inference_invsr.py -i [image folder/image path] -o [result folder] --num_steps 1
--chopping_size 256.--sd_path.--started_ckpt_path.--num_steps.--chopping_bs 1.You can try our method through an online demo:
python app.py
docker compose up -d # Go to http://127.0.0.1:7860/
Synthetic dataset of ImageNet-Test: Google Drive.
To reproduce the quantitative results on Imagenet-Test and RealSRV3, please add the color fixing options by --color_fix wavelet.
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nproc_per_node=4 --nnodes=1 main.py --save_dir [Logging Folder]
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nproc_per_node=4 --nnodes=1 main.py --save_dir [Logging Folder] --resume save_dir/ckpts/model_xx.pth
This project is licensed under NTU S-Lab License 1.0. Redistribution and use should follow this license.
This project is based on BasicSR and diffusers. Thanks for their awesome works.
If you have any questions, please feel free to contact me via zsyzam@gmail.com.
Python
100.0%
Zongsheng Yue, Kang Liao, Chen Change Loy
:star: If you've found InvSR useful for your research or projects, please show your support by starring this repo. Thanks! :hugs:
This study presents a new image super-resolution (SR) technique based on diffusion inversion, aiming at harnessing the rich image priors encapsulated in large pre-trained diffusion models to improve SR performance. We design a \textit{Partial noise Prediction} strategy to construct an intermediate state of the diffusion model, which serves as the starting sampling point. Central to our approach is a deep noise predictor to estimate the optimal noise maps for the forward diffusion process. Once trained, this noise predictor can be used to initialize the sampling process partially along the diffusion trajectory, generating the desirable high-resolution result. Compared to existing approaches, our method offers a flexible and efficient sampling mechanism that supports an arbitrary number of sampling steps, ranging from one to five. Even with a single sampling step, our method demonstrates superior or comparable performance to recent state-of-the-art approaches.
invsr can be created and activated with:conda create -n invsr python=3.10
conda activate invsr
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
pip install -U xformers==0.0.27.post2 --index-url https://download.pytorch.org/whl/cu121
pip install -e ".[torch]"
pip install -r requirements.txt
python inference_invsr.py -i [image folder/image path] -o [result folder] --num_steps 1
--chopping_size 256.--sd_path.--started_ckpt_path.--num_steps.--chopping_bs 1.You can try our method through an online demo:
python app.py
docker compose up -d # Go to http://127.0.0.1:7860/
Synthetic dataset of ImageNet-Test: Google Drive.
To reproduce the quantitative results on Imagenet-Test and RealSRV3, please add the color fixing options by --color_fix wavelet.
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nproc_per_node=4 --nnodes=1 main.py --save_dir [Logging Folder]
CUDA_VISIBLE_DEVICES=0,1,2,3 torchrun --standalone --nproc_per_node=4 --nnodes=1 main.py --save_dir [Logging Folder] --resume save_dir/ckpts/model_xx.pth
This project is licensed under NTU S-Lab License 1.0. Redistribution and use should follow this license.
This project is based on BasicSR and diffusers. Thanks for their awesome works.
If you have any questions, please feel free to contact me via zsyzam@gmail.com.
Python
100.0%