stable-diffusion-webui
stable-diffusion-webui copied to clipboard
img2img alternate script now CRASHING (was working 2 days ago)
Describe the bug
File "/home/arpi/stable/GUI/stable-diffusion-webui/modules/img2img.py", line 124, in img2img processed = modules.scripts.scripts_img2img.run(p, *args) File "/home/arpi/stable/GUI/stable-diffusion-webui/modules/scripts.py", line 159, in run processed = script.run(p, *script_args) File "/home/arpi/stable/GUI/stable-diffusion-webui/scripts/img2imgalt.py", line 180, in run processed = processing.process_images(p) File "/home/arpi/stable/GUI/stable-diffusion-webui/modules/processing.py", line 400, in process_images samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength) File "/home/arpi/stable/GUI/stable-diffusion-webui/scripts/img2imgalt.py", line 152, in sample_extra rec_noise = find_noise_for_image_sigma_adjustment(p, cond, uncond, cfg, st) File "/home/arpi/stable/GUI/stable-diffusion-webui/scripts/img2imgalt.py", line 79, in find_noise_for_image_sigma_adjustment cond_in = torch.cat([uncond, cond]) RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 77 but got size 154 for tensor number 1 in the list.
To Reproduce Steps to reproduce the behavior: upload (or use send to img2img) an 512x512 image to img2img tab. select img2img alternate test script set target size 1024x1024 (set steps, cfg scale, denoise etc values too, but they does not affect this bug) press Generate!
Expected behavior It should render an upscaled version of the uploaded image, without major differences. Now it's CRASHING. It did work until now (2 days old version for sure, dont know which recent commit broke that)
Desktop (please complete the following information):
- OS: Linux, Ubuntu 18 lts server, python 3.8.13
- Browser: Firefox latest on MacoS
- Commit revision ed769977f0d0f201d8e361d365102f18775fc62c
hmm, it's broken even if i set 512x512 as target size, or if i upload already upscaled 1024x1024 image...
@arpitest is this still an issue?
Im not sure if Im running into the same issue but in img2img when I try to upscale an image now it only pumps out 512 images even if I feed it a larger image. Thought it was a issue on my end with flags I was using or a recent update but I can't seem to get it to make larger than 512s anymore.
@arpitest is this still an issue?
it is working now. even with xformers, it did not work a week ago yet.
Unfortunately still don't work. Attempting to run that script failed with an exactly the same error.
How to reproduce:
- Send generated 512x512 or upload 512x512 to img2img tab.
- Just apply the script "img2img alternate script" with the same output resolution image settings 512x512. Script params does not effect at all.
Traceback (most recent call last):
File "E:\projects\stableDiffusion\stable-diffusion-webui\modules\ui.py", line 185, in f
res = list(func(*args, **kwargs))
File "E:\projects\stableDiffusion\stable-diffusion-webui\webui.py", line 57, in f
res = func(*args, **kwargs)
File "E:\projects\stableDiffusion\stable-diffusion-webui\modules\img2img.py", line 138, in img2img
processed = modules.scripts.scripts_img2img.run(p, *args)
File "E:\projects\stableDiffusion\stable-diffusion-webui\modules\scripts.py", line 317, in run
processed = script.run(p, *script_args)
File "E:\projects\stableDiffusion\stable-diffusion-webui\scripts\img2imgalt.py", line 213, in run
processed = processing.process_images(p)
File "E:\projects\stableDiffusion\stable-diffusion-webui\modules\processing.py", line 430, in process_images
res = process_images_inner(p)
File "E:\projects\stableDiffusion\stable-diffusion-webui\modules\processing.py", line 531, in process_images_inner
samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts)
File "E:\projects\stableDiffusion\stable-diffusion-webui\scripts\img2imgalt.py", line 187, in sample_extra
rec_noise = find_noise_for_image(p, cond, uncond, cfg, st)
File "E:\projects\stableDiffusion\stable-diffusion-webui\scripts\img2imgalt.py", line 35, in find_noise_for_image
cond_in = torch.cat([uncond, cond])
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 77 but got size 154 for tensor number 1 in the list.
Experimentally came to the conclusion, that an issue occurs in a case when a prompt exceed 75 tokens. With a prompt of tokens under 75 everything works like a charm.