Update UPSCALE.md

This commit is contained in:
Lincoln Stein 2022-09-20 23:01:21 -04:00 committed by GitHub
parent fc61ddab3c
commit 43c9288534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,15 +2,13 @@
title: Upscale title: Upscale
--- ---
## **Intro** ## Intro
The script provides the ability to restore faces and upscale. You can apply these operations The script provides the ability to restore faces and upscale. You can apply these operations
at the time you generate the images, or at any time to a previously-generated PNG file, using at the time you generate the images, or at any time to a previously-generated PNG file, using
the [!fix](#Fixing Previously-Generated Images) command. the [!fix](#fixing-previously-generated-images) command.
# :material-image-size-select-large: Upscale ## Face Fixing
## **Face Fixing**
The default face restoration module is GFPGAN. The default upscale is Real-ESRGAN. For an alternative The default face restoration module is GFPGAN. The default upscale is Real-ESRGAN. For an alternative
face restoration module, see [CodeFormer Support] below. face restoration module, see [CodeFormer Support] below.
@ -46,11 +44,11 @@ other GFPGAN related boot arguments if you wish to customize further._
may run `python3 scripts/preload_models.py` after you have installed GFPGAN and all its may run `python3 scripts/preload_models.py` after you have installed GFPGAN and all its
dependencies. dependencies.
## **Usage** ## Usage
You will now have access to two new prompt arguments. You will now have access to two new prompt arguments.
### **Upscaling** ### Upscaling
`-U : <upscaling_factor> <upscaling_strength>` `-U : <upscaling_factor> <upscaling_strength>`
@ -64,7 +62,7 @@ retain some of those for natural looking results, we recommend using values betw
If you do not explicitly specify an upscaling_strength, it will default to 0.75. If you do not explicitly specify an upscaling_strength, it will default to 0.75.
### **Face Restoration** ### Face Restoration
`-G : <gfpgan_strength>` `-G : <gfpgan_strength>`
@ -81,7 +79,7 @@ When you use either `-U` or `-G`, the final result you get is upscaled or face m
to save the original Stable Diffusion generation, you can use the `-save_orig` prompt argument to to save the original Stable Diffusion generation, you can use the `-save_orig` prompt argument to
save the original unaffected version too. save the original unaffected version too.
### **Example Usage** ### Example Usage
```bash ```bash
dream> superman dancing with a panda bear -U 2 0.6 -G 0.4 dream> superman dancing with a panda bear -U 2 0.6 -G 0.4
@ -121,13 +119,13 @@ saving it to `ldm/restoration/codeformer/weights` folder.
You can use `-ft` prompt argument to swap between CodeFormer and the default GFPGAN. The above You can use `-ft` prompt argument to swap between CodeFormer and the default GFPGAN. The above
mentioned `-G` prompt argument will allow you to control the strength of the restoration effect. mentioned `-G` prompt argument will allow you to control the strength of the restoration effect.
### **Usage:** ### Usage:
The following command will perform face restoration with CodeFormer instead of the default gfpgan. The following command will perform face restoration with CodeFormer instead of the default gfpgan.
`<prompt> -G 0.8 -ft codeformer` `<prompt> -G 0.8 -ft codeformer`
**Other Options:** ### Other Options:
- `-cf` - cf or CodeFormer Fidelity takes values between `0` and `1`. 0 produces high quality - `-cf` - cf or CodeFormer Fidelity takes values between `0` and `1`. 0 produces high quality
results but low accuracy and 1 produces lower quality results but higher accuacy to your original results but low accuracy and 1 produces lower quality results but higher accuacy to your original
@ -157,7 +155,7 @@ dream> !fix ./outputs/img-samples/000044.2945021133.png -G 0.8 -U 2
A new file named `000044.2945021133.fixed.png` will be created in the output directory. Note that A new file named `000044.2945021133.fixed.png` will be created in the output directory. Note that
the `!fix` command does not replace the original file, unlike the behavior at generate time. the `!fix` command does not replace the original file, unlike the behavior at generate time.
**Disabling:** ### Disabling:
If, for some reason, you do not wish to load the GFPGAN and/or ESRGAN libraries, you can disable them If, for some reason, you do not wish to load the GFPGAN and/or ESRGAN libraries, you can disable them
on the dream.py command line with the `--no_restore` and `--no_upscale` options, respectively. on the dream.py command line with the `--no_restore` and `--no_upscale` options, respectively.