Skip to content

Commit

Permalink
Reverting changes to startup commands
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais committed Feb 10, 2023
1 parent 7bc9382 commit 56d171c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
23 changes: 5 additions & 18 deletions gui.bat
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
@echo off

REM Use this batch file with the following options:
REM -inbrowser - To launch the program in the browser
REM -server_port [port number] - To specify the server port
set VENV_DIR=.\venv
set PYTHON=python

set inbrowserOption=
set serverPortOption=
call %VENV_DIR%\Scripts\activate.bat

if "%1" == "-server_port" (
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
)
)
%PYTHON% kohya_gui.py

call .\venv\Scripts\activate.bat
python.exe kohya_gui.py %inbrowserOption% %serverPortOption%
pause
11 changes: 1 addition & 10 deletions gui.ps1
Original file line number Diff line number Diff line change
@@ -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

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
python.exe kohya_gui.py

0 comments on commit 56d171c

Please sign in to comment.