AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
142.54k stars 26.88k forks source link

[Bug]: Even during a fresh install I cannot generate an image. #9277

Closed Deejay85 closed 1 year ago

Deejay85 commented 1 year ago

Is there an existing issue for this?

What happened?

Every time I try to create a new prompt, I get the same error no matter what I do. This happens with the auto downloaded version of Stable Diffusion 1.5, as well as with the latest version of Waifu Diffusion.

RuntimeError: CUDA error: misaligned address 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.

Doing a fresh install, both with and without command arguments, produces the same results.

Steps to reproduce the problem

  1. Type in the prompt
  2. Hit generate
  3. Shit bricks

What should have happened?

An image being generated.

Commit where the problem happens

22bcc7b

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

--theme=dark --medvram --xformers --no-half

List of extensions

No

Console logs

venv "S:\WaifuDiffusion\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: <none>
Installing requirements for Web UI
Launching Web UI with arguments: --theme=dark --medvram --xformers --no-half
Loading weights [e8f4b2225b] from S:\WaifuDiffusion\models\Stable-diffusion\Waifu Diffusion.ckpt
Creating model from config: S:\WaifuDiffusion\repositories\stable-diffusion-stability-ai\configs\stable-diffusion\v2-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 865.91 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0):
Model loaded in 3.8s (load weights from disk: 1.5s, find config: 0.6s, create model: 0.1s, apply weights to model: 0.4s, move model to device: 0.4s, load textual inversion embeddings: 0.8s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 7.7s (import torch: 1.0s, import gradio: 0.8s, import ldm: 0.4s, other imports: 0.7s, load scripts: 0.6s, load SD checkpoint: 3.9s, create ui: 0.2s).
 30%|████████████████████████▉                                                          | 6/20 [00:08<00:19,  1.40s/it]
Error completing request█████████████████                                               | 6/20 [00:03<00:09,  1.54it/s]
Arguments: ('task(w78xayvf79b62pz)', 'flower', '', [], 20, 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, False, False, 'positive', 'comma', 0, False, False, '', 1, '', 0, '', 0, '', True, False, False, False, 0) {}
Traceback (most recent call last):
  File "S:\WaifuDiffusion\modules\call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "S:\WaifuDiffusion\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "S:\WaifuDiffusion\modules\txt2img.py", line 56, in txt2img
    processed = process_images(p)
  File "S:\WaifuDiffusion\modules\processing.py", line 503, in process_images
    res = process_images_inner(p)
  File "S:\WaifuDiffusion\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 "S:\WaifuDiffusion\modules\processing.py", line 869, in sample
    samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
  File "S:\WaifuDiffusion\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 "S:\WaifuDiffusion\modules\sd_samplers_kdiffusion.py", line 234, in launch_sampling
    return func()
  File "S:\WaifuDiffusion\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 "S:\WaifuDiffusion\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "S:\WaifuDiffusion\repositories\k-diffusion\k_diffusion\sampling.py", line 145, in sample_euler_ancestral
    denoised = model(x, sigmas[i] * s_in, **extra_args)
  File "S:\WaifuDiffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "S:\WaifuDiffusion\modules\sd_samplers_kdiffusion.py", line 152, in forward
    devices.test_for_nans(x_out, "unet")
  File "S:\WaifuDiffusion\modules\devices.py", line 133, in test_for_nans
    if not torch.all(torch.isnan(x)).item():
RuntimeError: CUDA error: misaligned address
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.

Additional information

No response

Wite905 commented 1 year ago

same problem, did u find answer?

Deejay85 commented 1 year ago

I did find out what it was, but I hope it's not what your problem is. Recently my graphics card started artifacting even though it wasn't even above room temperature. Shortly after that, one of the fans ran like a jet turbine, and the other squeaked so badly that I had to apply duct tape to both of them… I'm not joking. In short, if your problem is the same as my problem, you may want to get a new graphics card, stat. Also, as a kind of workaround, you may not want to use x-formers, which of course means rendering will take two to three times as long, but it may work. If that doesn't solve it… I can't help you. :(

Wite905 commented 1 year ago

I did find out what it was, but I hope it's not what your problem is. Recently my graphics card started artifacting even though it wasn't even above room temperature. Shortly after that, one of the fans ran like a jet turbine, and the other squeaked so badly that I had to apply duct tape to both of them… I'm not joking. In short, if your problem is the same as my problem, you may want to get a new graphics card, stat. Also, as a kind of workaround, you may not want to use x-formers, which of course means rendering will take two to three times as long, but it may work. If that doesn't solve it… I can't help you. :(

well, I have new graphic card, so in my case only a complete reinstallation of windows system worked

akx commented 1 year ago

So this was either a hardware or driver issue. Glad you found some workarounds!