Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
1993226871 opened this issue Mar 28, 2023 · 27 comments
Closed
1 task done

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

1993226871 opened this issue Mar 28, 2023 · 27 comments
Labels
asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance

Comments

@1993226871
Copy link

Is there an existing issue for this?

  • 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

a9fed7c

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 1993226871 added the bug-report Report of a bug, yet to be confirmed label Mar 28, 2023
@1993226871
Copy link
Author

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
Copy link
Author

the latest commit also has the same quesstion

@a-l-e-x-d-s-9
Copy link

I have the same problem after using upscaler.
The following issues are possibly related and contain more info:
python-pillow/Pillow#6123
#8142 (comment)

@1993226871
Copy link
Author

1993226871 commented Mar 28, 2023 via email

@1993226871
Copy link
Author

1993226871 commented Mar 28, 2023

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

@AbslanX
Copy link

AbslanX commented Apr 17, 2023

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

@1993226871
Copy link
Author

1993226871 commented Apr 17, 2023 via email

@1993226871
Copy link
Author

@AbslanX please see #9188

@WingedWalrusLandingOnWater
Copy link

[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)

@johnny761127
Copy link

Is there final solutions?

@1993226871
Copy link
Author

1993226871 commented May 30, 2023 via email

@highjohnconquer
Copy link

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)

@Neph0s
Copy link

Neph0s commented Jun 11, 2023

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.

@oracle9i88
Copy link

+1

@wxfcgzht
Copy link

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
Copy link

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)

@3Diva
Copy link

3Diva commented Jul 10, 2023

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?

@eloe79
Copy link

eloe79 commented Jul 10, 2023

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)

@linjunshi
Copy link

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)

@VitaliyAT
Copy link

+1 The same

@EricLi2017
Copy link

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.

@3Diva
Copy link

3Diva commented Jul 15, 2023

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!

@catboxanon catboxanon added asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance and removed bug-report Report of a bug, yet to be confirmed labels Aug 3, 2023
@1993226871
Copy link
Author

1993226871 commented Aug 3, 2023 via email

@gonzalu
Copy link

gonzalu commented Mar 12, 2024

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)

@1993226871
Copy link
Author

1993226871 commented Mar 12, 2024 via email

@lenankamp
Copy link
Contributor

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()

@1993226871
Copy link
Author

1993226871 commented May 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance
Projects
None yet
Development

No branches or pull requests