Upload gui.bat
Browse files
gui.bat
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
|
| 3 |
+
set PYTHON_VER=3.10.9
|
| 4 |
+
set CUDA_VISIBLE_DEVICES=1
|
| 5 |
+
:: Deactivate the virtual environment
|
| 6 |
+
call .\venv\Scripts\deactivate.bat
|
| 7 |
+
|
| 8 |
+
:: Activate the virtual environment
|
| 9 |
+
call .\venv\Scripts\activate.bat
|
| 10 |
+
set PATH=%PATH%;%~dp0venv\Lib\site-packages\torch\lib
|
| 11 |
+
|
| 12 |
+
:: If the first argument is --help, skip the validation step
|
| 13 |
+
if "%~1" equ "--help" goto :skip_validation
|
| 14 |
+
|
| 15 |
+
:: Validate requirements
|
| 16 |
+
::python.exe .\setup\validate_requirements.py
|
| 17 |
+
::if %errorlevel% neq 0 exit /b %errorlevel%
|
| 18 |
+
|
| 19 |
+
:skip_validation
|
| 20 |
+
|
| 21 |
+
:: If the exit code is 0, run the kohya_gui.py script with the command-line arguments
|
| 22 |
+
if %errorlevel% equ 0 (
|
| 23 |
+
REM Check if the batch was started via double-click
|
| 24 |
+
IF /i "%comspec% /c %~0 " equ "%cmdcmdline:"=%" (
|
| 25 |
+
REM echo This script was started by double clicking.
|
| 26 |
+
cmd /k python.exe kohya_gui.py %*
|
| 27 |
+
) ELSE (
|
| 28 |
+
REM echo This script was started from a command prompt.
|
| 29 |
+
python.exe kohya_gui.py %*
|
| 30 |
+
)
|
| 31 |
+
)
|