-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
[Bug]: RuntimeError("Cannot add middleware after an application has started") #7759
Comments
This helped: Open the Command Prompt or the Windows PowerShell. Navigate to your Stable Diffusion folder using the cd command. For example, if your Stable Diffusion folder is located at C:\artificial-intelligence-tools\stable-diffusion-webui, you would run the following command: cd C:\artificial-intelligence-tools\stable-diffusion-webui Close cmd or powershell |
we have another issue for it here - #7714 |
.\venv\Scripts\python.exe -m pip install --upgrade fastapi==0.90.1 |
My problems is solved with your method, thank you very much. |
Same issue but not fixed after degrading my fastapi to either 0.90 or 0.89 I'm using the binary pakage in the release tab.
|
Installing requirements for Web UI To create a public link, set how to resolve this problem? |
I forgot to config Python path in webui_user. |
does anyone know why every single python project is plagued by this problem where you run the program and stop it, and then it won't start again, and nothing changed except for a bunch of invisible upstream shit you didn't ask for Is there any way I can immunize myself against this? I'm always having to burn a few hours figuring out why there is some insane conflict with a project that was otherwise running correctly. |
this works thanks somuch |
Just a stupid note but don't forget you gotta launch webui-user.bat and not webui.bat directly or the environment variables will not be set correctly! |
Thank you so much for this! This resolved my problem. |
same problem on 5ab7f21 |
Thank you |
On mac os # pull newest changes in repository
git pull
# update requirements
./venv/bin/python -m pip install -r requirements.txt |
This work in version 1.3.2, but needs to be repeated again and again as it immediately reverts the downgrade and updates to fastapi-0.94.0 when the relaunching. I found replacing the version number in "requirements_versions.txt" fixes this. Any idea if this will break anything? |
Still staggering on with this problem. I have to revert it every time it's updated. |
I don't see it on tag: v1.4.0, origin/master, hash 394ffa7, which is using |
Am indeed. |
I'm not sure what the problem could be, could you try removing your 'venv' directory and run with:
Where |
Try add " fastapi==0.90.1" in requirements_versions.txt file located in your SD folder. |
and added requirements.txt torchmetrics==0.11.4 and
I solved a lot of problems and finally I was able to open it |
|
Is there an existing issue for this?
What happened?
venv "C:\Users\tomwe\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: ea9bd9f
Installing requirements for Web UI
Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Loading weights [e406a20c1b] from C:\Users\tomwe\stable-diffusion-webui\models\Stable-diffusion\galaxytimemachinesGTM_v1.safetensors
Creating model from config: C:\Users\tomwe\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 2.6s (create model: 0.3s, apply weights to model: 0.6s, apply half(): 0.5s, move model to device: 0.5s, load textual inversion embeddings: 0.7s).
Running on local URL: http://127.0.0.1:7860
To create a public link, set
share=True
inlaunch()
.Traceback (most recent call last):
File "C:\Users\tomwe\stable-diffusion-webui\launch.py", line 361, in
start()
File "C:\Users\tomwe\stable-diffusion-webui\launch.py", line 356, in start
webui.webui()
File "C:\Users\tomwe\stable-diffusion-webui\webui.py", line 232, in webui
app.add_middleware(GZipMiddleware, minimum_size=1000)
File "C:\Users\tomwe\stable-diffusion-webui\venv\lib\site-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
Drücken Sie eine beliebige Taste . . .
Steps to reproduce the problem
Download latest version
Nothing special
What should have happened?
Start fine.
Commit where the problem happens
ea9bd9f
What platforms do you use to access the UI ?
Windows
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
List of extensions
never started
Console logs
Additional information
No response
The text was updated successfully, but these errors were encountered: