fix(api): skip upscaling if scale is 1
This commit is contained in:
parent
227056d976
commit
b7c85aa51b
|
@ -148,10 +148,11 @@ def make_resrgan(ctx: ServerContext, params: UpscaleParams, tile=0):
|
|||
def upscale_resrgan(ctx: ServerContext, params: UpscaleParams, source_image: Image) -> Image:
|
||||
print('upscaling image with Real ESRGAN', params)
|
||||
|
||||
image = np.array(source_image)
|
||||
output = np.array(source_image)
|
||||
upsampler = make_resrgan(ctx, params, tile=512)
|
||||
|
||||
output, _ = upsampler.enhance(image, outscale=params.outscale)
|
||||
if params.scale > 1:
|
||||
output, _ = upsampler.enhance(output, outscale=params.outscale)
|
||||
|
||||
if params.faces:
|
||||
output = upscale_gfpgan(ctx, params, output, upsampler=upsampler)
|
||||
|
|
Loading…
Reference in New Issue