Commit 31f57455 authored by ramyma's avatar ramyma

Round upscaled dimensions only when not divisible by 8

parent 9d953c0e
...@@ -53,8 +53,8 @@ class Upscaler: ...@@ -53,8 +53,8 @@ class Upscaler:
def upscale(self, img: PIL.Image, scale, selected_model: str = None): def upscale(self, img: PIL.Image, scale, selected_model: str = None):
self.scale = scale self.scale = scale
dest_w = round((img.width * scale - 4) / 8) * 8 dest_w = round((img.width * scale - 4) / 8) * 8 if img.width * scale % 8 != 0 else img.width * scale
dest_h = round((img.height * scale - 4) / 8) * 8 dest_h = round((img.height * scale - 4) / 8) * 8 if img.height * scale % 8 != 0 else img.height * scale
for _ in range(3): for _ in range(3):
shape = (img.width, img.height) shape = (img.width, img.height)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment