Bug Fix Patch

This commit is contained in:
blessedcoolant 2022-09-21 19:00:19 +12:00
parent 19174949b6
commit 72dd5b18ee
4 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View File

@ -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

View File

@ -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(

View File

@ -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')

View File

@ -47,14 +47,14 @@ def main():
# Loading Face Restoration and ESRGAN Modules
try:
gfpgan, codeformer, esrgan = None, None, None
from ldm.dream.restoration import Restoration
from ldm.dream.restoration.base import Restoration
restoration = Restoration(opt.gfpgan_dir, opt.gfpgan_model_path, opt.esrgan_bg_tile)
if opt.restore:
gfpgan, codeformer = restoration.load_face_restore_models()
else:
print('>> Face restoration disabled')
if opt.esrgan:
esrgan = restoration.load_ersgan()
esrgan = restoration.load_esrgan()
else:
print('>> Upscaling disabled')
except (ModuleNotFoundError, ImportError):