Skip to content

Commit

Permalink
fix(api): swap dimensions for non-upscaling highres modes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jun 16, 2023
1 parent 7b0bed7 commit f8d59ab
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions api/onnx_web/diffusers/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,14 @@ def run_highres(
)

def highres_tile(tile: Image.Image, dims):
scaled_size = (size.height * highres.scale, size.width * highres.scale)
scaled_size = (size.width * highres.scale, size.height * highres.scale)

if highres.method == "bilinear":
logger.debug("using bilinear interpolation for highres")
tile = tile.resize(
scaled_size, resample=Image.Resampling.BILINEAR
)
tile = tile.resize(scaled_size, resample=Image.Resampling.BILINEAR)
elif highres.method == "lanczos":
logger.debug("using Lanczos interpolation for highres")
tile = tile.resize(
scaled_size, resample=Image.Resampling.LANCZOS
)
tile = tile.resize(scaled_size, resample=Image.Resampling.LANCZOS)
else:
logger.debug("using upscaling pipeline for highres")
tile = run_upscale_correction(
Expand Down

0 comments on commit f8d59ab

Please sign in to comment.