diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 1fe15934..0102f41f 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -80,6 +80,12 @@ exit /b ) + @call pip install basicsr==1.4.2 || ( + @echo. & echo "Error installing the basicsr package necessary for GFPGAN (Face Correction). 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 "from gfpgan import GFPGANer; print(42)"') do if "%%a" NEQ "42" ( @echo. & echo "Dependency test failed! Error installing the packages necessary for GFPGAN (Face Correction). 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 @@ -278,6 +284,13 @@ call WHERE uvicorn > .tmp @echo. & echo "Stable Diffusion is ready!" & echo. +@set SD_DIR=%cd% + +@cd env\lib\site-packages +@set PYTHONPATH=%SD_DIR%;%cd% +@cd ..\..\.. +@echo PYTHONPATH=%PYTHONPATH% + @cd .. @set SD_UI_PATH=%cd%\ui @cd stable-diffusion diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index b1c6bf79..5195f9ab 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -279,6 +279,10 @@ fi printf "\n\nStable Diffusion is ready!\n\n" +SD_PATH=`pwd` +export PYTHONPATH="$SD_PATH;$SD_PATH/env/lib/python3.8/site-packages" +echo "PYTHONPATH=$PYTHONPATH" + cd .. export SD_UI_PATH=`pwd`/ui cd stable-diffusion diff --git a/ui/index.html b/ui/index.html index 21dbc759..b7d557a4 100644 --- a/ui/index.html +++ b/ui/index.html @@ -671,10 +671,12 @@ async function doMakeImage(reqBody) { for (let idx in res.output) { let imgBody = '' + let seed = 0 try { let imgData = res.output[idx] imgBody = imgData.data + seed = imgData.seed } catch (e) { console.log(imgBody) setStatus('request', 'invalid image', 'error')