SUPIR 的目标是开发用于野外照片真实图像恢复的实用算法。我们的新在线演示也已在 suppixel.ai 上发布。
--- #### We're thrilled to announce the official launch of SupPixel AI! Experience the next level of image processing and upscaling with our cutting-edge AI technology based on SUPIR. Explore now at [suppixel.ai](https://supir.suppixel.ai/home). --- ## Dependencies and Installation 1. Clone repo ```bash git clone https://github.com/Fanghua-Yu/SUPIR.git cd SUPIR ``` 2. Install dependent packages ```bash conda create -n SUPIR python=3.8 -y conda activate SUPIR pip install --upgrade pip pip install -r requirements.txt ``` 3. Download Checkpoints For users who can connect to huggingface, please setting `LLAVA_CLIP_PATH, SDXL_CLIP1_PATH, SDXL_CLIP2_CKPT_PTH` in `CKPT_PTH.py` as `None`. These CLIPs will be downloaded automatically. #### Dependent Models * [SDXL CLIP Encoder-1](https://huggingface.co/openai/clip-vit-large-patch14) * [SDXL CLIP Encoder-2](https://huggingface.co/laion/CLIP-ViT-bigG-14-laion2B-39B-b160k) * [SDXL base 1.0_0.9vae](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0_0.9vae.safetensors) * [LLaVA CLIP](https://huggingface.co/openai/clip-vit-large-patch14-336) * [LLaVA v1.5 13B](https://huggingface.co/liuhaotian/llava-v1.5-13b) * (optional) [Juggernaut-XL_v9_RunDiffusionPhoto_v2](https://huggingface.co/RunDiffusion/Juggernaut-XL-v9/blob/main/Juggernaut-XL_v9_RunDiffusionPhoto_v2.safetensors) * Replacement of `SDXL base 1.0_0.9vae` for Photo Realistic * (optional) [Juggernaut_RunDiffusionPhoto2_Lightning_4Steps](https://huggingface.co/RunDiffusion/Juggernaut-XL-Lightning/blob/main/Juggernaut_RunDiffusionPhoto2_Lightning_4Steps.safetensors) * Distilling model used in `SUPIR_v0_Juggernautv9_lightning.yaml` #### Models we provided: * `SUPIR-v0Q`: [Baidu Netdisk](https://pan.baidu.com/s/1lnefCZhBTeDWijqbj1jIyw?pwd=pjq6), [Google Drive](https://drive.google.com/drive/folders/1yELzm5SvAi9e7kPcO_jPp2XkTs4vK6aR?usp=sharing) Default training settings with paper. High generalization and high image quality in most cases. * `SUPIR-v0F`: [Baidu Netdisk](https://pan.baidu.com/s/1AECN8NjiVuE3hvO8o-Ua6A?pwd=k2uz), [Google Drive](https://drive.google.com/drive/folders/1yELzm5SvAi9e7kPcO_jPp2XkTs4vK6aR?usp=sharing) Training with light degradation settings. Stage1 encoder of `SUPIR-v0F` remains more details when facing light degradations. 4. Edit Custom Path for Checkpoints ``` * [CKPT_PTH.py] --> LLAVA_CLIP_PATH, LLAVA_MODEL_PATH, SDXL_CLIP1_PATH, SDXL_CLIP2_CACHE_DIR * [options/SUPIR_v0.yaml] --> SDXL_CKPT, SUPIR_CKPT_Q, SUPIR_CKPT_F ``` --- ## ⚡ Quick Inference ### Val Dataset RealPhoto60: [Baidu Netdisk](https://pan.baidu.com/s/1CJKsPGtyfs8QEVCQ97voBA?pwd=aocg), [Google Drive](https://drive.google.com/drive/folders/1yELzm5SvAi9e7kPcO_jPp2XkTs4vK6aR?usp=sharing) ### Usage of SUPIR ``` … ``` ### Empirical Hyperparameters Settings * The parameters listed generally have significant impact on the final image quality and appearance. 1. s_stage2 adjustment: Option 0: s_stage2 = 1.0 (higher fidelity, potentially lower visual quality) Option 1: s_stage2 = 0.93 (higher visual quality, potentially lower fidelity) 2. Quality-oriented settings (higher visual quality, potentially lower fidelity): s_cfg = 6.0, spt_linear_CFG = 3.0, s_noise = 1.02 3. Fidelity-oriented settings (closer to original input fidelity, may sacrifice some visual appeal): s_cfg = 4.0, spt_linear_CFG = 1.0, s_noise = 1.01 ### Python Script Examples: ```Shell # Seek for best quality for most cases CUDA_VISIBLE_DEVICES=0,1 python test.py --img_dir '/opt/data/private/LV_Dataset/DiffGLV-Test-All/RealPhoto60/LQ' --save_dir ./results-Q --SUPIR_sign Q --upscale 2 # for light degradation and high fidelity CUDA_VISIBLE_DEVICES=0,1 python test.py --img_dir '/opt/data/private/LV_Dataset/DiffGLV-Test-All/RealPhoto60/LQ' --save_dir ./results-F --SUPIR_sign F --upscale 2 ``` ### Gradio Demo ```Shell CUDA_VISIBLE_DEVICES=0,1 python gradio_demo.py --ip 0.0.0.0 --port 6688 --use_image_slider --log_history # Juggernaut_RunDiffusionPhoto2_Lightning_4Steps and DPM++ M2 SDE Karras for fast sampling CUDA_VISIBLE_DEVICES=0,1 python gradio_demo.py --ip 0.0.0.0 --port 6688 --use_image_slider --log_history --opt options/SUPIR_v0_Juggernautv9_lightning.yaml # less VRAM & slower (12G for Diffusion, 16G for LLaVA) CUDA_VISIBLE_DEVICES=0,1 python gradio_demo.py --ip 0.0.0.0 --port 6688 --use_image_slider --log_history --loading_half_params --use_tile_vae --load_8bit_llava ```
### Online App We've just launched [SupPixel AI](https://supir.suppixel.ai/home), an easy-to-use tool designed to help with high-quality image processing and upscaling. It builds on SUPIR. Whether you’re into photography, digital art, or just love playing around with image enhancement, we’d love for you to check it out.~
--- ## BibTeX @misc{yu2024scaling, title={Scaling Up to Excellence: Practicing Model Scaling for Photo-Realistic Image Restoration In the Wild}, author={Fanghua Yu and Jinjin Gu and Zheyuan Li and Jinfan Hu and Xiangtao Kong and Xintao Wang and Jingwen He and Yu Qiao and Chao Dong}, year={2024}, eprint={2401.13627}, archivePrefix={arXiv}, primaryClass={cs.CV} } --- ## Contact If you have any question, please email `[email protected]` or `[email protected]`. --- ## Non-Commercial Use Only Declaration The SUPIR ("Software") is made available for use, reproduction, and distribution strictly for non-commercial purposes. For the purposes of this declaration, "non-commercial" is defined as not primarily intended for or directed towards commercial advantage or monetary compensation. By using, reproducing, or distributing the Software, you agree to abide by this restriction and not to use the Software for any commercial purposes without obtaining prior written permission from Dr. Jinjin Gu. This declaration does not in any way limit the rights under any open source license that may apply to the Software; it solely adds a condition that the Software shall not be used for commercial purposes. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For inquiries or to obtain permission for commercial use, please contact Dr. Jinjin Gu ([email protected]).
暂无开放 Issues,或尚未同步最近议题。