Skip to content

Commit

Permalink
fix(api): use grid tiling when inpaint margin is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 6, 2023
1 parent 6fcfe4f commit d6c1244
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/onnx_web/chain/upscale_outpaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ def outpaint(image: Image.Image, dims: Tuple[int, int, int]):
margin_y = float(max(border.top, border.bottom))
overlap = min(margin_x / source_image.width, margin_y / source_image.height)

if overlap == 0:
logger.debug("outpainting with 0 margin, using grid tiling")
output = process_tile_grid(source_image, SizeChart.auto, 1, [outpaint])
if border.left == border.right and border.top == border.bottom:
logger.debug("outpainting with an even border, using spiral tiling")
output = process_tile_spiral(
Expand Down

0 comments on commit d6c1244

Please sign in to comment.