Skip to content

Commit

Permalink
fix(api): check image size before blending
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 18, 2023
1 parent d6f2c62 commit 08dbc0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/onnx_web/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ def run_inpaint_pipeline(
num_inference_steps=params.steps,
width=size.width,
).images[0]
image = ImageChops.blend(source_image, image, strength)

if image.size == source_image.size:
image = ImageChops.blend(source_image, image, strength)
else:
print('output image size does not match source, skipping post-blend')

if upscale.faces or upscale.scale > 1:
image = upscale_resrgan(ctx, upscale, image)
Expand Down

0 comments on commit 08dbc0c

Please sign in to comment.