FireHead90544 / craiyon.py

Unofficial API Wrapper for craiyon.com (DAL-E-MINI). Generate awesome images from text tokens.
Apache License 2.0
69 stars 22 forks source link

cannot identify image file <_io.BytesIO object #4

Closed Mathgife closed 1 year ago

Mathgife commented 1 year ago

Hi! Thanks for the API!

In your example: "Use the images in your code without saving", when I tried to run I obtained the following error:

UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000002AF3B048AE0>

The error points to the line: 5 image = Image.open(BytesIO(base64.decodebytes(i.encode("utf-8"))))

Do you know how to fix this? Thanks in advance!

FireHead90544 commented 1 year ago

I am currently having my university exams these days. I'll be checking it in a day or so. Will be providing a fix by then :)

FireHead90544 commented 1 year ago

Hey There @Mathgife, There was a small bug in the code, it is fixed in the v0.2.0, upgrade to the latest version by running pip install -U craiyon and try again :)

Please re-open this issue, if you still face similar problems.