From 069f91f9302f481024d37b91295e8667af4ff2e5 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Wed, 21 Sep 2022 19:00:19 +1200 Subject: [PATCH] Bug Fix Patch --- .gitignore | 2 +- ldm/dream/args.py | 4 ++-- ldm/dream/restoration/__init__.py | 1 + ldm/dream/restoration/base.py | 2 +- scripts/dream.py | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 ldm/dream/restoration/__init__.py diff --git a/.gitignore b/.gitignore index 4c0ec37174..da74df3a1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # ignore default image save location and model symbolic link outputs/ models/ldm/stable-diffusion-v1/model.ckpt -ldm/restoration/codeformer/weights +ldm/dream/restoration/codeformer/weights # ignore the Anaconda/Miniconda installer used while building Docker image anaconda.sh diff --git a/ldm/dream/args.py b/ldm/dream/args.py index eb1913d1cf..2cb42d82a7 100644 --- a/ldm/dream/args.py +++ b/ldm/dream/args.py @@ -573,14 +573,14 @@ class Args(object): '-G', '--gfpgan_strength', type=float, - help='The strength at which to apply the GFPGAN model to the result, in order to improve faces.', + help='The strength at which to apply the face restoration to the result.', default=0.0, ) postprocessing_group.add_argument( '-cf', '--codeformer_fidelity', type=float, - help='Takes values between 0 and 1. 0 produces high quality but low accuracy. 1 produces high accuracy but low quality.', + help='Used along with CodeFormer. Takes values between 0 and 1. 0 produces high quality but low accuracy. 1 produces high accuracy but low quality.', default=0.75 ) postprocessing_group.add_argument( diff --git a/ldm/dream/restoration/__init__.py b/ldm/dream/restoration/__init__.py new file mode 100644 index 0000000000..1a1de70ea2 --- /dev/null +++ b/ldm/dream/restoration/__init__.py @@ -0,0 +1 @@ +from .base import Restoration \ No newline at end of file diff --git a/ldm/dream/restoration/base.py b/ldm/dream/restoration/base.py index 539301d802..9037bc40cb 100644 --- a/ldm/dream/restoration/base.py +++ b/ldm/dream/restoration/base.py @@ -27,7 +27,7 @@ class Restoration(): return CodeFormerRestoration() # Upscale Models - def load_ersgan(self): + def load_esrgan(self): from ldm.dream.restoration.realesrgan import ESRGAN esrgan = ESRGAN(self.esrgan_bg_tile) print('>> ESRGAN Initialized') diff --git a/scripts/dream.py b/scripts/dream.py index dc1757dce2..036a3704c8 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -54,7 +54,7 @@ def main(): else: print('>> Face restoration disabled') if opt.esrgan: - esrgan = restoration.load_ersgan() + esrgan = restoration.load_esrgan() else: print('>> Upscaling disabled') except (ModuleNotFoundError, ImportError):