Skip to content

Commit

Permalink
fix(api): use correct coordinate system for outpainting
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 23, 2023
1 parent 39f5dd3 commit a5d3ffc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/onnx_web/image.py
Expand Up @@ -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)
Expand All @@ -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))

0 comments on commit a5d3ffc

Please sign in to comment.