camenduru / stable-diffusion-webui-colab

stable diffusion webui colab
The Unlicense
15.45k stars 2.6k forks source link

[Bug]: Encountered an error related to the ASGI application. #461

Closed LinChen017 closed 11 months ago

LinChen017 commented 11 months ago

What happened?

I attempted to replace all occurrences of "webui" and "stable-diffusion-webui" with "w" and "sdw," respectively, in order to evade Colab's detection.

$W = webui
$sdw = stable-diffusion-webui
!pip install python-dotenv --quiet
import dotenv  
import os  
dotenv.load_dotenv(
        os.path.join('/content/drive/MyDrive/ColabNotebooks/AI_Drawing', '.env')
)
w = os.getenv('$W')
sdw = os.getenv('$SDW')

Example of usage:

!git clone https://github.com/ashen-sensored/$sdw-two-shot /content/$sdw/extensions/$sdw-two-shot
!git clone https://github.com/thomasasfk/sd-$w-aspect-ratio-helper /content/$sdw/extensions/sd-$w-aspect-ratio-helper

Other changes:

Originally

!sed -i -e '''/        prepare_environment()/a\        os.system\(f\"""sed -i -e ''\"s/dict()))/dict())).cuda()/g\"'' /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py""")''' /content/stable-diffusion-webui/launch.py

Changed to.

import subprocess

txt = r'''/prepare_environment()/a\        os.system(f'sed -i -e "s/dict()))/dict())).cuda()/g" /content/''' + sdw + '''/repositories/stable-diffusion-stability-ai/ldm/util.py')'''
command = ["sed", "-i", "-e", txt, "/content/" + sdw + "/launch.py"]
subprocess.run(command)

ERROR

ERROR:    Exception in ASGI application
......omitted.......
KeyError: 'dataset'

Colab cell output


Status Legend:
(OK):download completed.
fatal: No names found, cannot describe anything.
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]
Version: <none>
Commit hash: baf6946e06249c5af9851c60171692c44ef633e0
Installing open_clip
Cloning Stable Diffusion into /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai...
Cloning Taming Transformers into /content/stable-diffusion-webui/repositories/taming-transformers...
Cloning K-diffusion into /content/stable-diffusion-webui/repositories/k-diffusion...
Cloning CodeFormer into /content/stable-diffusion-webui/repositories/CodeFormer...
Cloning BLIP into /content/stable-diffusion-webui/repositories/BLIP...
Installing requirements for CodeFormer
Installing requirements
Installing sd-webui-controlnet requirement: mediapipe
Installing sd-webui-controlnet requirement: svglib
Installing sd-webui-controlnet requirement: fvcore

Installing requirements for CivitAI Browser

Installing pycloudflared

Installing ImageReward requirement for image browser

Installing Deforum requirement: av
Installing Deforum requirement: pims

Installing rembg
Installing onnxruntime for REMBG extension
Installing pymatting for REMBG extension

Downloading pose_landmark_full.tflite...
Downloading pose_web.binarypb...
Downloading pose_solution_packed_assets.data...
Downloading pose_solution_simd_wasm_bin.wasm...
Downloading pose_solution_packed_assets_loader.js...
Downloading pose_solution_simd_wasm_bin.js...

Launching Web UI with arguments: --listen --xformers --enable-insecure-extension-access --theme dark --gradio-queue --multiple
2023-07-23 05:35:07.549052: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Additional Network extension not installed, Only hijack built-in lora
LoCon Extension hijack built-in lora successfully
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
2023-07-23 05:35:21,860 - ControlNet - INFO - ControlNet v1.1.233
ControlNet preprocessor location: /content/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2023-07-23 05:35:22,193 - ControlNet - INFO - ControlNet v1.1.233
all detected, remote.moe trying to connect...
Warning: Permanently added 'localhost.run' (RSA) to the list of known hosts.
all detected, cloudflared trying to connect...
Download cloudflared...: 100% 34.8M/34.8M [00:00<00:00, 303MB/s]
Image Browser: Creating database
Image Browser: Database created
Calculating sha256 for /content/stable-diffusion-webui/models/Stable-diffusion/cetusMix_v4.safetensors: *Deforum ControlNet support: enabled*
Public WebUI Colab URL: None 
Public WebUI Colab URL: https://31ea4f4d-cea7-4909.gradio.live 
Public WebUI Colab URL: https://37a3a2dbd829b6.lhr.life
Public WebUI Colab URL: https://happy-biography-marsh-george.trycloudflare.com
Startup time: 69.1s (import torch: 11.7s, import gradio: 1.3s, import ldm: 2.4s, other imports: 2.4s, setup codeformer: 0.3s, load scripts: 48.1s, create ui: 2.6s, gradio launch: 0.3s).
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/usr/local/lib/python3.10/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 165, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/usr/local/lib/python3.10/dist-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/usr/local/lib/python3.10/dist-packages/gradio/routes.py", line 271, in api_info
    return gradio.blocks.get_api_info(config, serialize)  # type: ignore
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 504, in get_api_info
    serializer = serializing.COMPONENT_MAPPING[type]()
KeyError: 'dataset'
b42b09ff12ca9cd70d78aa8210f8d4577ec513fc1484a68615385b8076292639
Loading weights [b42b09ff12] from /content/stable-diffusion-webui/models/Stable-diffusion/cetusMix_v4.safetensors
Creating model from config: /content/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Downloading (…)olve/main/vocab.json: 100% 961k/961k [00:00<00:00, 40.0MB/s]
Downloading (…)olve/main/merges.txt: 100% 525k/525k [00:00<00:00, 45.0MB/s]
Downloading (…)cial_tokens_map.json: 100% 389/389 [00:00<00:00, 2.27MB/s]
Downloading (…)okenizer_config.json: 100% 905/905 [00:00<00:00, 4.15MB/s]
Downloading (…)lve/main/config.json: 100% 4.52k/4.52k [00:00<00:00, 17.4MB/s]
Applying optimization: xformers... done.
Textual inversion embeddings loaded(9): bad-artist, bad-artist-anime, bad-hands-5, bad-image-v2-39000, bad_prompt_version2, EasyNegative, EasyNegativeV2, ng_deepnegative_v1_75t, verybadimagenegative_v1.3
Model loaded in 43.7s (calculate hash: 30.8s, load weights from disk: 1.0s, create model: 6.5s, apply weights to model: 5.0s, load textual inversion embeddings: 0.2s).
Interrupted with signal 2 in <frame at 0x5855ff398950, file '/usr/lib/python3.10/threading.py', line 324, code wait>

Which colab and model(s) were you using when the error occurred?

https://colab.research.google.com/github/Kameko017/SDWebUI/blob/main/%E3%80%8Ccetus_mix_v3_1_webui_colab_ipynb%E3%80%8D.ipynb#

Which Public WebUI Colab URL were you using when the error occurred?

gradio.live

If you used HiRes mode when the error occurred, please provide the Hires info

No response