From a5d3ffcc737e76ad8acacfded05927782737172c Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 22 Jan 2023 22:09:39 -0600 Subject: [PATCH] fix(api): use correct coordinate system for outpainting --- api/onnx_web/image.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/onnx_web/image.py b/api/onnx_web/image.py index 5fec85e90..c43768067 100644 --- a/api/onnx_web/image.py +++ b/api/onnx_web/image.py @@ -172,7 +172,7 @@ def expand_image( full_height = expand.top + source_image.height + expand.bottom dims = (full_width, full_height) - origin = (expand.top, expand.left) + origin = (expand.left, expand.top) full_source = Image.new('RGB', dims, fill) full_source.paste(source_image, origin) @@ -181,6 +181,7 @@ def expand_image( full_noise = noise_source(source_image, dims, origin, fill=fill) full_noise = ImageChops.multiply(full_noise, full_mask) - full_source = Image.composite(full_noise, full_source, full_mask.convert('L')) + full_source = Image.composite( + full_noise, full_source, full_mask.convert('L')) return (full_source, full_mask, full_noise, (full_width, full_height))