workaround #2 for GFPGAN facexlib() weights downloading

This commit is contained in:
Lincoln Stein
2022-12-31 18:20:02 +00:00
parent 8e95eb9e81
commit 30ef589cb3
2 changed files with 4 additions and 1 deletions

View File

@@ -35,6 +35,6 @@ torchmetrics
transformers==4.25.*
https://github.com/Birch-san/k-diffusion/archive/refs/heads/mps.zip#egg=k-diffusion
https://github.com/invoke-ai/PyPatchMatch/archive/refs/tags/0.1.5.zip#egg=pypatchmatch
https://github.com/invoke-ai/GFPGAN/archive/refs/heads/master.zip#egg=gfpgan
# https://github.com/invoke-ai/GFPGAN/archive/refs/heads/master.zip#egg=gfpgan
https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip#egg=clip
https://github.com/invoke-ai/clipseg/archive/relaxed-python-requirement.zip#egg=clipseg

View File

@@ -33,6 +33,8 @@ class GFPGAN():
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=DeprecationWarning)
warnings.filterwarnings('ignore', category=UserWarning)
cwd = os.getcwd()
os.chdir(os.path.join(Globals.root,'models'))
try:
from gfpgan import GFPGANer
self.gfpgan = GFPGANer(
@@ -46,6 +48,7 @@ class GFPGAN():
import traceback
print('>> Error loading GFPGAN:', file=sys.stderr)
print(traceback.format_exc(), file=sys.stderr)
os.chdir(cwd)
if self.gfpgan is None:
print(