AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: Error: Connection errored out. #9074

Open HaruomiX opened 1 year ago

HaruomiX commented 1 year ago

Is there an existing issue for this?

What happened?

This is my first time making a report on github, so I might miss a few things here and there.

I was using it normally for the first 5 minutes, after adding a couple of models, and changed model for the first time, it stayed refreshing for 5 minutes so I decided to refresh the page and now I see errors all over the page, when I type in the input box it shows an error and I can't change models it shows error there, I tried reloading UI, reinstalling the whole git and deleting the huggingface folder from ./cache sometimes it works but after 1 minute it breaks again

image

I've tried checking the browser console all I see is 1 error and its Firefox can’t establish a connection to the server at ws://127.0.0.1:7860/queue/join.

Steps to reproduce the problem

Unknown

What should have happened?

Should not show error messages and work normally.

Commit where the problem happens

955df775

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

None

List of extensions

Default

Console logs

venv "D:\Workspace\Stable Diffusion WebUI\stable-diffusion-webui\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: 955df7751eef11bb7697e2d77f6b8a6226b21e13
Installing requirements for Web UI
Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Loading weights [abcaf14e5a] from D:\Workspace\Stable Diffusion WebUI\stable-diffusion-webui\models\Stable-diffusion\anything-v3-full.safetensors
Creating model from config: D:\Workspace\Stable Diffusion WebUI\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (Doggettx).
Textual inversion embeddings loaded(0):
Model loaded in 5.2s (load weights from disk: 0.5s, create model: 0.6s, apply weights to model: 0.9s, apply half(): 0.9s, move model to device: 0.9s, load textual inversion embeddings: 1.3s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 15.7s (import torch: 2.7s, import gradio: 2.5s, import ldm: 0.6s, other imports: 2.6s, load scripts: 1.1s, load SD checkpoint: 5.6s, create ui: 0.4s, gradio launch: 0.1s).

Additional information

No response

congaterori commented 1 year ago

export COMMANDLINE_ARGS="--no-gradio-queue"

i am also having same issue but i use stable diffusion on google colab. can someone help me on it?

i used !COMMANDLINE_ARGS="--disable-safe-unpickle --no-half-vae --share --xformers --enable-insecure-extension --gradio-queue --cloudflared --theme dark" REQS_FILE="requirements.txt" python launch.py but it doesn't work so i changed into !COMMANDLINE_ARGS="--share --disable-safe-unpickle --no-half-vae --xformers --enable-insecure-extension --gradio-queue --theme dark" REQS_FILE="requirements.txt" python launch.py i am using counterfeit v2.5 on google colab Pay As You Go $9.99

also i put this in the console of google colab web so it can remain use while run

function ClickConnect() {
    console.log("Working");
    document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click();
}
setInterval(ClickConnect, 60000);
Moryanmeena commented 1 year ago

export COMMANDLINE_ARGS="--no-gradio-queue"

i am also having same issue but i use stable diffusion on google colab. can someone help me on it?

i used !COMMANDLINE_ARGS="--disable-safe-unpickle --no-half-vae --share --xformers --enable-insecure-extension --gradio-queue --cloudflared --theme dark" REQS_FILE="requirements.txt" python launch.py but it doesn't work so i changed into !COMMANDLINE_ARGS="--share --disable-safe-unpickle --no-half-vae --xformers --enable-insecure-extension --gradio-queue --theme dark" REQS_FILE="requirements.txt" python launch.py i am using counterfeit v2.5 on google colab Pay As You Go $9.99

also i put this in the console of google colab web so it can remain use while run

function ClickConnect() {
    console.log("Working");
    document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click();
}
setInterval(ClickConnect, 60000);

i dont know much can you tell where i have to put !COMMANDLINE_ARGS="--share --disable-safe-unpickle --no-half-vae --xformers --enable-insecure-extension --gradio-queue --theme dark" REQS_FILE="requirements.txt" python launch.py

Moryanmeena commented 1 year ago

pasting this in new cell says "python3: can't open file '/content/launch.py': [Errno 2] No such file or directory"

top5list commented 1 year ago

In my case, this error occurred because of the anti-virus application kaspersky premium. It blocked the connection of Public My WebUI 127.0.0.1:7860. The solution is to add 127.0.0.1:7860 to Kaspersky Premium's trusted address.

KarinMiku commented 1 year ago

In my case, this error occurred because of the anti-virus application kaspersky premium. It blocked the connection of Public My WebUI 127.0.0.1:7860. The solution is to add 127.0.0.1:7860 to Kaspersky Premium's trusted address.

oh kaspersky, always doing weird things.. thank u so much! your solution was what i needed, this antivirus seem to mess with most of the AI programs xD (had an issue like this with Okada's voice changer)

VrchDeveloper commented 12 months ago

I got it fixed by NOT adding --no-gradio-queue option, instead updating Nginx proxy settings as follows:

proxy_set_header    Upgrade     $http_upgrade;
proxy_set_header    Connection  "upgrade";

References

XTRMsavage commented 11 months ago

Just copy and paste export COMMANDLINE_ARGS="--no-gradio-queue" in your cli tool which you use to runbash webui.sh command, then press enter. And run this before run bash webui.sh, or you can put this command line in your ~/.bashrc file

I am just running Automatic1111 by 2x Clicking "webui-user.bat" file. How do I add this command line? I am not coding savvy :(

BrassaiKao commented 10 months ago

I have same issue when i use ngnix for proxy. And solved by setting proxy parameters that reference by Gradio's guide. By the way, this is not bug. It's he relationship of how Gradio Queue works.

Gradio's Guide running-gradio-on-your-web-server-with-nginx

Nginx Proxy Paramters

server { listen 80; server_name example.com www.example.com; location /gradio-demo/ { proxy_pass http://127.0.0.1:7860/; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } }

Nara915 commented 10 months ago

export COMMANDLINE_ARGS="--no-gradio-queue" worked for me. TOO thanks!

XQXE commented 10 months ago

取消外网,清除代理信息就可以

可部署在服务器上,只能用外网

哥们 你解决了吗

valterm commented 8 months ago

The webui was unusable while using an nginx reverse proxy to access my install remotely. Each connection got an "Connection errored out" warning, and I couldn't generate any images.

Can confirm that --no-gradio-queue fixed the issue.

scrypt-kitty commented 5 months ago

Just copy and paste export COMMANDLINE_ARGS="--no-gradio-queue" in your cli tool which you use to runbash webui.sh command, then press enter. And run this before run bash webui.sh, or you can put this command line in your ~/.bashrc file

usually i just run double click the batch file on windows. i dont usually run on a cli. do i run it like this? image then when i run my stable diffusion like this image

Just copy and paste export COMMANDLINE_ARGS="--no-gradio-queue" in your cli tool which you use to runbash webui.sh command, then press enter. And run this before run bash webui.sh, or you can put this command line in your ~/.bashrc file

I am just running Automatic1111 by 2x Clicking "webui-user.bat" file. How do I add this command line? I am not coding savvy :(

Open webui-user.bat and add set COMMANDLINE_ARGS=--no-gradio-queue

It still took a couple hundred seconds but I was able to run on the latest repo clone.

Sadamingh commented 5 months ago

When running webui.sh, add the argument --no-gradio-queue can also fix this issue. However, this is not the preferred way since the gradio queue has been disabled.

$ ./webui.sh --listen --no-gradio-queue

Actually, @BrassaiKao 's solution provides the insights. By adding only these two headers in the nginx conf fixed the problem.

...
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
...

Should add it to the error message to help with resolving this issue.

ipaqmaster commented 4 months ago
proxy_set_header    Upgrade     $http_upgrade;
proxy_set_header    Connection  "upgrade";

References

Websocket Connection Failed Through Nginx Proxy

Thanks this did the trick for me too.

pankajmyysports commented 1 month ago

Connection Errored Out. Tried this: export COMMANDLINE_ARGS="--no-gradio-queue" but in mac termial window i get: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown

luislascano01 commented 1 month ago

export COMMANDLINE_ARGS="--no-gradio-queue"

This worked for me on:

       .-/+oossssoo+/-.               luislascano01@LuisTensorTank 
    `:+ssssssssssssssssss+:`           ---------------------------- 
  -+ssssssssssssssssssyyssss+-         OS: Ubuntu 22.04.4 LTS x86_64 
.ossssssssssssssssssdMMMNysssso.       Host: Z790 AORUS ELITE X AX -CF 

/ssssssssssshdmmNNmmyNMMMMhssssss/ Kernel: 6.8.0-40-generic +ssssssssshmydMMMMMMMNddddyssssssss+ Uptime: 2 hours, 7 mins /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/ Packages: 2282 (dpkg), 9 (flatpak), 33 (snap) .ssssssssdMMMNhsssssssssshNMMMdssssssss. Shell: bash 5.1.16 +sssshhhyNMMNyssssssssssssyNMMMysssssss+ Resolution: 1080x1920, 1920x1080 ossyNMMMNyMMhsssssssssssssshmmmhssssssso DE: GNOME 42.9 ossyNMMMNyMMhsssssssssssssshmmmhssssssso WM: Mutter +sssshhhyNMMNyssssssssssssyNMMMysssssss+ WM Theme: Adwaita .ssssssssdMMMNhsssssssssshNMMMdssssssss. Theme: Yaru-purple-dark [GTK2/3] /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/ Icons: Yaru-purple [GTK2/3] +sssssssssdmydMMMMMMMMddddyssssssss+ Terminal: gnome-terminal /ssssssssssshdmNNNNmyNMMMMhssssss/ CPU: Intel i7-14700K (28) @ 5.500GHz .ossssssssssssssssssdMMMNysssso. GPU: Intel Device a780 -+sssssssssssssssssyyyssss+- GPU: NVIDIA 01:00.0 NVIDIA Corporation Device 2684 :+ssssssssssssssssss+: Memory: 10415MiB / 64062MiB .-/+oossssoo+/-.

ISP: AT&T. Router: RT-AX88U GPU: RTX-4090