From 56d171c55b43daaeb44f29a617747b29a8bb9003 Mon Sep 17 00:00:00 2001 From: bmaltais Date: Thu, 9 Feb 2023 20:25:42 -0500 Subject: [PATCH] Reverting changes to startup commands --- gui.bat | 23 +++++------------------ gui.ps1 | 11 +---------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/gui.bat b/gui.bat index 978abf2..fbf5101 100644 --- a/gui.bat +++ b/gui.bat @@ -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 \ No newline at end of file diff --git a/gui.ps1 b/gui.ps1 index e09df2e..4f799a1 100644 --- a/gui.ps1 +++ b/gui.ps1 @@ -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 \ No newline at end of file +python.exe kohya_gui.py \ No newline at end of file