aboutsummaryrefslogtreecommitdiffstats
path: root/modules/images.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-02-20 11:45:54 +0000
committerGitHub <noreply@github.com>2023-02-20 11:45:54 +0000
commit0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8 (patch)
treeeb0660cd82ec9ba2a0d45db37515c8bacea22649 /modules/images.py
parent65995a2ea38a1a0afd06cb508a4f65fd0d3a1743 (diff)
parentf71a3c9c3a8f6d9e5a6231f9f94900201da3e554 (diff)
downloadstable-diffusion-webui-gfx803-0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8.tar.gz
stable-diffusion-webui-gfx803-0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8.tar.bz2
stable-diffusion-webui-gfx803-0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8.zip
Merge pull request #7945 from w-e-w/fix-image-downscale
Fix broken image downscale TypeError
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/images.py b/modules/images.py
index 38404de3..5b80c23e 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -582,9 +582,9 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
ratio = image.width / image.height
if oversize and ratio > 1:
- image = image.resize((opts.target_side_length, image.height * opts.target_side_length // image.width), LANCZOS)
+ image = image.resize((round(opts.target_side_length), round(image.height * opts.target_side_length / image.width)), LANCZOS)
elif oversize:
- image = image.resize((image.width * opts.target_side_length // image.height, opts.target_side_length), LANCZOS)
+ image = image.resize((round(image.width * opts.target_side_length / image.height), round(opts.target_side_length)), LANCZOS)
try:
_atomically_save_image(image, fullfn_without_extension, ".jpg")