diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-12-31 09:14:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-31 09:14:41 +0000 |
commit | d81636a09155c7a693fc837514344f3b1b77e4db (patch) | |
tree | a25037a6e610001dd506d931f267e176e2fa0289 /modules/images.py | |
parent | 03cb43c3c848c04e78b9c6bff9f28fe2f5d316c9 (diff) | |
parent | ae955b0146a52ea2474c79655ede0d361829ef63 (diff) | |
download | stable-diffusion-webui-gfx803-d81636a09155c7a693fc837514344f3b1b77e4db.tar.gz stable-diffusion-webui-gfx803-d81636a09155c7a693fc837514344f3b1b77e4db.tar.bz2 stable-diffusion-webui-gfx803-d81636a09155c7a693fc837514344f3b1b77e4db.zip |
Merge pull request #6037 from vladmandic/master
fix rgba to rgb when using jpeg output
Diffstat (limited to 'modules/images.py')
-rw-r--r-- | modules/images.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/images.py b/modules/images.py index 31d4528d..962a955d 100644 --- a/modules/images.py +++ b/modules/images.py @@ -525,6 +525,9 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i image_to_save.save(temp_file_path, format=image_format, quality=opts.jpeg_quality, pnginfo=pnginfo_data)
elif extension.lower() in (".jpg", ".jpeg", ".webp"):
+ if image_to_save.mode == 'RGBA':
+ image_to_save = image_to_save.convert("RGB")
+
image_to_save.save(temp_file_path, format=image_format, quality=opts.jpeg_quality)
if opts.enable_pnginfo and info is not None:
|