mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-10 03:55:05 -05:00
Fix CodeFormer not working if GFPGAN is enabeld
This commit is contained in:
committed by
Lincoln Stein
parent
0678b24ebb
commit
b1d1063a25
@@ -727,16 +727,16 @@ class Generate:
|
||||
print(">> ESRGAN is disabled. Image not upscaled.")
|
||||
if strength > 0:
|
||||
if self.gfpgan is not None or self.codeformer is not None:
|
||||
if self.gfpgan is None:
|
||||
if facetool == 'codeformer':
|
||||
if self.codeformer is not None:
|
||||
image = self.codeformer.process(image=image, strength=strength, device=self.device, seed=seed, fidelity=codeformer_fidelity)
|
||||
else:
|
||||
print('>> CodeFormer not found. Face restoration is disabled.')
|
||||
else:
|
||||
if facetool == 'gfpgan':
|
||||
if self.gfpgan is None:
|
||||
print('>> GFPGAN not found. Face restoration is disabled.')
|
||||
else:
|
||||
image = self.gfpgan.process(image, strength, seed)
|
||||
else:
|
||||
image = self.gfpgan.process(image, strength, seed)
|
||||
if facetool == 'codeformer':
|
||||
if self.codeformer is None:
|
||||
print('>> CodeFormer not found. Face restoration is disabled.')
|
||||
else:
|
||||
image = self.codeformer.process(image=image, strength=strength, device=self.device, seed=seed, fidelity=codeformer_fidelity)
|
||||
else:
|
||||
print(">> Face Restoration is disabled.")
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user