Merge pull request #101 from BaristaLabs/remove-gpfgan

Set default to none for gfpgan_strength
This commit is contained in:
Lincoln Stein 2022-08-26 07:55:47 -04:00 committed by GitHub
commit b0b4ccf521
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -305,7 +305,12 @@ class T2I:
iter_images = next(images_iterator)
for image in iter_images:
try:
if gfpgan_strength > 0:
# if gfpgan strength is none or less than or equal to 0.0 then
# don't even attempt to use GFPGAN.
# if the user specified a value of -G that satisifies the condition and
# --gfpgan wasn't specified, at startup then
# the net result is a message gets printed - nothing else happens.
if gfpgan_strength is not None and gfpgan_strength > 0.0:
image = self._run_gfpgan(
image, gfpgan_strength
)

View File

@ -496,7 +496,7 @@ def create_cmd_parser():
parser.add_argument(
'-G',
'--gfpgan_strength',
default=0.5,
default=None,
type=float,
help='The strength at which to apply the GFPGAN model to the result, in order to improve faces.',
)