Info-icon.png We have moved to https://openmodeldb.info/. This new site has a tag and search system, which will make finding the right models for you much easier! If you have any questions, ask here: https://discord.gg/cpAUpDK

Difference between revisions of "ESRGAN Installation Guide for Windows"

From Upscale Wiki
Jump to navigation Jump to search
(45 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{| class="wikitable"
 +
|-
 +
| Please make sure that you have the latest driver version if you use a Nvidia GPU. Both the '''Studio''' and '''[https://developer.nvidia.com/cuda-downloads CUDA]''' drivers are recommended. The [https://developer.nvidia.com/cuda-downloads CUDA] driver on only gets updated when [https://developer.nvidia.com/cuda-downloads CUDA] itself gets updated, but will be compatible with the [https://developer.nvidia.com/cuda-downloads CUDA] version.
 +
|-
 +
| Also make sure that you have no existing older Python installation(s) if you want to follow this guide
 +
|-
 +
| Only Python 3.9.x is currently supported.
 +
|-
 +
| [https://discord.gg/cpAUpDK Support is here if you have problems.] Make sure that you followed the instructions to the letter.
 +
|}
 +
 
This guide will help you to install ESRGAN on Windows, by showing you step by step with images how to do it.
 
This guide will help you to install ESRGAN on Windows, by showing you step by step with images how to do it.
  
No knowledge of Python or coding is necessary to follow this guide.
+
Our goal is to open up A.I. upscaling to everyone, not just to those who can pay lots of money or are good at coding.
 +
 
 +
== Installing ESRGAN's Dependencies ==
  
If you have any problems during or after the installation, feel free to ask any questions on our [https://discord.gg/SxvYsgE Discord server] and we will try to help you out.
+
=== Text / Picture Guide ===
  
Our goal is to open up A.I. upscaling to everyone, not just to those who can pay lots of money or are good at coding.
+
==== Installing Python 3.9====
  
Before you start, make sure that your '''driver is up-to-date''' if you have an '''Nvidia GPU''', to make sure it supports the newest cuda version. If you want to be on the save site, use the [https://developer.nvidia.com/cuda-downloads cuda driver].
+
# Get the latest stable 64-bit Python 3.9.x release here: [https://www.python.org/downloads/windows/ Python Download]. At the time of writing this is Python 3.9.2.
 +
#: [[File:GuideEsrganWin_1-python-link.jpg|frameless|A snapshot of the "Python Releases for Windows" section of the above linked webpage as of August 12, 2019. The "Download Windows x86-64 executable installer" link is highlighted.]]
 +
# Run the installer and make sure that <code>Add Python 3.*x* to Path</code> and <code>Install launcher for all users (recommended)</code> is selected, then click on Customize installation.
 +
#: [[File:GuideEsrganWin_2-installer-1.jpg|frameless|The "Install Python" screen from the python installer. All checkboxes are checked. The checkboxes and the "Customize installation" button are highlighted.]]
 +
# Make sure that every Option is selected and click on next.
 +
#: [[File:GuideEsrganWin_3-installer-2.jpg|frameless|The Optional Features screen from the Python installer. All options are checked. The checked boxes are highlighted.]]
 +
# Mirror my selections and click on install (Make sure that the install location contains no spaces).
 +
#: [[File:GuideEsrganWin_4-installer-3.jpg|frameless|The Advanced Options screen from the Python installer. All options are checked except "Download debug binaries". Install location is set as "C:\Python37". The checked boxes and the install location are highlighted.]]
  
== Installing ESRGAN ==
+
==== Installing Python Modules required by ESRGAN ====
  
<ol style="list-style-type: decimal;">
+
# Launch your favourite Terminal (CMD, PowerShell, Bash, …) as an administrator (right-click it in the start menu to get that option).
<li>Get the latest stable 64-bit Python 3 release here: [https://www.python.org/downloads/windows/ Python Download] [[File:GuideEsrganWin_1-python-link.jpg|1-python-link]]</li>
+
#* If you have '''a Nvidia GPU'' copy the following command and paste it in Git Bash and press enter:  
<li>Run the installer and make sure that <code>Add Python 3.*x* to Path</code> and <code>Install launcher for all users (recommended)</code> is selected, then click on Customize installation. [[File:https://github.com/alsa64/AI-wiki/raw/master/res/2-installer-1.jpg|1-python-link]]</li>
+
#*: <code>pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html</code>
<li>Make sure that every Option is selected and click on next. [[File:https://github.com/alsa64/AI-wiki/raw/master/res/3-installer-2.jpg|1-python-link]]</li>
+
#* If you have '''no Nvidia GPU''' copy the following command and paste it in Git Bash and press enter:
<li>Mirror my selections and click on install (Make sure that the install location contains no spaces). [[File:https://github.com/alsa64/AI-wiki/raw/master/res/4-installer-3.jpg|1-python-link]]</li>
+
#*: <code>pip install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html</code>  
<li>You have now successfully installed Python 3. Click on Close now.</li>
+
#* If the command won’t work for you, please report it. In the meantime, you can get an up to date version on the [https://pytorch.org/get-started/locally/ Pytorch Website]. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.
<li>Press <Windows/Super key> + R. Enter <code>cmd</code> and click on <code>OK</code> [[File:https://github.com/alsa64/AI-wiki/raw/master/res/6-run.jpg|6-run]]</li>
+
# Now we install the other requirements for running and training ESRGAN and SFTGAN. Paste and press enter:
<li>We will now install Pytorch:
+
#: <code>pip install opencv-python</code>
<ol style="list-style-type: decimal;">
 
<li>If you have a '''Nvidia''' graphic card enter the following command in the cmd:</li></ol>
 
  
<source lang="bash">pip install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-win_amd64.whl</source>
+
==== Installing git (+ Bash) ====
then: <code>bash  pip install https://download.pytorch.org/whl/cu100/torchvision-0.3.0-cp37-cp37m-win_amd64.whl</code> [[File:https://github.com/alsa64/AI-wiki/raw/master/res/7-Nvidia.jpg|cmd-NV]]
 
<ol start="2" style="list-style-type: decimal;">
 
<li>If you have an '''AMD / Intel''' graphic card enter the following command in the cmd:</li></ol>
 
  
<source lang="bash">pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl</source>
+
Not strictly required, but I reccomend it regardless.
then: <code>bash  pip install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp37-cp37m-win_amd64.whl</code> [[File:https://github.com/alsa64/AI-wiki/raw/master/res/7-CPU.jpg|cmd-CPU]]
 
<ol start="3" style="list-style-type: decimal;">
 
<li>If the command won’t work for you, please report it and get a new one in the meantime here [https://pytorch.org/get-started/locally/ Pytorch Website]. Select Stable, Windows, Pip, your Python version and your cuda version (should be the newest) or None for AMD / Intel users.</li></ol>
 
</li>
 
<li>Press Enter.</li>
 
<li>Now we install the other requirements for running and training ESRGAN and SFTGAN. Enter:</li></ol>
 
  
<source lang="bash">pip install opencv-python</source>
+
# Get the latest stable 64-bit Git release here: [https://git-scm.com/download/win Git Download].
[[File:https://github.com/alsa64/AI-wiki/raw/master/res/8-pip.jpg|thumb|none|alt=cmd-others|cmd-others]]
+
# Run the installer and select the options as you want, the defaults are fine. I recommend to check the Launch Git Bash Explorer Integration. Also set your default editor to whatever editor is used (Unless you use the git command to commit, this setting is irrelevant for you).
  
<ol start="10" style="list-style-type: decimal;">
+
=== Video Guide ===
<li><p>Choose a folder where you want to install ESRGAN. Because of the maximum path length limitation in windows, I recommend something as short as possible like: <code>C:\ctp\esrgan\</code></p>
 
<ol style="list-style-type: decimal;">
 
<li>Create a folder called <code>ctp</code> (That will come in handy if you want to install Deorders scripts later)</li>
 
<li>In the <code>ctp</code> folder create a folder called <code>esrgan</code></li>
 
<li>Open the <code>esrgan</code> folder.</li></ol>
 
</li>
 
<li><p>Now it is time to download ESRGAN:</p>
 
<ol style="list-style-type: decimal;">
 
<li>Go to [https://github.com/xinntao/ESRGAN/tree/aceb85730832001ec1fa3a77bd6856b75e1d0e87 the ESRGAN GitHub Repo (old model structure)]</li>
 
<li>Click on <code>Clone or Download</code></li>
 
<li>Click on <code>Download ZIP</code> [[File:https://github.com/alsa64/AI-wiki/raw/master/res/10-github.jpg|cmd-CPU]]</li></ol>
 
</li>
 
<li><p>Extract the contents of the folder into your <code>C:\ctp\esrgan</code> folder you created in step 10. It should already be open and look like this: [[File:https://github.com/alsa64/AI-wiki/raw/master/res/11-explorer.jpg|cmd-CPU]]</p></li>
 
<li><p>Now it is time to download and install the default ESRGAN models:</p>
 
<ol style="list-style-type: decimal;">
 
<li>Go to the [https://drive.google.com/drive/folders/17VYV_SoZZesU6mbxz2dMAIccSSlqLecY ESRGAN Pretrained Models Google Drive]</li>
 
<li>Download the two <code>_old_arch.pth</code> files.</li>
 
<li>Put the two <code>.pth</code> files that you have just downloaded into your <code>models</code> folder in your <code>esrgan</code> folder
 
<ol style="list-style-type: decimal;">
 
<li>For example in:</li></ol>
 
  
<pre>C:\ctp\esrgan\models\</pre></li></ol>
+
Princess Potato recorded the process of installing ESRGAN and IEU in a video for all of you to enjoy. Seeing someone do it and talk about the process might help a lot of people to install not just ESRGAN, but also IEU
</li>
+
[https://www.youtube.com/watch?v=w4Hb7tyDsWE You will find the video on YouTube here by clicking on this link].
<li><p>If you have a Nvidia Graphic Card, then you have successfully installed ESRGAN, congratulations!</p></li>
 
<li><p>But If you have an AMD / Intel Graphic Card then open <code>test.py</code> in your ESRGAN folder with a text editor.</p>
 
<ol style="list-style-type: decimal;">
 
<li>Change:</li></ol>
 
  
<source lang="python">device = torch.device('cuda') # if you want to run on CPU, change 'cuda' -> cpu</source>
+
==What now?==
<p>into</p>
+
We have a page dedicated to comparing the top options for ESRGAN programs / interfaces. It doesn't matter if you want a GUI that is easy to use or a Terminal interface for all your automation needs, just look here and chose what fits you best.
<source lang="python">device = torch.device('cpu') # if you want to run on CPU, change 'cuda' -> cpu</source></li></ol>
+
[[Using ESRGAN, Links, And Other Information|ESRGAN Interface Comparison]].

Revision as of 21:17, 17 September 2021

Please make sure that you have the latest driver version if you use a Nvidia GPU. Both the Studio and CUDA drivers are recommended. The CUDA driver on only gets updated when CUDA itself gets updated, but will be compatible with the CUDA version.
Also make sure that you have no existing older Python installation(s) if you want to follow this guide
Only Python 3.9.x is currently supported.
Support is here if you have problems. Make sure that you followed the instructions to the letter.

This guide will help you to install ESRGAN on Windows, by showing you step by step with images how to do it.

Our goal is to open up A.I. upscaling to everyone, not just to those who can pay lots of money or are good at coding.

Installing ESRGAN's Dependencies

Text / Picture Guide

Installing Python 3.9

  1. Get the latest stable 64-bit Python 3.9.x release here: Python Download. At the time of writing this is Python 3.9.2.
    A snapshot of the "Python Releases for Windows" section of the above linked webpage as of August 12, 2019. The "Download Windows x86-64 executable installer" link is highlighted.
  2. Run the installer and make sure that Add Python 3.*x* to Path and Install launcher for all users (recommended) is selected, then click on Customize installation.
    The "Install Python" screen from the python installer. All checkboxes are checked. The checkboxes and the "Customize installation" button are highlighted.
  3. Make sure that every Option is selected and click on next.
    The Optional Features screen from the Python installer. All options are checked. The checked boxes are highlighted.
  4. Mirror my selections and click on install (Make sure that the install location contains no spaces).
    The Advanced Options screen from the Python installer. All options are checked except "Download debug binaries". Install location is set as "C:\Python37". The checked boxes and the install location are highlighted.

Installing Python Modules required by ESRGAN

  1. Launch your favourite Terminal (CMD, PowerShell, Bash, …) as an administrator (right-click it in the start menu to get that option).
    • If you have 'a Nvidia GPU copy the following command and paste it in Git Bash and press enter:
      pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
    • If you have no Nvidia GPU copy the following command and paste it in Git Bash and press enter:
      pip install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
    • If the command won’t work for you, please report it. In the meantime, you can get an up to date version on the Pytorch Website. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.
  2. Now we install the other requirements for running and training ESRGAN and SFTGAN. Paste and press enter:
    pip install opencv-python

Installing git (+ Bash)

Not strictly required, but I reccomend it regardless.

  1. Get the latest stable 64-bit Git release here: Git Download.
  2. Run the installer and select the options as you want, the defaults are fine. I recommend to check the Launch Git Bash Explorer Integration. Also set your default editor to whatever editor is used (Unless you use the git command to commit, this setting is irrelevant for you).

Video Guide

Princess Potato recorded the process of installing ESRGAN and IEU in a video for all of you to enjoy. Seeing someone do it and talk about the process might help a lot of people to install not just ESRGAN, but also IEU You will find the video on YouTube here by clicking on this link.

What now?

We have a page dedicated to comparing the top options for ESRGAN programs / interfaces. It doesn't matter if you want a GUI that is easy to use or a Terminal interface for all your automation needs, just look here and chose what fits you best. ESRGAN Interface Comparison.