2023-03-12 14:11:41 +00:00
|
|
|
# Activate the virtual environment
|
|
|
|
& .\venv\Scripts\activate
|
|
|
|
|
|
|
|
# Validate the requirements and store the exit code
|
|
|
|
python.exe .\tools\validate_requirements.py
|
|
|
|
|
2023-03-24 17:26:29 +00:00
|
|
|
# If the exit code is 0, read arguments from gui_parameters.txt (if it exists)
|
|
|
|
# and run the kohya_gui.py script with the command-line arguments
|
2023-03-12 14:11:41 +00:00
|
|
|
if ($LASTEXITCODE -eq 0) {
|
2023-03-24 17:26:29 +00:00
|
|
|
$argsFromFile = @()
|
|
|
|
if (Test-Path .\gui_parameters.txt) {
|
|
|
|
$argsFromFile = Get-Content .\gui_parameters.txt -Encoding UTF8 | Where-Object { $_ -notmatch "^#" } | Foreach-Object { $_ -split " " }
|
|
|
|
}
|
|
|
|
$args_combo = $argsFromFile + $args
|
|
|
|
Write-Host "The arguments passed to this script were: $args_combo"
|
|
|
|
python.exe kohya_gui.py $args_combo
|
|
|
|
}
|