AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: Generation frequently gets stuck #11630

Open John-Keyberg opened 1 year ago

John-Keyberg commented 1 year ago

Is there an existing issue for this?

What happened?

Generations getting stuck randomly on arbitrary percentages of the progress bar, both on txt2img and img2img. This happens both for batch sizes or batch counts equato to 1 and greater than 1. All tested on 512x512 images with default checkpoint and several different samplers. Not using Restore Faces or High Res Fix, scripts, textual inversion or loras, just vanilla Automatic1111. The WebUI is still responsive after the generation gets stuck, but clicking Interrupt does nothing.

Frequency of the issue is probably about 30% of generations, and requires full restart after it happens, so the application is pretty much unusable for me as of now.

Tried updating my Nvidia driver to Nvidia Studio Driver 536.40. I use an RTX 3060. Will try to downgrade the driver next and see if it fixes the issue.

Steps to reproduce the problem

  1. Go to txt2img or im2img tab and type prompts.
  2. Press the Generate button.
  3. Either individual image or batch total progress gets stuck both on the WebUI and on the command prompt.

What should have happened?

Image should have been generated with progress bar completed.

Version or Commit where the problem happens

1.4.0

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

Cross attention optimization

Automatic

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--api

List of extensions

No.

Console logs

Already up to date.
venv "E:\AI Generation\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
Version: v1.4.0
Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8
Installing requirements
Launching Web UI with arguments: --api
No module 'xformers'. Proceeding without it.
*** "Disable all extensions" option was set, will not load any extensions ***
Loading weights [6ce0161689] from E:\AI Generation\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: E:\AI Generation\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode

Thanks for being a Gradio user! If you have questions or feedback, please join our Discord server and chat with us: https://discord.gg/feTf9x3ZSB
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
DiffusionWrapper has 859.52 M params.
Startup time: 5.0s (import torch: 1.3s, import gradio: 1.0s, import ldm: 0.4s, other imports: 0.7s, scripts list_optimizers: 0.4s, create ui: 0.7s, gradio launch: 0.2s).
preload_extensions_git_metadata for 17 extensions took 2.14s
Applying attention optimization: Doggettx... done.
Textual inversion embeddings loaded(0):
Model loaded in 3.7s (load weights from disk: 0.6s, find config: 0.1s, create model: 0.8s, apply weights to model: 0.7s, apply half(): 0.8s, move model to device: 0.6s).
100%|███████████████████████████████████████| 20/20 [00:10<00:00,  1.89it/s]
100%|███████████████████████████████████████| 20/20 [00:09<00:00,  2.21it/s]
100%|███████████████████████████████████████| 20/20 [00:04<00:00,  4.60it/s]
100%|███████████████████████████████████████| 20/20 [00:04<00:00,  4.52it/s]
100%|███████████████████████████████████████| 20/20 [00:04<00:00,  4.55it/s]
100%|███████████████████████████████████████| 20/20 [00:04<00:00,  4.37it/s]
100%|███████████████████████████████████████| 20/20 [00:04<00:00,  4.39it/s]
100%|███████████████████████████████████████| 20/20 [00:04<00:00,  4.38it/s]
100%|███████████████████████████████████████| 20/20 [00:04<00:00,  4.55it/s]
100%|███████████████████████████████████████| 20/20 [00:04<00:00,  4.39it/s]
Total progress: 100%|█████████████████████| 200/200 [01:00<00:00,  3.32it/s]
100%|███████████████████████████████████████| 20/20 [00:10<00:00,  1.89it/s]
100%|███████████████████████████████████████| 20/20 [00:11<00:00,  1.71it/s]
100%|███████████████████████████████████████| 20/20 [00:11<00:00,  1.74it/s]
Total progress:  30%|██████▌               | 60/200 [00:35<01:17,  1.80it/s]

Additional information

IssueStuk02 IssueStuk01

EugeoSynthesisThirtyTwo commented 1 year ago

Me too, (On RTX 3080 Ti)

John-Keyberg commented 1 year ago

I tried downgrading Nvidia drivers, didn't work. Tried reinstalling Automatic1111 from scratch, didn't work. Last, tried to run with the --xformers argument, and the issue substantially improved. Now it only happens in about 1% or less of generations, as opposed to 30%.

Asonael commented 1 year ago

Same issue, console shows 100% complete, webUI stuck at 90%. Happens quite often. Tried disabling all extensions, modifying command line arguments, changed models etc, to see if that was the issue with no luck.

RTX 3060, latest game ready drivers. (536.40 at time of post)

Screenshot 2023-07-08 215842

Refreshing the UI and attempting generation tells me there is a queue, meaning that even though the console shows 100%, it's hanging. CTRL+C to terminate gives me this error:

Interrupted with signal 2 in <frame at 0x0000016402C1B0F0, file 'C:\\Python\\lib\\threading.py', line 324, code wait>

Sorry if that isn't any help but just sharing what I can.

Kadah commented 1 year ago

This could be #10110

icelandno1 commented 1 year ago

I also encountered the same problem, hope it can be answered

Diamond-Shark-art commented 1 year ago

I had the same issue. I looked into the #10110, tried the tip to change the live preview display period, it seems to solve it for me. So weird. I set it to every 10 steps.