mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
4d76116152
Without locally scoped (to the script) environment variables, this script can only be run once and then you need to start a new cmd session to get a clean environment. Surrounding the script with setlocal/endlocal achieves this. https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setlocal https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/endlocal
35 lines
927 B
Batchfile
35 lines
927 B
Batchfile
@echo off
|
|
|
|
REM isolate changes to environment variables so that this can be run again with restarting a cmd session
|
|
setlocal
|
|
|
|
PUSHD "%~dp0"
|
|
set INSTALL_ENV_DIR=%cd%\installer_files\env
|
|
set PATH=%INSTALL_ENV_DIR%;%INSTALL_ENV_DIR%\Library\bin;%INSTALL_ENV_DIR%\Scripts;%INSTALL_ENV_DIR%\Library\usr\bin;%PATH%
|
|
|
|
call conda activate invokeai
|
|
|
|
echo Do you want to generate images using the
|
|
echo 1. command-line
|
|
echo 2. browser-based UI
|
|
echo 3. open the developer console
|
|
set /P restore="Please enter 1, 2 or 3: "
|
|
IF /I "%restore%" == "1" (
|
|
echo Starting the InvokeAI command-line..
|
|
python scripts\invoke.py %*
|
|
) ELSE IF /I "%restore%" == "2" (
|
|
echo Starting the InvokeAI browser-based UI..
|
|
python scripts\invoke.py --web %*
|
|
) ELSE IF /I "%restore%" == "3" (
|
|
echo Developer Console
|
|
call where python
|
|
call python --version
|
|
|
|
cmd /k
|
|
) ELSE (
|
|
echo Invalid selection
|
|
pause
|
|
exit /b
|
|
)
|
|
endlocal
|