1
0
Fork 0

fix(api): remove background upscaler from GFPGAN stage (#108)

This commit is contained in:
Sean Sube 2023-02-06 08:33:29 -06:00
parent 1f65da88b0
commit 24ab52bf0d
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 1 additions and 6 deletions

View File

@ -20,15 +20,11 @@ last_pipeline_params = None
def load_gfpgan( def load_gfpgan(
ctx: ServerContext, upscale: UpscaleParams, device: DeviceParams, upsampler: Optional[RealESRGANer] = None ctx: ServerContext, upscale: UpscaleParams, _device: DeviceParams
): ):
global last_pipeline_instance global last_pipeline_instance
global last_pipeline_params global last_pipeline_params
if upsampler is None:
bg_upscale = upscale.rescale(upscale.outscale)
upsampler = load_resrgan(ctx, bg_upscale, device)
face_path = path.join(ctx.model_path, "%s.pth" % (upscale.correction_model)) face_path = path.join(ctx.model_path, "%s.pth" % (upscale.correction_model))
if last_pipeline_instance is not None and face_path == last_pipeline_params: if last_pipeline_instance is not None and face_path == last_pipeline_params:
@ -43,7 +39,6 @@ def load_gfpgan(
upscale=upscale.outscale, upscale=upscale.outscale,
arch="clean", arch="clean",
channel_multiplier=2, channel_multiplier=2,
bg_upsampler=upsampler,
) )
last_pipeline_instance = gfpgan last_pipeline_instance = gfpgan