AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: --listen with --gradio-auth doesn't work #9617

Open Kallamamran opened 1 year ago

Kallamamran commented 1 year ago

Is there an existing issue for this?

What happened?

Web-UI disconnects with errors as soon as I try to do anything via remote connection over internet. Locally it works as it should

Steps to reproduce the problem

  1. Start with COMMANDLINE_ARGS=--listen --xformers --deepdanbooru --clip-models-path models/CLIP --ckpt-dir=Q:_Checkpoints --gradio-auth username:password
  2. Connect to A1111 via remote (I'm using duckduckdns and connecting to an external address because I don't like the random adress of the --share function)
  3. Log in
  4. Do anything. It's enough writing a prompt and then tabbing to the negative field
  5. "Something went wrong. Connection errored out."
  6. Click generate, nothing happens because of disconnection

image

What should have happened?

No error should happen and the interface should work as locally. As it did until a few days ago when I stupidly updated the Web-ui 😂 If it works, don't mess with it!

Commit where the problem happens

22bcc7be428c94e9408f589966c2040187245d81

What platforms do you use to access the UI ?

Windows, Android

What browsers do you use to access the UI ?

No response

Command Line Arguments

--listen --xformers --deepdanbooru --clip-models-path models/CLIP --ckpt-dir=Q:\_Checkpoints --gradio-auth username:password

List of extensions

multidiffusion-upscaler-for-automatic1111 | https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git | 70ca3c77 (Wed Apr 5 10:57:07 2023) | unknown openpose-editor | https://github.com/fkunn1326/openpose-editor.git | a63fefc3 (Thu Mar 30 08:11:41 2023) | unknown sd-webui-3d-open-pose-editor | https://github.com/nonnonstop/sd-webui-3d-open-pose-editor.git | 6004a31f (Sun Apr 9 05:42:42 2023) | unknown sd-webui-additional-networks | https://github.com/kohya-ss/sd-webui-additional-networks.git | d944d428 (Thu Apr 6 10:42:19 2023) | unknown sd-webui-controlnet | https://github.com/Mikubill/sd-webui-controlnet.git | e1885108 (Wed Apr 12 03:24:32 2023) | unknown sd_save_intermediate_images | https://github.com/AlUlkesh/sd_save_intermediate_images.git | 8115a847 (Mon Mar 27 13:58:26 2023) | unknown stable-diffusion-webui-composable-lora | https://github.com/opparco/stable-diffusion-webui-composable-lora.git | d4963e48 (Mon Feb 27 17:40:08 2023) | unknown stable-diffusion-webui-images-browser | https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git | 57040c31 (Tue Apr 11 18:15:08 2023) | unknown stable-diffusion-webui-two-shot | https://github.com/ashen-sensored/stable-diffusion-webui-two-shot.git | 6b55dd52 (Sun Apr 2 11:24:25 2023) | unknown LDSR | built-in |   |   Lora | built-in |   |   ScuNET | built-in |   |   SwinIR | built-in |   |   prompt-bracket-checker | built-in

Console logs

Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI

Launching Web UI with arguments: --listen --xformers --deepdanbooru --clip-models-path models/CLIP --ckpt-dir=Q:\_Checkpoints --gradio-auth username:password
Q:\A1111\venv\lib\site-packages\torchvision\transforms\functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be **removed in 0.17**. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.
  warnings.warn(
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
Loading weights [e6415c4892] from Q:\_Checkpoints\RealisticVision\realisticVisionV20_20.safetensors
Creating model from config: Q:\A1111\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: Q:\A1111\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(36): 1.5CharTurner_v1, 1.5irakli-1000, 1.5irakli-10000, 1.5irakli-1500, 1.5irakli-2000, 1.5irakli-2500, 1.5irakli-3000, 1.5irakli-3500, 1.5irakli-4000, 1.5irakli-4500, 1.5irakli-500, 1.5irakli-5000, 1.5irakli-5500, 1.5irakli-6000, 1.5irakli-6500, 1.5irakli-7000, 1.5irakli-7500, 1.5irakli-8000, 1.5irakli-8500, 1.5irakli-9000, 1.5irakli-9500, 1.5irakli, 1.5irakli10vpt-1000, 1.5irakli10vpt-1500, 1.5irakli10vpt-2000, 1.5irakli10vpt-2500, 1.5irakli10vpt-3000, 1.5irakli10vpt-500, 1.5irakli10vpt, 1.5irakli1vpt, 1.5LANCG, 1.5LANFALKEN-10T, 1.5LANFALKEN, 1.5LANHAKAN, 1.5LANMARTIN, ulzzang-6500
Textual inversion embeddings skipped(3): nartfixer, nfixer, nrealfixer
Model loaded in 2.9s (load weights from disk: 0.3s, create model: 0.4s, apply weights to model: 0.4s, apply half(): 0.5s, move model to device: 0.4s, load textual inversion embeddings: 0.8s).

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://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 14.3s (import torch: 1.4s, import gradio: 0.8s, import ldm: 0.4s, other imports: 0.9s, load scripts: 1.6s, load SD checkpoint: 3.0s, create ui: 2.0s, gradio launch: 4.1s).

Additional information

Running it locally it poses no problems whatsoever. It's only when attaching to the installation remotely AND using --gradio-auth. Without --gradio-auth it works both locally and remotely

nawka12 commented 1 year ago

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9074#issuecomment-1487697466

I have the same issue as yours. I tried this and it kinda works now.

JimWails commented 1 year ago

It's a BUG of gradio. They fixed it in this PR #Access http token for ws connection and merge it into gradio 3.25.0 . But currently this project can't directly upgrade gradio 3.25 (API will be wrong). At present, you can modify the routes.py file according to the above PR.

PorYoung commented 1 year ago

It's a BUG of gradio. They fixed it in this PR #Access http token for ws connection and merge it into gradio 3.25.0 . But currently this project can't directly upgrade gradio 3.25 (API will be wrong). At present, you can modify the routes.py file according to the above PR.

This has resolved the issue I was experiencing while using the "--gradio-auth" option. Thank you very much!