mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-11 13:08:24 +02:00
Windows error handling
- cd to the script location on start of 'Start Stable Diffusion UI.cmd' - Bail out when downloading micromamba fails - add env variables SD_UI_BIND_IP and SD_UI_BIND_PORT to configure uvicorn
This commit is contained in:
parent
cfa6dc7836
commit
d3a90ccc0d
@ -1,5 +1,6 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
cd /d %~dp0
|
||||||
set PATH=C:\Windows\System32;%PATH%
|
set PATH=C:\Windows\System32;%PATH%
|
||||||
|
|
||||||
@rem set legacy installer's PATH, if it exists
|
@rem set legacy installer's PATH, if it exists
|
||||||
|
@ -37,6 +37,12 @@ if "%PACKAGES_TO_INSTALL%" NEQ "" (
|
|||||||
mkdir "%MAMBA_ROOT_PREFIX%"
|
mkdir "%MAMBA_ROOT_PREFIX%"
|
||||||
call curl -L "%MICROMAMBA_DOWNLOAD_URL%" > "%MAMBA_ROOT_PREFIX%\micromamba.exe"
|
call curl -L "%MICROMAMBA_DOWNLOAD_URL%" > "%MAMBA_ROOT_PREFIX%\micromamba.exe"
|
||||||
|
|
||||||
|
if "%ERRORLEVEL%" NEQ "0" (
|
||||||
|
echo "There was a problem downloading micromamba. Cannot continue."
|
||||||
|
pause
|
||||||
|
exit /b
|
||||||
|
)
|
||||||
|
|
||||||
@rem test the mamba binary
|
@rem test the mamba binary
|
||||||
echo Micromamba version:
|
echo Micromamba version:
|
||||||
call "%MAMBA_ROOT_PREFIX%\micromamba.exe" --version
|
call "%MAMBA_ROOT_PREFIX%\micromamba.exe" --version
|
||||||
|
@ -343,6 +343,9 @@ call python --version
|
|||||||
@set SD_UI_PATH=%cd%\ui
|
@set SD_UI_PATH=%cd%\ui
|
||||||
@cd stable-diffusion
|
@cd stable-diffusion
|
||||||
|
|
||||||
@uvicorn server:app --app-dir "%SD_UI_PATH%" --port 9000 --host 0.0.0.0
|
@if NOT DEFINED SD_UI_BIND_PORT set SD_UI_BIND_PORT=9000
|
||||||
|
@if NOT DEFINED SD_UI_BIND_IP set SD_UI_BIND_PORT=0.0.0.0
|
||||||
|
@uvicorn server:app --app-dir "%SD_UI_PATH%" --port %SD_UI_BIND_PORT% --host %SD_UI_BIND_IP%
|
||||||
|
|
||||||
|
|
||||||
@pause
|
@pause
|
||||||
|
@ -283,6 +283,6 @@ cd ..
|
|||||||
export SD_UI_PATH=`pwd`/ui
|
export SD_UI_PATH=`pwd`/ui
|
||||||
cd stable-diffusion
|
cd stable-diffusion
|
||||||
|
|
||||||
uvicorn server:app --app-dir "$SD_UI_PATH" --port ${SDUI_BIND_PORT:-9000} --host ${SDUI_BIND_IP:-0.0.0.0}
|
uvicorn server:app --app-dir "$SD_UI_PATH" --port ${SD_UI_BIND_PORT:-9000} --host ${SD_UI_BIND_IP:-0.0.0.0}
|
||||||
|
|
||||||
read -p "Press any key to continue"
|
read -p "Press any key to continue"
|
||||||
|
Loading…
Reference in New Issue
Block a user