[Bug]: PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x00000240CBB2CDB0>
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
When dragging generated images from the output folders, this error occurs, it never happened to me before and it worked normally some versions ago. I installed a new NVME SSD, but I don't think this has anything to do with it.
Steps to reproduce the problem
Drag any image from the output folders to the PNG info window.
What should have happened?
Read the image with the corresponding metadata without problems.
Sysinfo
What browsers do you use to access the UI ?
No response
Console logs
Traceback (most recent call last):
File "X:\STABLE DIFFUSION\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "X:\STABLE DIFFUSION\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1429, in process_api
inputs = self.preprocess_data(fn_index, inputs, state)
File "X:\STABLE DIFFUSION\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1239, in preprocess_data
processed_input.append(block.preprocess(inputs[i]))
File "X:\STABLE DIFFUSION\stable-diffusion-webui\venv\lib\site-packages\gradio\components\image.py", line 274, in preprocess
im = processing_utils.decode_base64_to_image(x)
File "X:\STABLE DIFFUSION\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 59, in decode_base64_to_image
img = Image.open(BytesIO(base64.b64decode(image_encoded)))
File "X:\STABLE DIFFUSION\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3298, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x00000240CBB2CDB0>
Additional information
No response
I've been having this same issue. The only work around is to open the image in photoshop, then save it as a png, and it can then be used. It's something to do with how img2img is saving files.
After extensive testing, for me, it seemed to have something to do with which HD the images were written to originally. Changing the hard drive seemed to fix the issue. I have no idea why that fixed the issue, however.
pip uninstall contextily pip install contextily
seemed to do the trick for me.
pip uninstall contextily pip install contextily
seemed to do the trick for me.
yes. solve it