From ba3eff5c038e05be682eab126e1cbdc194ac5a14 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Mon, 16 Jan 2023 11:43:00 -0600 Subject: [PATCH] fix(api): enable tiling when fixing faces after upscaling --- api/onnx_web/upscale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/onnx_web/upscale.py b/api/onnx_web/upscale.py index 4c5b97c1f..8d9c470c3 100644 --- a/api/onnx_web/upscale.py +++ b/api/onnx_web/upscale.py @@ -76,7 +76,7 @@ def to(self, device): return self -def make_resrgan(model_path): +def make_resrgan(model_path, tile=0): model_path = path.join(model_path, resrgan_name + '.pth') if not path.isfile(model_path): for url in resrgan_url: @@ -114,7 +114,7 @@ def upscale_resrgan(source_image: Image, model_path: str, faces=True) -> Image: output, _ = upsampler.enhance(image, outscale=outscale) if faces: - output = upscale_gfpgan(output, upsampler) + output = upscale_gfpgan(output, make_resrgan(model_path, 512)) return Image.fromarray(output, 'RGB')