Merge pull request #16751 from Neokmi/master

Fix  Codeformer and gfpgan extension , Inconsistent overlay layer types when visibility value is less than 1
This commit is contained in:
w-e-w
2024-12-26 06:33:04 +09:00
committed by GitHub
2 changed files with 8 additions and 0 deletions

View File

@@ -29,6 +29,10 @@ class ScriptPostprocessingCodeFormer(scripts_postprocessing.ScriptPostprocessing
res = Image.fromarray(restored_img)
if codeformer_visibility < 1.0:
if pp.image.size != res.size:
res = res.resize(pp.image.size)
if pp.image.mode != res.mode:
res = res.convert(pp.image.mode)
res = Image.blend(pp.image, res, codeformer_visibility)
pp.image = res