aboutsummaryrefslogtreecommitdiff
path: root/modules/upscaler.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-03 14:50:46 +0300
committerGitHub <noreply@github.com>2023-06-03 14:50:46 +0300
commit80ae378f343a3a2dea995726c2f20bb65ab459cf (patch)
tree11ae088ff7103ac1476f270e70a28d893ec21bea /modules/upscaler.py
parent9d953c0e039cce2c9d8318de9b79a09e243d3e45 (diff)
parent8c8c3617a7031f56242eecd2fe7e127267dbad98 (diff)
Merge pull request #10942 from ramyma/round-upscale-result-dims
Round upscaled dimensions only when not divisible by 8
Diffstat (limited to 'modules/upscaler.py')
-rw-r--r--modules/upscaler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/upscaler.py b/modules/upscaler.py
index 3c82861d..49460993 100644
--- a/modules/upscaler.py
+++ b/modules/upscaler.py
@@ -53,8 +53,8 @@ class Upscaler:
def upscale(self, img: PIL.Image, scale, selected_model: str = None):
self.scale = scale
- dest_w = round((img.width * scale - 4) / 8) * 8
- dest_h = round((img.height * scale - 4) / 8) * 8
+ dest_w = int((img.width * scale) // 8 * 8)
+ dest_h = int((img.height * scale) // 8 * 8)
for _ in range(3):
shape = (img.width, img.height)