Reverting changes to startup commands

This commit is contained in:
bmaltais 2023-02-09 20:25:42 -05:00
parent 7bc93821a0
commit 56d171c55b
2 changed files with 6 additions and 28 deletions

23
gui.bat
View File

@ -1,23 +1,10 @@
@echo off @echo off
REM Use this batch file with the following options: set VENV_DIR=.\venv
REM -inbrowser - To launch the program in the browser set PYTHON=python
REM -server_port [port number] - To specify the server port
set inbrowserOption= call %VENV_DIR%\Scripts\activate.bat
set serverPortOption=
if "%1" == "-server_port" ( %PYTHON% kohya_gui.py
set serverPortOption=--server_port %2
if "%3" == "-inbrowser" (
set inbrowserOption=--inbrowser
)
) else if "%1" == "-inbrowser" (
set inbrowserOption=--inbrowser
if "%2" == "-server_port" (
set serverPortOption=--server_port %3
)
)
call .\venv\Scripts\activate.bat pause
python.exe kohya_gui.py %inbrowserOption% %serverPortOption%

11
gui.ps1
View File

@ -1,11 +1,2 @@
# Example command: .\gui.ps1 -server_port 8000 -inbrowser
param([string]$username="", [string]$password="", [switch]$inbrowser, [int]$server_port)
.\venv\Scripts\activate .\venv\Scripts\activate
python.exe kohya_gui.py
if ($server_port -le 0 -and $inbrowser -eq $false) {
Write-Host "Error: You must provide either the --server_port or --inbrowser argument."
exit 1
}
python.exe kohya_gui.py --username $username --password $password --server_port $server_port --inbrowser