diff options
author | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2023-02-05 14:12:42 +0000 |
---|---|---|
committer | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2023-02-05 14:12:42 +0000 |
commit | 6d11cda4188633ba19f4d8948139e510d5678059 (patch) | |
tree | 9e6263aacaa53c37aee8dad106a90596f5978c1c /modules/images.py | |
parent | ea9bd9fc7409109adcd61b897abc2c8881161256 (diff) | |
download | stable-diffusion-webui-gfx803-6d11cda4188633ba19f4d8948139e510d5678059.tar.gz stable-diffusion-webui-gfx803-6d11cda4188633ba19f4d8948139e510d5678059.tar.bz2 stable-diffusion-webui-gfx803-6d11cda4188633ba19f4d8948139e510d5678059.zip |
configurable image downscale
allowing the user to configure the image downscale parameters in setting
Diffstat (limited to 'modules/images.py')
-rw-r--r-- | modules/images.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/images.py b/modules/images.py index c2ca8849..cf4aea22 100644 --- a/modules/images.py +++ b/modules/images.py @@ -575,9 +575,9 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i image.already_saved_as = fullfn
- target_side_length = 4000
+ target_side_length = int(opts.target_side_length)
oversize = image.width > target_side_length or image.height > target_side_length
- if opts.export_for_4chan and (oversize or os.stat(fullfn).st_size > 4 * 1024 * 1024):
+ if opts.export_for_4chan and (oversize or os.stat(fullfn).st_size > opts.img_downscale_threshold * 1024 * 1024):
ratio = image.width / image.height
if oversize and ratio > 1:
|