fast-stable-diffusion icon indicating copy to clipboard operation
fast-stable-diffusion copied to clipboard

Captions Error - KeyError: 'RGBA' - OSError: cannot write mode RGBA as JPEG`

Open chewtoys opened this issue 2 years ago • 3 comments

source images are png

[/usr/local/lib/python3.8/dist-packages/PIL/JpegImagePlugin.py](https://localhost:8080/#) in _save(im, fp, filename)
    611     try:
--> 612         rawmode = RAWMODE[im.mode]
    613     except KeyError:

KeyError: 'RGBA'

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
3 frames
[/usr/local/lib/python3.8/dist-packages/PIL/JpegImagePlugin.py](https://localhost:8080/#) in _save(im, fp, filename)
    612         rawmode = RAWMODE[im.mode]
    613     except KeyError:
--> 614         raise OSError("cannot write mode %s as JPEG" % im.mode)
    615 
    616     info = im.encoderinfo

OSError: cannot write mode RGBA as JPEG```

chewtoys avatar Dec 30 '22 20:12 chewtoys

same here. cannot train with caption checked

maxixa avatar Dec 31 '22 10:12 maxixa

one of the images is just not readable by the pillow library

TheLastBen avatar Dec 31 '22 12:12 TheLastBen

It seems that it only read RGB(JPG), but can't read RGBA(PNG). Please try to use *.jpg .

gaoming714 avatar May 30 '24 09:05 gaoming714