inu-ai / stable-diffusion-webui-colab

Fork of camenduru/stable-diffusion-webui-colab
Apache License 2.0
29 stars 5 forks source link

Launch the webUI issue #3

Open Baronco opened 1 year ago

Baronco commented 1 year ago

Good morning Inugoya-san, I hope you are well.

Lately I have been having problems with the notebook when execute the code block "Launch the webUI".

this are my settings:

model: waifu-v14
vae: waifu-v14-anime2
localization: None

tunnel: gradio

This is the output error:

/content/stable-diffusion-webui
Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0]
Commit hash: ea9bd9fc7409109adcd61b897abc2c8881161256
Installing gfpgan
Installing clip
Installing open_clip
Cloning Stable Diffusion into repositories/stable-diffusion-stability-ai...
Cloning Taming Transformers into repositories/taming-transformers...
Cloning K-diffusion into repositories/k-diffusion...
Cloning CodeFormer into repositories/CodeFormer...
Cloning BLIP into repositories/BLIP...
Installing requirements for CodeFormer
Installing requirements for Web UI
Installing requirements for kohya sd-scripts

Cloning pixelization into /content/stable-diffusion-webui/extensions/pixelization/pixelization...

You are up to date with the most recent release.
Launching Web UI with arguments: --xformers --disable-nan-check --lowram --enable-console-prompts --enable-insecure-extension-access --disable-safe-unpickle --gradio-auth user:pass --share
2023-02-12 13:52:23.686483: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-02-12 13:52:23.868086: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-02-12 13:52:24.652498: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/lib/python3.8/dist-packages/cv2/../../lib64:/usr/lib64-nvidia
2023-02-12 13:52:24.652721: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/lib/python3.8/dist-packages/cv2/../../lib64:/usr/lib64-nvidia
2023-02-12 13:52:24.652751: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
/usr/local/lib/python3.8/dist-packages/pytorch_lightning/utilities/distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from `pytorch_lightning.utilities` instead.
  rank_zero_deprecation(
/usr/local/lib/python3.8/dist-packages/pytorch_lightning/utilities/distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v2.0.0. You can import it from `pytorch_lightning.utilities` instead.
  rank_zero_deprecation(
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
Calculating sha256 for /content/stable-diffusion-webui/models/Stable-diffusion/wd-1-4-anime_e2.ckpt: c76e0962bc60ccdc18e0dce387635b472b5a19038d637216030acbbe6eda2713
Loading weights [c76e0962bc] from /content/stable-diffusion-webui/models/Stable-diffusion/wd-1-4-anime_e2.ckpt
Creating model from config: /content/stable-diffusion-webui/models/Stable-diffusion/wd-1-4-anime_e2.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 42.3s (calculate hash: 28.7s, load weights from disk: 3.1s, create model: 9.1s, apply weights to model: 1.2s).
Running on local URL:  http://127.0.0.1:7860/
Running on public URL: https://a561c1af-abfa-481e.gradio.live/

This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces
Traceback (most recent call last):
  File "launch.py", line 361, in <module>
    start()
  File "launch.py", line 356, in start
    webui.webui()
  File "/content/stable-diffusion-webui/webui.py", line 232, in webui
    app.add_middleware(GZipMiddleware, minimum_size=1000)
  File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 135, in add_middleware
    raise RuntimeError("Cannot add middleware after an application has started")
RuntimeError: Cannot add middleware after an application has started
Killing tunnel 127.0.0.1:7860 <> https://a561c1af-abfa-481e.gradio.live/

What do you think is the problem?

I have not been able to fix it myself because I have no experience with this type of model.

Thank you very much for your work!

Thank you in advance.

inu-ai commented 1 year ago

Good morning Baronco.

It seems to be a bug in fastapi. https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/7791

Fixed in the latest WebUI. I have confirmed that it works, although there are a few warnings.

Thanks for the bug report.