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 "Joey's ESRGAN Tutorial"

From Upscale Wiki
Jump to navigation Jump to search
(Created page with "init")
 
(Moved from the links page top here)
Line 1: Line 1:
init
+
 
 +
=== How to use it ===
 +
 
 +
# Put the pictures or textures you want to upscale into the <code>input</code> folder
 +
# Open a terminal window and navigate to the <code>esrgan</code> folder (the folder you cloned the fork into in the install guide)
 +
#* For Windows Shift right click in your <code>esrgan</code> folder and select <code>Git Bash Here</code>.
 +
#* For Linux / MacOS users the process is similar. File managers like Nautilus for example allow you to open a terminal in a folder. If that isn't an option for you can can also navigate using commands. <code>cd</code> allows you to navigate and pwd shows you the current folder. <code>cd ..</code> goes one directory down (for example from <code>/home/combi/code/git/ctp</code> to <code>/home/combi/code/git</code>). Use <code>cd /path/to/whatever</code> to navigate to absolute (full) paths or <code>cd some-folder-in-the-current-folder</code> to navigate to a folder in the current open folder. (<code>pwd</code> = print working directory; cd = change directory) If you want to find out more about a command you can just type <code>man the command-you-want-to-know-about</code> or use the internet
 +
# Enter:
 +
## For Nvidia GPUs
 +
##: <code>python upscale.py models/${theModelYouWantToUse}</code>
 +
## For other GPUs / integrated Graphic
 +
##: <code>python upscale.py --cpu models/${theModelYouWantToUse}</code>
 +
# Don't enter <code>${theModelYouWantToUse}</code> Instead replace that with the name of a model of course As an example, for the default model it would be: <code>python test.py models/RRDB_ESRGAN_x4.pth</code>
 +
# That was it, the results will be in the <code>results</code> folder
 +
 
 +
Other useful Command line switches are:
 +
 
 +
* <code>--input ./input</code> - Your Input folder
 +
* <code>--seamless</code> - For seamless textures (Textures that repeat without seams)
 +
* <code>--output ./output</code> - Your Output folder
 +
* <code>--skip_existing</code> - Skipps already upscaled images that are in your output and input folder
 +
* <code>--tile_size 512</code> - The tile size, if you run out of VRAM, decrease that value
 +
* <code>--binary_alpha</code> - If the alpha / transparency channel should be only black or white
 +
* <code>--alpha_threshold 0.5</code> Sets tha point at which alpha will be white instead of black if using binary alpha
 +
* <code>--alpha_mode 1</code> Different implementation for how Alpha works, if you use binary alpha, it must be 1 otherwise you can try 2.

Revision as of 20:59, 17 September 2021

How to use it

  1. Put the pictures or textures you want to upscale into the input folder
  2. Open a terminal window and navigate to the esrgan folder (the folder you cloned the fork into in the install guide)
    • For Windows Shift right click in your esrgan folder and select Git Bash Here.
    • For Linux / MacOS users the process is similar. File managers like Nautilus for example allow you to open a terminal in a folder. If that isn't an option for you can can also navigate using commands. cd allows you to navigate and pwd shows you the current folder. cd .. goes one directory down (for example from /home/combi/code/git/ctp to /home/combi/code/git). Use cd /path/to/whatever to navigate to absolute (full) paths or cd some-folder-in-the-current-folder to navigate to a folder in the current open folder. (pwd = print working directory; cd = change directory) If you want to find out more about a command you can just type man the command-you-want-to-know-about or use the internet
  3. Enter:
    1. For Nvidia GPUs
      python upscale.py models/${theModelYouWantToUse}
    2. For other GPUs / integrated Graphic
      python upscale.py --cpu models/${theModelYouWantToUse}
  4. Don't enter ${theModelYouWantToUse} Instead replace that with the name of a model of course As an example, for the default model it would be: python test.py models/RRDB_ESRGAN_x4.pth
  5. That was it, the results will be in the results folder

Other useful Command line switches are:

  • --input ./input - Your Input folder
  • --seamless - For seamless textures (Textures that repeat without seams)
  • --output ./output - Your Output folder
  • --skip_existing - Skipps already upscaled images that are in your output and input folder
  • --tile_size 512 - The tile size, if you run out of VRAM, decrease that value
  • --binary_alpha - If the alpha / transparency channel should be only black or white
  • --alpha_threshold 0.5 Sets tha point at which alpha will be white instead of black if using binary alpha
  • --alpha_mode 1 Different implementation for how Alpha works, if you use binary alpha, it must be 1 otherwise you can try 2.