fix(api): remove background upscaler from GFPGAN stage (#108)
This commit is contained in:
parent
1f65da88b0
commit
24ab52bf0d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue