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
(Moved from the links page top here)
(De-Crigified guide)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
=== How to use it ===
 
=== How to use it ===
  
# Put the pictures or textures you want to upscale into the <code>input</code> folder
+
# Put the pictures or textures you want to upscale into the <code>input</code> (found inside the <code>esrgan</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)
 
# 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 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
+
#* For Linux / MacOS users use either the equivalent feature in your file manager or the cd command.
 
# Enter:
 
# Enter:
 
## For Nvidia GPUs
 
## For Nvidia GPUs
Line 11: Line 11:
 
## For other GPUs / integrated Graphic
 
## For other GPUs / integrated Graphic
 
##: <code>python upscale.py --cpu models/${theModelYouWantToUse}</code>
 
##: <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>
+
# Replace <code>${theModelYouWantToUse}</code> with the name of a model in the models folder.
 
# That was it, the results will be in the <code>results</code> folder
 
# That was it, the results will be in the <code>results</code> folder
  

Latest revision as of 21:10, 27 November 2021

How to use it

  1. Put the pictures or textures you want to upscale into the input (found inside the esrgan 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 use either the equivalent feature in your file manager or the cd command.
  3. Enter:
    1. For Nvidia GPUs
      python upscale.py models/${theModelYouWantToUse}
    2. For other GPUs / integrated Graphic
      python upscale.py --cpu models/${theModelYouWantToUse}
  4. Replace ${theModelYouWantToUse} with the name of a model in the models folder.
  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.