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

[Bug]: Upscale Batch Proccess TypeError

Open Campfirecrucifix opened this issue 3 years ago • 5 comments

Is there an existing issue for this?

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

What happened?

When trying to upscale images through batch process or batch directory using these two images:

(Hetty) chathead (Gertrude) chathead

I get this error:

TypeError: cannot unpack non-iterable int object

I am only upscaling to 768x768 with crop to fit turned off, using Nearest upscaler at 0.1 visibility.

However, when doing it individually using single image it upscales it perfectly without a problem. ~~I have also tested this on commit f4535f6e4f001314bd155bc6e1b6908e02792b9a and batch process/batch directory works fine on these images.~~ I this might be happening due to the tiny image size (92x89, 115x152)

Steps to reproduce the problem

  1. Load images into batch process/batch from directory
  2. Use these settings: upscaling to 768x768 with crop to fit turned off, using Nearest upscaler at 0.1 visibility.
  3. Click generate

What should have happened?

It should upscale the images just how single image works.

Commit where the problem happens

8850fc23b6e8a8e210bdfe4aade81516fb5770f3

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=
git pull

call webui.bat

Additional information, context and logs

To create a public link, set share=True in launch(). Error completing request Arguments: (2, 1, <PIL.Image.Image image mode=RGB size=937x981 at 0x22B40204280>, None, 'C:\Users\User\Desktop\test', 'C:\Users\User\Desktop\test2', False, 0, 0, 0, 4, 768, 768, False, 2, 0, 0.2, True) {} Traceback (most recent call last): File "E:\StableDiffusion\stable-diffusion-webui\modules\call_queue.py", line 45, in f res = list(func(*args, **kwargs)) File "E:\StableDiffusion\stable-diffusion-webui\modules\call_queue.py", line 28, in f res = func(*args, **kwargs) File "E:\StableDiffusion\stable-diffusion-webui\modules\extras.py", line 214, in run_extras images.save_image(image, path=outpath, basename=basename, seed=None, prompt=None, extension=opts.samples_format, info=info, short_filename=True, File "E:\StableDiffusion\stable-diffusion-webui\modules\images.py", line 567, in save_image _atomically_save_image(image, fullfn_without_extension, extension) File "E:\StableDiffusion\stable-diffusion-webui\modules\images.py", line 544, in _atomically_save_image image_to_save.save(temp_file_path, format=image_format, quality=opts.jpeg_quality, pnginfo=pnginfo_data) File "E:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 2431, in save save_handler(self, fp, filename) File "E:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\PIL\PngImagePlugin.py", line 1377, in _save red, green, blue = transparency TypeError: cannot unpack non-iterable int object

Campfirecrucifix avatar Jan 08 '23 19:01 Campfirecrucifix

Doing some more testing I found out that commit f4535f6e4f001314bd155bc6e1b6908e02792b9a also has this problem but it is a lot less likely to occur.

For example the two images in my original post work in batch process on f4535f6e4f001314bd155bc6e1b6908e02792b9a but fail in the newest commit. I also found another image(down below) that throws the same error on the commit I said above as well as the most recent commit. All 3 of these pictures work without a problem doing single image.

Agility Trainer (course) chathead (historical)

Campfirecrucifix avatar Jan 09 '23 03:01 Campfirecrucifix

Seems to be an issue with image transparency? I had the same issue, but removing the alpha channel using Xnconvert seemed to fix it.

Romybaby avatar Jul 31 '23 04:07 Romybaby

Still present in latest version, here are 3 samplefiles:

tx_bm_karstaag_fireash tx_bm_karstaag_firespark tx_de_lutestrings_01

Rabcor avatar Apr 30 '24 08:04 Rabcor

made a possible fix for the from OP https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6534#issue- and https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6534#issuecomment-2084653452

  • https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15664

w-e-w avatar Apr 30 '24 10:04 w-e-w

made a possible fix for the from OP #6534 (comment) and #6534 (comment)

This worked for my sample files.

Rabcor avatar Apr 30 '24 13:04 Rabcor