CoolFace
Apppublic

fluxdev/stable-diffusion-webui-forge

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes
webui.bat93 linesDownload Raw Back to root
1@echo off2 3if exist webui.settings.bat (4    call webui.settings.bat5)6 7if not defined PYTHON (set PYTHON=python)8if defined GIT (set "GIT_PYTHON_GIT_EXECUTABLE=%GIT%")9if not defined VENV_DIR (set "VENV_DIR=%~dp0%venv")10 11set SD_WEBUI_RESTART=tmp/restart12set ERROR_REPORTING=FALSE13 14mkdir tmp 2>NUL15 16%PYTHON% -c "" >tmp/stdout.txt 2>tmp/stderr.txt17if %ERRORLEVEL% == 0 goto :check_pip18echo Couldn't launch python19goto :show_stdout_stderr20 21:check_pip22%PYTHON% -mpip --help >tmp/stdout.txt 2>tmp/stderr.txt23if %ERRORLEVEL% == 0 goto :start_venv24if "%PIP_INSTALLER_LOCATION%" == "" goto :show_stdout_stderr25%PYTHON% "%PIP_INSTALLER_LOCATION%" >tmp/stdout.txt 2>tmp/stderr.txt26if %ERRORLEVEL% == 0 goto :start_venv27echo Couldn't install pip28goto :show_stdout_stderr29 30:start_venv31if ["%VENV_DIR%"] == ["-"] goto :skip_venv32if ["%SKIP_VENV%"] == ["1"] goto :skip_venv33 34dir "%VENV_DIR%\Scripts\Python.exe" >tmp/stdout.txt 2>tmp/stderr.txt35if %ERRORLEVEL% == 0 goto :activate_venv36 37for /f "delims=" %%i in ('CALL %PYTHON% -c "import sys; print(sys.executable)"') do set PYTHON_FULLNAME="%%i"38echo Creating venv in directory %VENV_DIR% using python %PYTHON_FULLNAME%39%PYTHON_FULLNAME% -m venv "%VENV_DIR%" >tmp/stdout.txt 2>tmp/stderr.txt40if %ERRORLEVEL% == 0 goto :activate_venv41echo Unable to create venv in directory "%VENV_DIR%"42goto :show_stdout_stderr43 44:activate_venv45set PYTHON="%VENV_DIR%\Scripts\Python.exe"46echo venv %PYTHON%47 48:skip_venv49if [%ACCELERATE%] == ["True"] goto :accelerate50goto :launch51 52:accelerate53echo Checking for accelerate54set ACCELERATE="%VENV_DIR%\Scripts\accelerate.exe"55if EXIST %ACCELERATE% goto :accelerate_launch56 57:launch58%PYTHON% launch.py %*59if EXIST tmp/restart goto :skip_venv60pause61exit /b62 63:accelerate_launch64echo Accelerating65%ACCELERATE% launch --num_cpu_threads_per_process=6 launch.py66if EXIST tmp/restart goto :skip_venv67pause68exit /b69 70:show_stdout_stderr71 72echo.73echo exit code: %errorlevel%74 75for /f %%i in ("tmp\stdout.txt") do set size=%%~zi76if %size% equ 0 goto :show_stderr77echo.78echo stdout:79type tmp\stdout.txt80 81:show_stderr82for /f %%i in ("tmp\stderr.txt") do set size=%%~zi83if %size% equ 0 goto :show_stderr84echo.85echo stderr:86type tmp\stderr.txt87 88:endofscript89 90echo.91echo Launch unsuccessful. Exiting.92pause93