Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Cannot add middleware after an application has started #1229

Closed
kevin20210917 opened this issue May 16, 2023 · 3 comments
Closed
Labels
new Just added, you should probably sort this. Stale

Comments

@kevin20210917
Copy link

kevin20210917 commented May 16, 2023

⚠️If you do not follow the template, your issue may be closed without a response ⚠️

Kindly read and fill this form in its entirety.

0. Initial troubleshooting

Please check each of these before opening an issue. If you've checked them, delete this section of your bug report. Have you:

  • Updated the Stable-Diffusion-WebUI to the latest version?
  • Updated Dreambooth to the latest revision?
  • Completely restarted the stable-diffusion-webUI, not just reloaded the UI?
  • Read the Readme?

1. Please find the following lines in the console and paste them below.

#######################################################################################################
Initializing Dreambooth
If submitting an issue on github, please provide the below text for debugging purposes:

Python 3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)]
Commit hash: 3715ece0adce7bf7c5e9c5ab3710b2fdc3848f39
Installing requirements for Web UI

If submitting an issue on github, please provide the full startup log for debugging purposes.

Initializing Dreambooth
Dreambooth revision:
Successfully installed accelerate-0.18.0 fastapi-0.94.1 gitpython-3.1.31 requests-2.30.0 starlette-0.26.1 transformers-4.26.1

Does your project take forever to startup?
Repetitive dependency installation may be the reason.
Automatic1111's base project sets strict requirements on outdated dependencies.
If an extension is using a newer version, the dependency is uninstalled and reinstalled twice every startup.

[+] xformers version 0.0.19 installed.
[+] torch version 2.0.1+cu117 installed.
[+] torchvision version 0.15.2+cu117 installed.
[+] accelerate version 0.18.0 installed.
[+] diffusers version 0.14.0 installed.
[+] transformers version 4.26.1 installed.
[+] bitsandbytes version 0.35.4 installed.

#######################################################################################################

2. Describe the bug

CUDA SETUP: Loading binary D:\ProgramData\miniconda3\lib\site-packages\bitsandbytes\libbitsandbytes_cudaall.dll...
Running on local URL: http://0.0.0.0:8093

To create a public link, set share=True in launch().
Traceback (most recent call last):
File "E:\SDWebUI\sd.webui-AiArtist - 2\webui\launch.py", line 361, in
start()
File "E:\SDWebUI\sd.webui-AiArtist - 2\webui\launch.py", line 356, in start
webui.webui()
File "E:\SDWebUI\sd.webui-AiArtist - 2\webui\webui.py", line 232, in webui
app.add_middleware(GZipMiddleware, minimum_size=1000)
File "D:\ProgramData\miniconda3\lib\site-packages\starlette\applications.py", line 139, in add_middleware
raise RuntimeError("Cannot add middleware after an application has started")
RuntimeError: Cannot add middleware after an application has started

Screenshots/Config
If the issue is specific to an error while training, please provide a screenshot of training parameters or the
db_config.json file from /models/dreambooth/MODELNAME/db_config.json

3. Provide logs

If a crash has occurred, please provide the entire stack trace from the log, including the last few log messages before the crash occurred.

PASTE YOUR STACKTRACE HERE

4. Environment

What OS?
Windows Server 2019
If Windows - WSL or native?

What GPU are you using?
RTX 3090

@kevin20210917 kevin20210917 added the new Just added, you should probably sort this. label May 16, 2023
@github-actions
Copy link

This issue is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot added the Stale label May 31, 2023
@swumagic
Copy link

swumagic commented Jun 1, 2023

After each update, the requirements.txt must be modified as follows.
extensions\sd_dreambooth_extension\requirements.txt。it run ok。

accelerate~=0.18.0
bitsandbytes==0.35.4
dadaptation~=3.1
diffusers~=0.16.1
discord-webhook~=1.1.0
fastapi~=0.94.1
gitpython~=3.1.31
lion-pytorch~=0.0.7
Pillow~=9.5.0
tqdm~=4.64.1
transformers~=4.25.1 # > 4.26.x causes issues (db extension #1110)

@github-actions github-actions bot removed the Stale label Jun 2, 2023
@github-actions
Copy link

This issue is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot added the Stale label Jun 16, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Just added, you should probably sort this. Stale
Projects
None yet
Development

No branches or pull requests

2 participants