@@ -6,49 +6,39 @@ title: Postprocessing
66
77## Intro
88
9- This extension provides the ability to restore faces and upscale
10- images.
9+ This extension provides the ability to restore faces and upscale images.
1110
12- Face restoration and upscaling can be applied at the time you generate
13- the images, or at any later time against a previously-generated PNG
14- file, using the [ !fix] ( #fixing-previously-generated-images )
15- command. [ Outpainting and outcropping] ( OUTPAINTING.md ) can only be
16- applied after the fact.
11+ Face restoration and upscaling can be applied at the time you generate the
12+ images, or at any later time against a previously-generated PNG file, using the
13+ [ !fix] ( #fixing-previously-generated-images ) command.
14+ [ Outpainting and outcropping] ( OUTPAINTING.md ) can only be applied after the
15+ fact.
1716
1817## Face Fixing
1918
2019The default face restoration module is GFPGAN. The default upscale is
21- Real-ESRGAN. For an alternative face restoration module, see [ CodeFormer
22- Support] ( #codeformer-support ) below.
23-
24- As of version 1.14, environment.yaml will install the Real-ESRGAN
25- package into the standard install location for python packages, and
26- will put GFPGAN into a subdirectory of "src" in the InvokeAI
27- directory. Upscaling with Real-ESRGAN should "just work" without
28- further intervention. Simply pass the ` --upscale ` (` -U ` ) option on the
29- ` invoke> ` command line, or indicate the desired scale on the popup in
30- the Web GUI.
31-
32- ** GFPGAN** requires a series of downloadable model files to
33- work. These are loaded when you run ` scripts/preload_models.py ` . If
34- GFPAN is failing with an error, please run the following from the
35- InvokeAI directory:
20+ Real-ESRGAN. For an alternative face restoration module, see
21+ [ CodeFormer Support] ( #codeformer-support ) below.
22+
23+ As of version 1.14, environment.yaml will install the Real-ESRGAN package into
24+ the standard install location for python packages, and will put GFPGAN into a
25+ subdirectory of "src" in the InvokeAI directory. Upscaling with Real-ESRGAN
26+ should "just work" without further intervention. Simply pass the ` --upscale `
27+ (` -U ` ) option on the ` invoke> ` command line, or indicate the desired scale on
28+ the popup in the Web GUI.
29+
30+ ** GFPGAN** requires a series of downloadable model files to work. These are
31+ loaded when you run ` scripts/preload_models.py ` . If GFPAN is failing with an
32+ error, please run the following from the InvokeAI directory:
3633
3734``` bash
3835python scripts/preload_models.py
3936```
4037
41- If you do not run this script in advance, the GFPGAN module will attempt
42- to download the models files the first time you try to perform facial
38+ If you do not run this script in advance, the GFPGAN module will attempt to
39+ download the models files the first time you try to perform facial
4340reconstruction.
4441
45- Alternatively, if you have GFPGAN installed elsewhere, or if you are
46- using an earlier version of this package which asked you to install
47- GFPGAN in a sibling directory, you may use the ` --gfpgan_dir ` argument
48- with ` invoke.py ` to set a custom path to your GFPGAN directory. _ There
49- are other GFPGAN related boot arguments if you wish to customize
50- further._
51-
5242## Usage
5343
5444You will now have access to two new prompt arguments.
@@ -119,15 +109,15 @@ actions.
119109This repo also allows you to perform face restoration using
120110[ CodeFormer] ( https://github.com/sczhou/CodeFormer ) .
121111
122- In order to setup CodeFormer to work, you need to download the models
123- like with GFPGAN. You can do this either by running
124- ` preload_models.py ` or by manually downloading the [ model
125- file] ( https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth )
112+ In order to setup CodeFormer to work, you need to download the models like with
113+ GFPGAN. You can do this either by running ` preload_models.py ` or by manually
114+ downloading the
115+ [ model file] ( https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth )
126116and saving it to ` ldm/invoke/restoration/codeformer/weights ` folder.
127117
128- You can use ` -ft ` prompt argument to swap between CodeFormer and the
129- default GFPGAN. The above mentioned ` -G ` prompt argument will allow
130- you to control the strength of the restoration effect.
118+ You can use ` -ft ` prompt argument to swap between CodeFormer and the default
119+ GFPGAN. The above mentioned ` -G ` prompt argument will allow you to control the
120+ strength of the restoration effect.
131121
132122### Usage
133123
@@ -157,9 +147,9 @@ situations when there is very little facial data to work with.
157147## Fixing Previously-Generated Images
158148
159149It is easy to apply face restoration and/or upscaling to any
160- previously-generated file. Just use the syntax `!fix path/to/file.png
161- <options >`. For example, to apply GFPGAN at strength 0.8 and upscale
162- 2X for a file named ` ./outputs/img-samples/000044.2945021133.png ` ,
150+ previously-generated file. Just use the syntax
151+ ` !fix path/to/file.png <options>` . For example, to apply GFPGAN at strength 0.8
152+ and upscale 2X for a file named ` ./outputs/img-samples/000044.2945021133.png ` ,
163153just run:
164154
165155``` bash
0 commit comments