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

[Bug]: SyntaxError: not a TIFF file (header b"b'Exif\\x" not valid)

Open 1993226871 opened this issue 2 years ago • 14 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

When I use the extra module to resize my img ,and I use the nearest samlper to resize it.But when I use this img to generate a new img from img2img module,the program raised this error: Error completing request Arguments: ('task(l6z6cwd19ehg4fj)', 0, '', '', [], <PIL.Image.Image image mode=RGBA size=828x1792 at 0x7F3C649705B0>, None, None, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 1.5, 0.75, -1.0, -1.0, 0, 0, 0, False, 512, 512, 0, 0, 32, 0, '', '', '', [], 0, <scripts.external_code.ControlNetUnit object at 0x7f3c6495bf10>, <scripts.external_code.ControlNetUnit object at 0x7f3c64958b80>, <scripts.external_code.ControlNetUnit object at 0x7f3c64959030>, '

    \n
  • CFG Scale should be 2 or lower.
  • \n
\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 1, 'None', 'None', None, 1, 'None', False, False, 'PreviousFrame', '

Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8

', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '

Will upscale the image by the selected scale factor; use width and height sliders to set tile size

', 64, 0, 2, 1, '', 0, '', 0, '', True, False, False, False, 0, None, False, None, False, None, False, 50) {} Traceback (most recent call last): File "/root/autodl-tmp/stable-diffusion-webui/modules/call_queue.py", line 56, in f res = list(func(*args, **kwargs)) File "/root/autodl-tmp/stable-diffusion-webui/modules/call_queue.py", line 37, in f res = func(*args, **kwargs) File "/root/autodl-tmp/stable-diffusion-webui/modules/img2img.py", line 115, in img2img image = ImageOps.exif_transpose(image) File "/root/miniconda3/envs/draw/lib/python3.10/site-packages/PIL/ImageOps.py", line 588, in exif_transpose exif = image.getexif() File "/root/miniconda3/envs/draw/lib/python3.10/site-packages/PIL/Image.py", line 1454, in getexif self._exif.load(exif_info) File "/root/miniconda3/envs/draw/lib/python3.10/site-packages/PIL/Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "/root/miniconda3/envs/draw/lib/python3.10/site-packages/PIL/TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid) image

Steps to reproduce the problem

Go to extra module and generate a img,and use this img to generate a new img.

What should have happened?

this img should be generated correctly.

Commit where the problem happens

a9fed7c364061ae6efb37f797b6b522cb3cf7aa2

What platforms do you use to access the UI ?

Linux

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

python launch.py --disable-safe-unpickle --port=6006 --deepdanbooru --medvram --reinstall-xformers --xformers --no-half-vae

List of extensions

none

Console logs

Error completing request
Arguments: ('task(l6z6cwd19ehg4fj)', 0, '', '', [], <PIL.Image.Image image mode=RGBA size=828x1792 at 0x7F3C649705B0>, None, None, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 1.5, 0.75, -1.0, -1.0, 0, 0, 0, False, 512, 512, 0, 0, 32, 0, '', '', '', [], 0, <scripts.external_code.ControlNetUnit object at 0x7f3c6495bf10>, <scripts.external_code.ControlNetUnit object at 0x7f3c64958b80>, <scripts.external_code.ControlNetUnit object at 0x7f3c64959030>, '<ul>\n<li><code>CFG Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 1, 'None', 'None', None, 1, 'None', False, False, 'PreviousFrame', '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 1, '', 0, '', 0, '', True, False, False, False, 0, None, False, None, False, None, False, 50) {}
Traceback (most recent call last):
  File "/root/autodl-tmp/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/root/autodl-tmp/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/root/autodl-tmp/stable-diffusion-webui/modules/img2img.py", line 115, in img2img
    image = ImageOps.exif_transpose(image)
  File "/root/miniconda3/envs/draw/lib/python3.10/site-packages/PIL/ImageOps.py", line 588, in exif_transpose
    exif = image.getexif()
  File "/root/miniconda3/envs/draw/lib/python3.10/site-packages/PIL/Image.py", line 1454, in getexif
    self._exif.load(exif_info)
  File "/root/miniconda3/envs/draw/lib/python3.10/site-packages/PIL/Image.py", line 3670, in load
    self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head)
  File "/root/miniconda3/envs/draw/lib/python3.10/site-packages/PIL/TiffImagePlugin.py", line 504, in __init__
    raise SyntaxError(msg)
SyntaxError: not a TIFF file (header b"b'Exif\\x" not valid)

Additional information

requirements and requirements_version is the same as my current commit.

1993226871 avatar Mar 28 '23 04:03 1993226871

requirements: blendmodes accelerate basicsr fonts font-roboto gfpgan gradio==3.16.2 invisible-watermark numpy omegaconf opencv-contrib-python requests piexif Pillow pytorch_lightning==1.7.7 realesrgan scikit-image>=0.19 timm==0.4.12 transformers==4.25.1 torch einops jsonmerge clean-fid resize-right torchdiffeq kornia lark inflection GitPython torchsde safetensors psutil requirements_version: blendmodes==2022 transformers==4.25.1 accelerate==0.12.0 basicsr==1.4.2 gfpgan==1.3.8 gradio==3.16.2 numpy==1.23.3 Pillow==9.4.0 realesrgan==0.3.0 torch omegaconf==2.2.3 pytorch_lightning==1.7.6 scikit-image==0.19.2 fonts font-roboto timm==0.6.7 piexif==1.1.3 einops==0.4.1 jsonmerge==1.8.0 clean-fid==0.1.29 resize-right==0.0.2 torchdiffeq==0.2.3 kornia==0.6.7 lark==1.1.2 inflection==0.5.1 GitPython==3.1.30 torchsde==0.2.5 safetensors==0.2.7 httpcore<=0.15 fastapi==0.94.0

1993226871 avatar Mar 28 '23 04:03 1993226871

the latest commit also has the same quesstion

1993226871 avatar Mar 28 '23 04:03 1993226871

I have the same problem after using upscaler. The following issues are possibly related and contain more info:
https://github.com/python-pillow/Pillow/issues/6123 https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8142#discussioncomment-5399875

a-l-e-x-d-s-9 avatar Mar 28 '23 10:03 a-l-e-x-d-s-9

您好,我已收到您的邮件。

1993226871 avatar Mar 28 '23 10:03 1993226871

@a-l-e-x-d-s-9 Yes, I have read these issues,and I use pillow 9.4.0,but this question seems to not be solved.And according to these issues,probhably b"b'Exif\x" should be b"Exif\x",it has one extra b'

1993226871 avatar Mar 28 '23 10:03 1993226871

any updates on this issue? I saw the same behavior today with inpainting.

AbslanX avatar Apr 17 '23 17:04 AbslanX

您好,我已收到您的邮件。

1993226871 avatar Apr 17 '23 17:04 1993226871

@AbslanX please see #9188

1993226871 avatar Apr 18 '23 09:04 1993226871

[is fix for this still to run the image through SD again and then upscale?)

Traceback (most recent call last): File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1145, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1784, in preprocess im = processing_utils.decode_base64_to_image(x) File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 49, in decode_base64_to_image exif = img.getexif() File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "C:\Users\SysOp\Anuciv\stableDiffusion\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid)

Is there final solutions?

johnny761127 avatar May 30 '23 12:05 johnny761127

您好,我已收到您的邮件。

1993226871 avatar May 30 '23 12:05 1993226871

I'm having the same problem

To create a public link, set share=True in launch(). Startup time: 27.6s (import torch: 5.5s, import gradio: 1.3s, import ldm: 0.5s, other imports: 1.0s, setup codeformer: 0.1s, load scripts: 2.7s, load SD checkpoint: 5.7s, create ui: 10.3s, gradio launch: 0.4s). Traceback (most recent call last): File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1145, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "E:\Documents\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 109, in svg_preprocess return preprocess(inputs) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1784, in preprocess im = processing_utils.decode_base64_to_image(x) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 49, in decode_base64_to_image exif = img.getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid) Traceback (most recent call last): File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1145, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "E:\Documents\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 109, in svg_preprocess return preprocess(inputs) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1784, in preprocess im = processing_utils.decode_base64_to_image(x) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 49, in decode_base64_to_image exif = img.getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid) Traceback (most recent call last): File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1145, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "E:\Documents\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 109, in svg_preprocess return preprocess(inputs) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1784, in preprocess im = processing_utils.decode_base64_to_image(x) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 49, in decode_base64_to_image exif = img.getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid) Traceback (most recent call last): File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1145, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "E:\Documents\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 109, in svg_preprocess return preprocess(inputs) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1784, in preprocess im = processing_utils.decode_base64_to_image(x) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 49, in decode_base64_to_image exif = img.getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid) Traceback (most recent call last): File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1145, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "E:\Documents\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 109, in svg_preprocess return preprocess(inputs) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1784, in preprocess im = processing_utils.decode_base64_to_image(x) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 49, in decode_base64_to_image exif = img.getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid) Traceback (most recent call last): File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1145, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "E:\Documents\AI\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 109, in svg_preprocess return preprocess(inputs) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1784, in preprocess im = processing_utils.decode_base64_to_image(x) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 49, in decode_base64_to_image exif = img.getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "E:\Documents\AI\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid)

highjohnconquer avatar Jun 07 '23 00:06 highjohnconquer

According to my experience and #11126, this problem seems to happen because:

  1. the current webui saved some wrong information into the picure.
  2. so that it can not be properly read by other functions. In my case, I want to use the picture in ControlNet, and I found that only several pictures generated by webui can not be used, other pictures work well.

Neph0s avatar Jun 11 '23 15:06 Neph0s

+1

oracle9i88 avatar Jun 21 '23 23:06 oracle9i88

Traceback (most recent call last): File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 414, in run_predict output = await app.get_blocks().process_api( File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1321, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1171, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1792, in preprocess im = processing_utils.decode_base64_to_image(x) File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 52, in decode_base64_to_image exif = img.getexif() File "D:\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "D:\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "D:\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "D:\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid)

wxfcgzht avatar Jun 24 '23 01:06 wxfcgzht

Same.

Traceback (most recent call last): File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 414, in run_predict output = await app.get_blocks().process_api( File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1321, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1171, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1792, in preprocess im = processing_utils.decode_base64_to_image(x) File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 52, in decode_base64_to_image exif = img.getexif() File "D:\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1040, in getexif return super().getexif() File "D:\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif self._exif.load(exif_info) File "D:\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3670, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "D:\stable-diffusion-webui\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 504, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid)

Mark-Tomlinson avatar Jul 04 '23 04:07 Mark-Tomlinson

I'm having this same issue. When I use the "Extras" tab and resize an image (in my case I'm using 4x+ AnimeB6) and then try to use that same image in ControlNet I get that error.

Does anyone know a fix for this?

3Diva avatar Jul 10 '23 07:07 3Diva

same, while trying to upscale big image inn extras, and i dont have controlnet Traceback (most recent call last): File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\routes.py", line 414, in run_predict output = await app.get_blocks().process_api( File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1321, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1171, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\components.py", line 1792, in preprocess im = processing_utils.decode_base64_to_image(x) File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\processing_utils.py", line 52, in decode_base64_to_image exif = img.getexif() File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1028, in getexif return super().getexif() File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\PIL\Image.py", line 1455, in getexif self._exif.load(exif_info) File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\PIL\Image.py", line 3719, in load self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head) File "M:\SD\stable-diffusion-webui-directml\venv\lib\site-packages\PIL\TiffImagePlugin.py", line 507, in init raise SyntaxError(msg) SyntaxError: not a TIFF file (header b"b'Exif\x" not valid)

eloe79 avatar Jul 10 '23 16:07 eloe79

Same error message here, trying to run upscaling under the extra tab, then use the outputted png file to upscale again, but looks like it doesn't like its last own output last time

SyntaxError: not a TIFF file (header b"b'Exif\\x" not valid)

linjunshi avatar Jul 12 '23 03:07 linjunshi

+1 The same

VitaliyAT avatar Jul 12 '23 14:07 VitaliyAT

This may be a problem with the image format generated by SD, a temporary solution: Open the picture with picture editing software and save it, and the possible picture format errors will be automatically corrected. For example, open the picture with photoshop, do not modify the picture, just unlock the layer, and then save the picture. It will be no problem to use this picture in SD again.

EricLi2017 avatar Jul 14 '23 07:07 EricLi2017

This may be a problem with the image format generated by SD, a temporary solution: Open the picture with picture editing software and save it, and the possible picture format errors will be automatically corrected. For example, open the picture with photoshop, do not modify the picture, just unlock the layer, and then save the picture. It will be no problem to use this picture in SD again.

Thank you for the temp fix for this. I'll give it a try. Hopefully this is an issue that will be fixed so one doesn't have to go through the extra step of opening the image up in an image editor and then resaving it. It's a bit of a hasle and definitely slows down the workflow. Hopefully there will be a fix for the issue soon. :) Thanks again for the tip!

3Diva avatar Jul 15 '23 16:07 3Diva

您好,我已收到您的邮件。

1993226871 avatar Aug 03 '23 16:08 1993226871

This continues to be a problem for me.

iOS source images from an Apple XS ... full error:

!!! Exception during processing !!!
Traceback (most recent call last):
  File "E:\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI\ComfyUI\execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI\ComfyUI\nodes.py", line 1487, in load_image
    for i in ImageSequence.Iterator(img):
  File "E:\ComfyUI\python_embeded\Lib\site-packages\PIL\ImageSequence.py", line 50, in __next__
    self.im.seek(self.position)
  File "E:\ComfyUI\python_embeded\Lib\site-packages\PIL\MpoImagePlugin.py", line 151, in seek
    self._reload_exif()
  File "E:\ComfyUI\python_embeded\Lib\site-packages\PIL\Image.py", line 1459, in _reload_exif
    self.getexif()
  File "E:\ComfyUI\python_embeded\Lib\site-packages\PIL\Image.py", line 1443, in getexif
    self._exif.load(exif_info)
  File "E:\ComfyUI\python_embeded\Lib\site-packages\PIL\Image.py", line 3730, in load
    self._info = TiffImagePlugin.ImageFileDirectory_v2(self.head)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI\python_embeded\Lib\site-packages\PIL\TiffImagePlugin.py", line 511, in __init__
    raise SyntaxError(msg)
SyntaxError: not a TIFF file (header b'http://n' not valid)

gonzalu avatar Mar 12 '24 19:03 gonzalu

您好,我已收到您的邮件。

1993226871 avatar Mar 12 '24 19:03 1993226871

This is still an error, but looks to be in the dependent library and not webui. Might be a way to invoke the library differently to avoid this behavior but otherwise dependent on inherited error. Quickest fix for me was bypassing transposition conditional on the exif data, thus replacing function at line 579 in Lib\site-packages\PIL\ImageOps.py with:

def exif_transpose(image):

return image.copy()

lenankamp avatar May 03 '24 19:05 lenankamp

您好,我已收到您的邮件。

1993226871 avatar May 03 '24 19:05 1993226871

In my case, updating the Pillow version to 10.3.0, It solved the problem.

zhangp365 avatar Jun 07 '24 01:06 zhangp365