SUPIR Full Tutorial + 1 Click 12GB VRAM Windows & RunPod / Linux Installer + Batch Upscale + Comparison With Magnific
Tags: beginners, programming, tutorial, ai
Published: 2024-02-28 02:48:38

<p>I have dedicated several days, working over 12 hours each day, on SUPIR (Scaling-UP Image Restoration), a cutting-edge image enhancement and upscaling model introduced in the paper&nbsp;<a href="https://arxiv.org/abs/2401.13627" >Scaling Up to Excellence: Practicing Model Scaling for Photo-Realistic Image Restoration In the Wild</a>.</p>

<p><strong>This model is simply mind-blowing. At the bottom of this post, you will see side-by-side comparisons of SUPIR versus the extremely expensive online service, Magnific AI. Magnific is known to be the best among the community. However, SUPIR is by far superior. SUPIR also significantly outperforms Topaz AI upscale. SUPIR manages to remain faithful to the original image almost 100% while adding details and achieving super upscaling with the best realism.</strong></p>

<p>I made a full 33-minute tutorial, fully chaptered with manually written captions. The chapter&#39;s info is posted at the very bottom.</p>

<p>You can watch the video here: <a href="https://youtu.be/PqREA6-bC3w" >https://youtu.be/PqREA6-bC3w</a>   </p> 

{% embed https://youtu.be/PqREA6-bC3w %}

<p><a href="https://youtu.be/PqREA6-bC3w" ><strong>SUPIR: New SOTA Open Source Image Upscaler &amp; Enhancer Model Better Than Magnific &amp; Topaz AI Tutorial</strong></a></p>

<p><a href="https://youtu.be/PqREA6-bC3w" ><img alt="image" src="https://cdn-uploads.huggingface.co/production/uploads/6345bd89fe134dfd7a0dba40/QqzGQeKmOw7-aO7Ippqp2.png" /></a></p>

<p>You can join our 6500+ member Discord for any help &amp; discussion:&nbsp;<a href="https://discord.com/servers/software-engineering-courses-secourses-772774097734074388" >https://discord.com/servers/software-engineering-courses-secourses-772774097734074388</a></p>

<p>Original repo of SUPIR:&nbsp;<a href="https://github.com/Fanghua-Yu/SUPIR" >https://github.com/Fanghua-Yu/SUPIR</a></p>

<p>I have worked hard to make a&nbsp;<a href="https://www.patreon.com/posts/supir-1-click-99176057" >1-click installer</a>&nbsp;for Windows &amp; RunPod. RunPod uses Linux, thus if you are a Linux user you can use RunPod files to install locally on Linux as well with a 1-click install.</p>

<p>Full instructions are shared in this post along with the scripts:&nbsp;<a href="https://www.patreon.com/posts/supir-1-click-99176057" >https://www.patreon.com/posts/supir-1-click-99176057</a></p>

<p>Here are the installer files:</p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/584d06a0-aa93-4f4e-9a7b-58ef4aae1a34" ><img alt="image" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/584d06a0-aa93-4f4e-9a7b-58ef4aae1a34" /></a></p>

<p>The installer works with Python 3.10.11. It generates a new pip venv and installs everything there. So you don&#39;t need Conda. Since it will generate its own VENV, it will not affect any other installations on your system.</p>

<p>The installer installs xFormers and Triton (we are using a pre-compiled wheel) and Pytorch 2.2.0 automatically for you on Windows and Linux.</p>

<p>The Gradio app launching interface is shown below:</p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/89b9cb7b-aeb6-4910-8263-cab2a490424d" ><img alt="image" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/89b9cb7b-aeb6-4910-8263-cab2a490424d" /></a></p>

<p>Currently, with the newest optimizations, the SUPIR app works great on RTX 3060 without LLaVA. I have tested it on my 12 GB single RTX 3060 GPU. So if you have a GPU that has 12GB or more VRAM, you can use it.</p>

<p>The installer downloads all models automatically as well. Also, I changed the base SDXL model with Juggernaut XL - V9 since it works better.</p>

<p>You can simply use any SDXL model. Instructions are on the Patreon post.</p>

<p>I also greatly improved the base Gradio APP. I made the interface more usable.</p>

<p>I added the number of images and randomized seed features. I made the image upscale scaler 0.1 precision.</p>

<p>Moreover, I have added a batch upscale feature as well.</p>

<p>You can see the improved advanced Gradio app interface below.</p>

<p>All the images the app generates will be automatically saved under the outputs folder. You can define the batch image processing outputs folder as well.</p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/0296bc4e-0329-42c6-a00f-6e95973796ab" ><img alt="image" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/0296bc4e-0329-42c6-a00f-6e95973796ab" /></a></p>

<p>Here is the content of the Patreon post:</p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/e932a5ed-1c4d-4619-ba9a-3bccfd524593" ><img alt="image" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/e932a5ed-1c4d-4619-ba9a-3bccfd524593" /></a></p>

<p>The chapters of the tutorial are as follows:</p>

<ul>
	<li>0:00 Introduction to SUPIR (Scaling-UP Image Restoration) full tutorial</li>
	<li>2:10 How to download and install SUPIR on Windows or RunPod (thus Linux)</li>
	<li>3:19 How to setup a community Pod on RunPod&#39;s newest interface</li>
	<li>4:33 How to install and start SUPIR on RunPod</li>
	<li>7:10 How to use Proxy connect of RunPod</li>
	<li>8:13 How to install and start our own quantization supporting LLaVA</li>
	<li>9:22 Getting image description from our own LLaVA model</li>
	<li>9:42 How to use SUPIR interface and testing camel image (test image 1) on SUPIR in details</li>
	<li>12:07 Testing a very old family photo enhancement and upscaling with SUPIR (test image 2)</li>
	<li>14:34 Where the generated images are saved</li>
	<li>14:53 Testing the image of Arnold Schwarzenegger as a warrior (test image 3) on SUPIR in details</li>
	<li>16:22 The effect of simple prompt vs detailed prompt</li>
	<li>17:30 Testing a dragon statue enhancement and upscaling with SUPIR (test image 4)</li>
	<li>17:42 How I used ChatGPT Plus / GPT-4 for image captioning</li>
	<li>18:29 The model works with literally every resolution and example very big upscale</li>
	<li>19:00 Testing image of a dinosaur in jurassic park image enhancement and upscaling with SUPIR (test image 5)</li>
	<li>19:41 From 500px to 3000px upscale results and how to do very big upscale properly</li>
	<li>22:39 GPU utilization of the SUPIR scripts</li>
	<li>23:15 If you get out of VRAM error what can you do and how you can solve</li>
	<li>25:22 Testing a MonsterMMORPG Game character (anime like drawing) upscaling and image enhancing (test image 6)</li>
	<li>25:39 What to do if your image has transparent pixels to be able to upscale</li>
	<li>27:35 Testing a black and white colored movie screenshot of a man image enhancement and upscaling with SUPIR (test image 7)</li>
	<li>28:29 Testing a screenshot from the movie Predator enhancement and upscaling with SUPIR (test image 8)</li>
	<li>29:12 The queue ability of the Gradio app of SUPIR</li>
	<li>29:49 Testing an old photo of Muhammad Ali in a boxing stance image enhancement and upscaling with SUPIR (test image 9)</li>
	<li>30:45 Testing a black and white colored movie screenshot of Charlie Chaplin image enhancement and upscaling with SUPIR (test image 10)</li>
</ul>

<h2>SUPIR vs MAGNIFIC AI</h2>

<h3>Carefully look at the how much SUPIR can be loyal to the original image vs Magnific can be loyal to original image</h3>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/d63157c1-dfdd-49f5-bae4-ac3c07be3118" ><img alt="base_ali" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/d63157c1-dfdd-49f5-bae4-ac3c07be3118" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/091fa260-e85e-4951-8cce-2395e32b7f93" ><img alt="magnific_ali" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/091fa260-e85e-4951-8cce-2395e32b7f93" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/00b1056a-03cc-4b3c-9465-417c7a3cc894" ><img alt="supir_ali" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/00b1056a-03cc-4b3c-9465-417c7a3cc894" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/875035b0-8f1e-4b79-8372-b2afe897a747" ><img alt="base_dino" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/875035b0-8f1e-4b79-8372-b2afe897a747" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/852866ea-3dad-442c-893b-d10f4052740f" ><img alt="dino_magnific" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/852866ea-3dad-442c-893b-d10f4052740f" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/323bc182-e8f4-4013-b46a-dbe11f56500b" ><img alt="dino_supir" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/323bc182-e8f4-4013-b46a-dbe11f56500b" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/1b9512aa-f104-4a80-8dc7-fcd011bb44f7" ><img alt="base_family" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/1b9512aa-f104-4a80-8dc7-fcd011bb44f7" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/d56deee1-4c88-4116-a35d-77f1c670eba1" ><img alt="magnific_family" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/d56deee1-4c88-4116-a35d-77f1c670eba1" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/41a1e1f8-d226-47a3-a811-9ee798273f6b" ><img alt="supir_family" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/41a1e1f8-d226-47a3-a811-9ee798273f6b" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/782d5071-eef6-468b-a56e-66e7c27ecb0d" ><img alt="base_camel" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/782d5071-eef6-468b-a56e-66e7c27ecb0d" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/2ef37b38-a57d-46cc-a061-f2f0fe531ff5" ><img alt="magnific_camel" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/2ef37b38-a57d-46cc-a061-f2f0fe531ff5" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/9dbd7afe-6996-4137-8193-177410860278" ><img alt="supir_camel" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/9dbd7afe-6996-4137-8193-177410860278" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/a042cadb-2a86-45f5-a83a-84baf39f0f49" ><img alt="base_vampire" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/a042cadb-2a86-45f5-a83a-84baf39f0f49" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/7cbd0ab9-838e-4eba-82c1-2b5011219685" ><img alt="magnific_vampire" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/7cbd0ab9-838e-4eba-82c1-2b5011219685" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/5762aa05-15e0-47f8-be60-845e610b7b4a" ><img alt="supir_vampire" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/5762aa05-15e0-47f8-be60-845e610b7b4a" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/5c27a8d0-eb36-43c7-a3e5-f98ca8aa6185" ><img alt="base_dragon" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/5c27a8d0-eb36-43c7-a3e5-f98ca8aa6185" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/cf595fb2-aa29-41e2-b720-b11669719529" ><img alt="magnific_dragon" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/cf595fb2-aa29-41e2-b720-b11669719529" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/d5d58a42-fca1-440b-a8c7-f029de56d4b1" ><img alt="supir_dragon" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/d5d58a42-fca1-440b-a8c7-f029de56d4b1" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/f3eff22e-3469-4596-bd2e-c0cb40a95055" ><img alt="base_arnold" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/f3eff22e-3469-4596-bd2e-c0cb40a95055" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/86d767b8-fe9f-411d-9303-be3f92c0c237" ><img alt="magnific_arnold" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/86d767b8-fe9f-411d-9303-be3f92c0c237" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/65c42c92-fbdb-4451-a088-47dbe671f7b8" ><img alt="supir_arnold" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/65c42c92-fbdb-4451-a088-47dbe671f7b8" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/15883fdc-2d50-4bc9-9f89-150ce5f60f0f" ><img alt="base_predator" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/15883fdc-2d50-4bc9-9f89-150ce5f60f0f" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/d78ea5f9-496c-4334-b8ed-6300467456a4" ><img alt="magnific_predator" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/d78ea5f9-496c-4334-b8ed-6300467456a4" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/c07b7ab1-bd90-46f4-9621-f2074a4cd258" ><img alt="supir_predator" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/c07b7ab1-bd90-46f4-9621-f2074a4cd258" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/2ce9c9b4-c5ae-4465-8cac-ec963ed5b1c4" ><img alt="base_charlie" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/2ce9c9b4-c5ae-4465-8cac-ec963ed5b1c4" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/b6d3e3e8-233b-4447-9978-6d3e37e49f4d" ><img alt="magnific_charlie" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/b6d3e3e8-233b-4447-9978-6d3e37e49f4d" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/8959aabd-e027-4d6d-b008-908170e9c1c8" ><img alt="supir_charlie" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/8959aabd-e027-4d6d-b008-908170e9c1c8" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/c7f61cd0-950e-4880-b32a-d81e9a9953c9" ><img alt="base_monster" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/c7f61cd0-950e-4880-b32a-d81e9a9953c9" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/22db3a90-e593-41df-836f-d6646791340a" ><img alt="magnific_monster" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/22db3a90-e593-41df-836f-d6646791340a" /></a></p>

<p><a href="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/046139e6-d023-450c-97cd-72cc7a5ef905" ><img alt="supir_monster" src="https://github.com/FurkanGozukara/Stable-Diffusion/assets/19240467/046139e6-d023-450c-97cd-72cc7a5ef905" /></a></p>