diff options
author | ramyma <ramy.mahmoudi@gmail.com> | 2023-06-01 18:42:10 +0000 |
---|---|---|
committer | ramyma <ramy.mahmoudi@gmail.com> | 2023-06-03 11:36:10 +0000 |
commit | 31f57455dd606823b637042d701128ec4893c341 (patch) | |
tree | 46d32afedd387232c07663fa428ac164dc3ad19a /modules/upscaler.py | |
parent | 9d953c0e039cce2c9d8318de9b79a09e243d3e45 (diff) | |
download | stable-diffusion-webui-gfx803-31f57455dd606823b637042d701128ec4893c341.tar.gz stable-diffusion-webui-gfx803-31f57455dd606823b637042d701128ec4893c341.tar.bz2 stable-diffusion-webui-gfx803-31f57455dd606823b637042d701128ec4893c341.zip |
Round upscaled dimensions only when not divisible by 8
Diffstat (limited to 'modules/upscaler.py')
-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 3c82861d..2da1fd54 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 = 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 if img.height * scale % 8 != 0 else img.height * scale for _ in range(3): shape = (img.width, img.height) |