diff options
author | ramyma <ramy.mahmoudi@gmail.com> | 2023-05-28 18:24:39 +0000 |
---|---|---|
committer | ramyma <ramy.mahmoudi@gmail.com> | 2023-05-28 18:41:54 +0000 |
commit | 3539885f0ecd75876191e5df4578fac0654b70c0 (patch) | |
tree | 026ac23b1b9be1ff750cc36abfae9113b91a8364 /modules | |
parent | b957dcfece29c84ac0cfcd5a69475ff8684c531f (diff) | |
download | stable-diffusion-webui-gfx803-3539885f0ecd75876191e5df4578fac0654b70c0.tar.gz stable-diffusion-webui-gfx803-3539885f0ecd75876191e5df4578fac0654b70c0.tar.bz2 stable-diffusion-webui-gfx803-3539885f0ecd75876191e5df4578fac0654b70c0.zip |
Round down scale destination dimensions to nearest multiple of 8
Diffstat (limited to 'modules')
-rw-r--r-- | modules/upscaler.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/upscaler.py b/modules/upscaler.py index 7b1046d6..3c82861d 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 = int(img.width * scale) - dest_h = int(img.height * scale) + dest_w = round((img.width * scale - 4) / 8) * 8 + dest_h = round((img.height * scale - 4) / 8) * 8 for _ in range(3): shape = (img.width, img.height) |