fix rgba to rgb when using jpeg output

This commit is contained in:
Vladimir Mandic 2022-12-26 09:53:26 -05:00
parent 4af3ca5393
commit ae955b0146
1 changed files with 3 additions and 0 deletions

View File

@ -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: