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]: Upscale then Inpaint yields errors #7034

Closed
1 task done
BlinD266 opened this issue Jan 21, 2023 · 8 comments
Closed
1 task done

[Bug]: Upscale then Inpaint yields errors #7034

BlinD266 opened this issue Jan 21, 2023 · 8 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@BlinD266
Copy link

BlinD266 commented Jan 21, 2023

Is there an existing issue for this?

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

What happened?

Since most recent pull, using ANY upscaler and then attempting to inpaint the image afterwards yields the following error. Pre-pull upscaled images still inpaint fine. Tried on two machines that were working and both experience the same issue:

Arguments: ('task(yxldyiqvocchr0u)', 2, 'trying to inpaint', '', [], None, None, {'image': <PIL.Image.Image image mode=RGBA size=2048x2048 at 0x2C2D87213F0>, 'mask': <PIL.PngImagePlugin.PngImageFile image mode=RGBA size=2048x2048 at 0x2C2D8720970>}, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 0.75, -1.0, -1.0, 0, 0, 0, False, 512, 512, 0, 1, 32, 0, '', '', 0, '

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

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, 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, '', True, True, False, '

Deforum v0.5-webui-beta

', '

This script is deprecated. Please use the full Deforum extension instead.
\nUpdate instructions:

', '

github.com/deforum-art/deforum-for-automatic1111-webui/blob/automatic1111-webui/README.md

', '

discord.gg/deforum

') {}
Traceback (most recent call last):
File "D:\stable-diffusion-webui\stable-diffusion-webui\modules\call_queue.py", line 56, in f
res = list(func(*args, **kwargs))
File "D:\stable-diffusion-webui\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "D:\stable-diffusion-webui\stable-diffusion-webui\modules\img2img.py", line 94, in img2img
image = ImageOps.exif_transpose(image)
File "D:\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\PIL\ImageOps.py", line 588, in exif_transpose
exif = image.getexif()
File "D:\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 1454, in getexif
self._exif.load(exif_info)
File "D:\stable-diffusion-webui\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\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)

Steps to reproduce the problem

  1. Go to upscale an image 2x
  2. Drag image into inpaint and perform any combination of settings, inpaint a section and 'Generate'
  3. Error will dump to the console

What should have happened?

Inpainting should kick off without error / produce inpainted picture into img2img-images folder

Commit where the problem happens

f2eae61

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox, Google Chrome, Brave

Command Line Arguments

I've tried with no args and with the following:
--listen --xformers

Additional information, context and logs

No response

@BlinD266 BlinD266 added the bug-report Report of a bug, yet to be confirmed label Jan 21, 2023
@BlinD266
Copy link
Author

3rd party upscaling then importing into inpainting DO work without issue.

Something has changed with the way the upscalers are working in A1111 and inpainting processing them.

@BlinD266
Copy link
Author

This looks like it is now corrected with the new upgrade dependencies of pytorch and xformers that was rolled out today.

@g4ggia
Copy link

g4ggia commented Feb 20, 2023

I'm also having this issue occurring with upgraded dependencies and parameters similar as above. I'd recommend reopening this issue until it's resolved for good.

@mihaiiancu
Copy link

I have the same issue but only with the generated upscaled PNG. When using the JPG upscaled generated file, inpainting works OK

@ProGamerGov
Copy link
Contributor

Has anyone discovered a fix for this issue?

@ProGamerGov
Copy link
Contributor

Its an issue from PIL that should have been fixed: python-pillow/Pillow#6123

@1993226871
Copy link

I use pillow 9.4.0 to have a try ,but this question isn't solved,so I suggest to open this issue again.

@sevinclub
Copy link

sevinclub commented May 13, 2023

i have the exact same issue however could find a workaround by sending the image from inpainting to an extension called photopea (i think it doesnt really matter where you sent it, just make sure somewhere else) then sending it back to inpaint does indeed fix this issue. Didnt try with anything other than photopea atm but hope i could help anyway
just go full creative and you should be able to do a similiar workaround guys

i recommend loading the file into photopea extension then proceed to send it to img2img somehow inpaint is not available. Then finally sent it to inpaint. I can confirm it works everytime while its not when i upload into inpaint directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

6 participants