From 1f06b502d581b9422ce64ce30a46447a492be6f1 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 11 Feb 2023 18:55:22 -0600 Subject: [PATCH] fix(api): always fill inpaint/outpaint mask with white --- api/onnx_web/image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/onnx_web/image.py b/api/onnx_web/image.py index b2c99695..45a8fa89 100644 --- a/api/onnx_web/image.py +++ b/api/onnx_web/image.py @@ -181,7 +181,8 @@ def expand_image( full_source = Image.new("RGB", dims, fill) full_source.paste(source_image, origin) - full_mask = mask_filter(mask_image, dims, origin, fill=fill) + # new mask pixels need to be filled with white so they will be replaced + full_mask = mask_filter(mask_image, dims, origin, fill="white") full_noise = noise_source(source_image, dims, origin, fill=fill) full_noise = ImageChops.multiply(full_noise, full_mask)