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

[Bug]: Upscaler [img2img],[extras] does not work anymore after update and gives a lot of errors.

Open CRCODE22 opened this issue 2 years ago • 10 comments

What happened?

The Upscaler does not work anymore in img2img and extras it will give a lot of errors in command prompt and show error in red letters in the extras picture preview. It will stop before it can even show progress in the GUI.

Steps to reproduce the problem

  1. img2img or extras and do an upscaling ESRGAN_4x and scale factor 2 resolution 512x768 with the script SD upscale
  2. Press Generate
  3. Errors shows up in command prompt and red error in the picture preview. Errors

What should have happened?

The normal behavior should be no errors in the command prompt and the image up scaling to perform and finish without errors.

Commit where the problem happens

Commit hash: 311354c0bb8930ea939d6aa6b3edd50c69301320

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

set COMMANDLINE_ARGS=--deepdanbooru --lowvram --opt-split-attention --xformers

Additional information, context and logs

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

', 64, 7, 2, 1, '', 0, '', True, False, False) {} Traceback (most recent call last): File "E:\Apps\stable-diffusion-webui\modules\call_queue.py", line 45, in f res = list(func(*args, **kwargs)) File "E:\Apps\stable-diffusion-webui\modules\call_queue.py", line 28, in f res = func(*args, **kwargs) File "E:\Apps\stable-diffusion-webui\modules\img2img.py", line 150, in img2img processed = modules.scripts.scripts_img2img.run(p, *args) File "E:\Apps\stable-diffusion-webui\modules\scripts.py", line 328, in run processed = script.run(p, *script_args) File "E:\Apps\stable-diffusion-webui\scripts\sd_upscale.py", line 77, in run processed = processing.process_images(p) File "E:\Apps\stable-diffusion-webui\modules\processing.py", line 471, in process_images res = process_images_inner(p) File "E:\Apps\stable-diffusion-webui\modules\processing.py", line 576, 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:\Apps\stable-diffusion-webui\modules\processing.py", line 912, in sample x = create_random_tensors([opt_C, self.height // opt_f, self.width // opt_f], seeds=seeds, subseeds=subseeds, subseed_strength=self.subseed_strength, seed_resize_from_h=self.seed_resize_from_h, seed_resize_from_w=self.seed_resize_from_w, p=self) File "E:\Apps\stable-diffusion-webui\modules\processing.py", line 367, in create_random_tensors noise = devices.randn(seed, noise_shape) File "E:\Apps\stable-diffusion-webui\modules\devices.py", line 85, in randn torch.manual_seed(seed) File "E:\Apps\stable-diffusion-webui\venv\lib\site-packages\torch\random.py", line 40, in manual_seed torch.cuda.manual_seed_all(seed) File "E:\Apps\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\random.py", line 113, in manual_seed_all lazy_call(cb, seed_all=True) File "E:\Apps\stable-diffusion-webui\venv\lib\site-packages\torch\cuda_init.py", line 156, in _lazy_call callable() File "E:\Apps\stable-diffusion-webui\venv\lib\site-packages\torch\cuda\random.py", line 111, in cb default_generator.manual_seed(seed) RuntimeError: Overflow when unpacking long

CRCODE22 avatar Jan 02 '23 03:01 CRCODE22

Yes. Same errors here.

lavalava45 avatar Jan 02 '23 09:01 lavalava45

It has become even worse stable-diffusion-webui is is no longer usable not even with a clean install I will make an appropiate bug report if the problem still exists later it happens when you do inpaint or txt2image generate. I tried reinstalling xformers with --reinstall-xformers --xformers did not solve the problem.

To create a public link, set share=True in launch(). Loading weights [fa1e4d6e] from E:\Apps2\stable-diffusion-webui\models\Stable-diffusion\model4.ckpt Applying cross attention optimization (Doggettx). Weights loaded. 100%|██████████████████████████████████████████████████████████████████████████████████| 25/25 [01:22<00:00, 3.31s/it] Error completing request███████████████████████████████████████████████████████████████| 25/25 [01:11<00:00, 2.98s/it]

Traceback (most recent call last): File "E:\Apps2\stable-diffusion-webui\modules\call_queue.py", line 45, in f res = list(func(*args, **kwargs)) File "E:\Apps2\stable-diffusion-webui\modules\call_queue.py", line 28, in f res = func(*args, **kwargs) File "E:\Apps2\stable-diffusion-webui\modules\txt2img.py", line 49, in txt2img processed = process_images(p) File "E:\Apps2\stable-diffusion-webui\modules\processing.py", line 471, in process_images res = process_images_inner(p) File "E:\Apps2\stable-diffusion-webui\modules\processing.py", line 578, in process_images_inner x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))] File "E:\Apps2\stable-diffusion-webui\modules\processing.py", line 578, in x_samples_ddim = [decode_first_stage(p.sd_model, samples_ddim[i:i+1].to(dtype=devices.dtype_vae))[0].cpu() for i in range(samples_ddim.size(0))] File "E:\Apps2\stable-diffusion-webui\modules\processing.py", line 406, in decode_first_stage x = model.decode_first_stage(x) File "E:\Apps2\stable-diffusion-webui\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "E:\Apps2\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 826, in decode_first_stage return self.first_stage_model.decode(z) File "E:\Apps2\stable-diffusion-webui\modules\lowvram.py", line 52, in first_stage_model_decode_wrap return first_stage_model_decode(z) File "E:\Apps2\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\autoencoder.py", line 90, in decode dec = self.decoder(z) File "E:\Apps2\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "E:\Apps2\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\model.py", line 631, in forward h = self.mid.attn_1(h) File "E:\Apps2\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "E:\Apps2\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\modules\diffusionmodules\model.py", line 258, in forward out = xformers.ops.memory_efficient_attention(q, k, v, attn_bias=None, op=self.attention_op) File "E:\Apps2\stable-diffusion-webui\venv\lib\site-packages\xformers\ops.py", line 862, in memory_efficient_attention return op.forward_no_grad( File "E:\Apps2\stable-diffusion-webui\venv\lib\site-packages\xformers\ops.py", line 305, in forward_no_grad return cls.FORWARD_OPERATOR( File "E:\Apps2\stable-diffusion-webui\venv\lib\site-packages\torch_ops.py", line 143, in call return self._op(*args, **kwargs or {}) RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

CRCODE22 avatar Jan 02 '23 18:01 CRCODE22

I also get errors when sending to img2img, but my error trace is different:

Traceback (most recent call last):
  File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict
    output = await app.blocks.process_api(
  File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 982, in process_api
    result = await self.call_function(fn_index, inputs, iterator)
  File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 824, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "D:\StableDiffusion\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 113, in <lambda>
    fn=lambda x: image_from_url_text(x),
  File "D:\StableDiffusion\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 42, in image_from_url_text
    is_in_right_dir = any([filename in fileset for fileset in shared.demo.temp_file_sets])
AttributeError: 'Blocks' object has no attribute 'temp_file_sets'

armandn avatar Jan 02 '23 19:01 armandn

For now, would that help you? Type

git checkout fd4461d44c7256d56889f5b5ed9fb660a859172f

and after that, you should be able to re-run the UI with webui-user.bat. That git command actually re-downloads the UI files from that branch silently (not like "git pull").

When the devs stabilize the code again,

git checkout master

...will bring you back to the current branch ("git pull" will be usable again, too).

For me, with latest "master" (251ecee6949c36e9df1d99a950b3e1af2b5fa2b6 commit) I have a lot of Gradio errors, and UI became unusable, hence going back to that fd4461d44c7256d56889f5b5ed9fb660a859172f branch helped me.

Thanks, @GalaxyTimeMachine, for that tip! :)

mart-hill avatar Jan 02 '23 21:01 mart-hill

git checkout fd4461d44c7256d56889f5b5ed9fb660a859172f

It would be great if that works but I am getting the following error:

E:\Apps\stable-diffusion-webui>git checkout fd4461d44c7256d56889f5b5ed9fb660a859172f fatal: reference is not a tree: fd4461d44c7256d56889f5b5ed9fb660a859172f

CRCODE22 avatar Jan 03 '23 01:01 CRCODE22

Automatic1111 could use some kind of beta/release cadence because dealing with breaking changes after just rebooting the WebUI is not pleasant.

EdHerdman avatar Jan 03 '23 01:01 EdHerdman

git checkout fd4461d

It would be great if that works but I am getting the following error:

E:\Apps\stable-diffusion-webui>git checkout fd4461d fatal: reference is not a tree: fd4461d

It's from this hint. I hope this branch still exists! :)

mart-hill avatar Jan 03 '23 03:01 mart-hill

img2img and inpaint give me the following error if I try to send them images...

Traceback (most recent call last):
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict
    output = await app.blocks.process_api(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(fn_index, inputs, iterator, request)
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 856, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Users\matt\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 110, in send_image_and_dimensions
    img = image_from_url_text(x)
  File "C:\Users\matt\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 57, in image_from_url_text
    image = Image.open(io.BytesIO(filedata))
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3147, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000002593BAA6F70>

Using args --listen --api --xformers

Veraxus avatar Jan 03 '23 17:01 Veraxus

Latest commit fixes sending images to Extras, but sending to img2img (or inpainting) causes...

Traceback (most recent call last):
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict
    output = await app.blocks.process_api(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(fn_index, inputs, iterator, request)
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 856, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Users\matt\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 113, in send_image_and_dimensions
    img = image_from_url_text(x)
  File "C:\Users\matt\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 60, in image_from_url_text
    image = Image.open(io.BytesIO(filedata))
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 3147, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000002B5776B5B20>
Traceback (most recent call last):
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict
    output = await app.blocks.process_api(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(fn_index, inputs, iterator, request)
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 856, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\matt\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Users\matt\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 113, in send_image_and_dimensions
    img = image_from_url_text(x)
  File "C:\Users\matt\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 59, in image_from_url_text
    filedata = base64.decodebytes(filedata.encode('utf-8'))
  File "C:\Users\matt\AppData\Local\Programs\Python\Python310\lib\base64.py", line 562, in decodebytes
    return binascii.a2b_base64(s)
binascii.Error: Invalid base64-encoded string: number of data characters (125) cannot be 1 more than a multiple of 4

Veraxus avatar Jan 03 '23 20:01 Veraxus

yup still broken in the img2img and inpaint, as the last user said.

gillopillo avatar Jan 15 '23 23:01 gillopillo

broken in every part of SD, literally unsuable, 3090

alexv0iceh avatar Jan 18 '23 17:01 alexv0iceh

Closing as stale.

catboxanon avatar Aug 03 '23 15:08 catboxanon