Skip to content

Commit

Permalink
fix(api): use tile size for all highres scaling methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jun 15, 2023
1 parent dcea248 commit 7b0bed7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/onnx_web/diffusers/run.py
Expand Up @@ -147,15 +147,17 @@ def run_highres(
)

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

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

0 comments on commit 7b0bed7

Please sign in to comment.