From 476d6fe85df82a0232be5800ab8cd1a2e18ef6c0 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 15 Sep 2022 12:06:37 +0530 Subject: [PATCH 1/3] Force-install antlr4, since pip (incorrectly) skips installing it occasionally --- scripts/on_sd_start.bat | 6 ++++++ scripts/on_sd_start.sh | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 0361c51b..4ad08352 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -62,6 +62,12 @@ @call conda activate .\env + @call conda install -c conda-forge -y --prefix env antlr4-python3-runtime=4.8 || ( + @echo. & echo "Error installing antlr4-python3-runtime for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo. + pause + exit /b + ) + for /f "tokens=*" %%a in ('python -c "import torch; import ldm; import transformers; import numpy; import antlr4; print(42)"') do if "%%a" NEQ "42" ( @echo. & echo "Dependency test failed! Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:" & echo " 1. Run this installer again." & echo " 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md" & echo " 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB" & echo " 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues" & echo "Thanks!" & echo. pause diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index b999bc63..a9329c33 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -63,6 +63,14 @@ else conda activate ./env + if conda install -c conda-forge --prefix ./env -y antlr4-python3-runtime=4.8 ; then + echo "Installed. Testing.." + else + printf "\n\nError installing antlr4-python3-runtime for Stable Diffusion. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n" + read -p "Press any key to continue" + exit + fi + out_test=`python -c "import torch; import ldm; import transformers; import numpy; import antlr4; print(42)"` if [ "$out_test" != "42" ]; then printf "\n\nDependency test failed! Error installing the packages necessary for Stable Diffusion. Sorry about that, please try to:\n 1. Run this installer again.\n 2. If that doesn't fix it, please try the common troubleshooting steps at https://github.com/cmdr2/stable-diffusion-ui/blob/main/Troubleshooting.md\n 3. If those steps don't help, please copy *all* the error messages in this window, and ask the community at https://discord.com/invite/u9yhsFmEkB\n 4. If that doesn't solve the problem, please file an issue at https://github.com/cmdr2/stable-diffusion-ui/issues\nThanks!\n\n" From 31c324bcc3b938aa7a77371132180f4e7a28ae48 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 15 Sep 2022 13:06:37 +0530 Subject: [PATCH 2/3] Killed due to low RAM --- Troubleshooting.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Troubleshooting.md b/Troubleshooting.md index 315ec273..3fe2be06 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -16,6 +16,9 @@ This error can also be caused if you already have conda/miniconda/anaconda insta If nothing works, this could be due to a corrupted installation. Please try reinstalling this, by deleting the installed folder, and unzipping from the downloaded zip file. +## Killed uvicorn server:app --app-dir "$SD_UI_PATH" --port 9000 --host 0.0.0.0 +This happens if your PC ran out of RAM. Stable Diffusion requires a lot of RAM, and requires atleast 10 GB of RAM to work well. You can also try closing all other applications before running Stable Diffusion UI. + ## Green image generated This usually happens if you're running NVIDIA 1650 or 1660 Super. To solve this, please close and run the Stable Diffusion command on your computer. If you're using the older Docker-based solution (v1), please upgrade to v2: https://github.com/cmdr2/stable-diffusion-ui/tree/v2#installation From 3927dfa71d422b6bb5f3f828599e544d29cab4da Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 15 Sep 2022 13:06:54 +0530 Subject: [PATCH 3/3] Update Troubleshooting.md --- Troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Troubleshooting.md b/Troubleshooting.md index 3fe2be06..cab1783e 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -16,7 +16,7 @@ This error can also be caused if you already have conda/miniconda/anaconda insta If nothing works, this could be due to a corrupted installation. Please try reinstalling this, by deleting the installed folder, and unzipping from the downloaded zip file. -## Killed uvicorn server:app --app-dir "$SD_UI_PATH" --port 9000 --host 0.0.0.0 +## Killed uvicorn server:app --app-dir ... --port 9000 --host 0.0.0.0 This happens if your PC ran out of RAM. Stable Diffusion requires a lot of RAM, and requires atleast 10 GB of RAM to work well. You can also try closing all other applications before running Stable Diffusion UI. ## Green image generated