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]: Newest commit throws error when hitting Generate #77

Closed
1 task done
steyRNG opened this issue Apr 16, 2023 · 12 comments
Closed
1 task done

[Bug]: Newest commit throws error when hitting Generate #77

steyRNG opened this issue Apr 16, 2023 · 12 comments

Comments

@steyRNG
Copy link

steyRNG commented Apr 16, 2023

Is there an existing issue for this?

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

What happened?

Can't generate Pictures anymore with newest commit, throws error instantly when hitting "Generate" and doesn't output pictures. When going back to commit dae3394 everything works as usual.

Steps to reproduce the problem

Update to newest commit,
start webui, hit generate, observe error in console.

What should have happened?

Pictures Generated like normal

Commit where the problem happens

b48ae2b

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--opt-sub-quad-attention --no-half --disable-nan-check --opt-split-attention-v1 --precision full

List of extensions

image

Console logs

Error completing request
Arguments: ('task(0gbg9qoxgznzybv)', '', '', [], 28, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, [], 0, <scripts.external_code.ControlNetUnit object at 0x0000014FC8AB6FB0>, <scripts.external_code.ControlNetUnit object at 0x0000014FC8AB6FE0>, False, '', 0.5, True, False, '', 'Lerp', False, False, False, 'Horizontal', '1,1', '0.2', False, False, False, 'Attention', False, False, False, False, False, 'positive', 'comma', 0, False, False, '', 1, '', 0, '', 0, '', True, False, False, False, 0, None, False, None, False, 50) {}
Traceback (most recent call last):
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\txt2img.py", line 56, in txt2img
    processed = process_images(p)
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\processing.py", line 503, in process_images
    res = process_images_inner(p)
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\processing.py", line 653, 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 "G:\Other\AI\stable-diffusion-webui-directml\modules\processing.py", line 869, in sample
    samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\sd_samplers_kdiffusion.py", line 358, in sample
    samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\sd_samplers_kdiffusion.py", line 234, in launch_sampling
    return func()
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\sd_samplers_kdiffusion.py", line 358, in <lambda>
    samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
  File "G:\Other\AI\stable-diffusion-webui-directml\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "G:\Other\AI\stable-diffusion-webui-directml\repositories\k-diffusion\k_diffusion\sampling.py", line 150, in sample_euler_ancestral
    denoised = model(x, sigmas[i] * s_in, **extra_args)
  File "G:\Other\AI\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\sd_samplers_kdiffusion.py", line 126, in forward
    x_out = self.inner_model(x_in, sigma_in, cond=make_condition_dict([cond_in], image_cond_in))
  File "G:\Other\AI\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "G:\Other\AI\stable-diffusion-webui-directml\repositories\k-diffusion\k_diffusion\external.py", line 112, in forward
    eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
  File "G:\Other\AI\stable-diffusion-webui-directml\repositories\k-diffusion\k_diffusion\external.py", line 72, in sigma_to_t
    low_idx = dists.ge(0).cumsum(dim=0).argmax(dim=0).clamp(max=self.log_sigmas.shape[0] - 2)
RuntimeError: Falscher Parameter.

Additional information

CPU: 5950x
RAM: 32GB
GPU: 7900 XTX
VRAM: 24GB

@hanzoro5
Copy link

The last two updates break everything. The webUI interface does not function properly, now I can't even generate an image anymore.

@Lumpsack
Copy link

Go back to the old version of devices.py, it should work then (or at least it did for me) - by the way this issue is a duplicate of the one above it in the list currently.

@lshqqytiger
Copy link
Owner

Please run pip show torch-directml and copy output here.

@steyRNG
Copy link
Author

steyRNG commented Apr 16, 2023

Please run pip show torch-directml and copy output here.

PS G:\Other\AI\stable-diffusion-webui-directml> pip show torch-directml
WARNING: Package(s) not found: torch-directml
PS G:\Other\AI\stable-diffusion-webui-directml> .\venv\Scripts\activate
(venv) PS G:\Other\AI\stable-diffusion-webui-directml> pip show torch-directml
Name: torch-directml
Version: 0.1.13.1.dev230301
Summary: A DirectML backend for hardware acceleration in PyTorch.
Home-page: https://github.com/microsoft/directml
Author: Microsoft Corporation
Author-email: askdirectml@microsoft.com
License: MIT
Location: g:\other\ai\stable-diffusion-webui-directml\venv\lib\site-packages
Requires: torch, torchvision
Required-by:

@lshqqytiger
Copy link
Owner

Run pip install torch-directml --upgrade and try again.
Latest commit does not support older version of DirectML anymore.

@steyRNG
Copy link
Author

steyRNG commented Apr 16, 2023

Okay, works with updated Torch-DirectML. Was there any announcement i missed? Since it doesn't get updated automatically and it isn't in the requirements.txt i missed updating it as well before reporting

@steyRNG steyRNG closed this as completed Apr 16, 2023
@lshqqytiger
Copy link
Owner

lshqqytiger commented Apr 16, 2023

I forgot to mention this change in commit because I automatically checks for update of torch-directml.
I'll add a warning/announcement in commit when next update releases.

@Lumpsack
Copy link

Lumpsack commented Apr 16, 2023

Hi,

I tried the upgrade and check then copied back the device.py file - same error for me:, I've included the current results - is there something else that needs changing?
Ignore the users part, thats just replaced text - the rest is valid.

Cheers


D:\GitHub\stable-diffusion-webui-directml\modules>pip show torch-directml
Name: torch-directml
Version: 0.1.13.1.dev230413
Summary: A DirectML backend for hardware acceleration in PyTorch.
Home-page: https://github.com/microsoft/directml
Author: Microsoft Corporation
Author-email: askdirectml@microsoft.com
License: MIT
Location: c:\users<username>\appdata\local\programs\python\python310\lib\site-packages
Requires: torch, torchvision
Required-by:

D:\GitHub\stable-diffusion-webui-directml\modules>pip install torch-directml --upgrade
Requirement already satisfied: torch-directml in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (0.1.13.1.dev230413)
Requirement already satisfied: torch==1.13.1 in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from torch-directml) (1.13.1)
Requirement already satisfied: torchvision==0.14.1 in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from torch-directml) (0.14.1)
Requirement already satisfied: typing-extensions in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from torch==1.13.1->torch-directml) (4.5.0)
Requirement already satisfied: numpy in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from torchvision==0.14.1->torch-directml) (1.24.2)
Requirement already satisfied: requests in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from torchvision==0.14.1->torch-directml) (2.28.2)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from torchvision==0.14.1->torch-directml) (9.5.0)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from requests->torchvision==0.14.1->torch-directml) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from requests->torchvision==0.14.1->torch-directml) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from requests->torchvision==0.14.1->torch-directml) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in c:\users<username>\appdata\local\programs\python\python310\lib\site-packages (from requests->torchvision==0.14.1->torch-directml) (2022.12.7)

@Lumpsack
Copy link

For me, I trashed the old install and installed from fresh - working now, if a bit painful

@TeutonJon78
Copy link

I had a similar problem, and didn't want to convert everything over to a fresh install. So i tried just deleting the venv folder. When I started it again, it re-created it and everything starting generating just fine.

That's likely a round about way of running the updated command the is listed.

@Ptibouc77
Copy link

I had the same issue, and i found out someone on the original AUTOMATIC1111 github, that deleting the the venv folder fix the issue.
This did the trick for me.
Be sure to make a backup of your original venv folder just in case.

@FreeBlues
Copy link

Thanks, it works after renaming the venv folder!

@lshqqytiger lshqqytiger unpinned this issue May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants