mirror of https://github.com/bmaltais/kohya_ss
Update requirements syntax (for windows)
parent
03e97424b9
commit
7d6ebcb7cd
6
gui.bat
6
gui.bat
|
|
@ -7,8 +7,14 @@ call .\venv\Scripts\deactivate.bat
|
|||
|
||||
:: Activate the virtual environment
|
||||
call .\venv\Scripts\activate.bat
|
||||
|
||||
:: Update pip to latest version
|
||||
python -m pip install --upgrade pip -q
|
||||
|
||||
set PATH=%PATH%;%~dp0venv\Lib\site-packages\torch\lib
|
||||
|
||||
echo Starting the GUI... this might take some time...
|
||||
|
||||
:: If the exit code is 0, run the kohya_gui.py script with the command-line arguments
|
||||
if %errorlevel% equ 0 (
|
||||
REM Check if the batch was started via double-click
|
||||
|
|
|
|||
5
gui.ps1
5
gui.ps1
|
|
@ -7,8 +7,13 @@ if ($env:VIRTUAL_ENV) {
|
|||
# Activate the virtual environment
|
||||
# Write-Host "Activating the virtual environment..."
|
||||
& .\venv\Scripts\activate
|
||||
|
||||
python.exe -m pip install --upgrade pip -q
|
||||
|
||||
$env:PATH += ";$($MyInvocation.MyCommand.Path)\venv\Lib\site-packages\torch\lib"
|
||||
|
||||
Write-Host "Starting the GUI... this might take some time..."
|
||||
|
||||
$argsFromFile = @()
|
||||
if (Test-Path .\gui_parameters.txt) {
|
||||
$argsFromFile = Get-Content .\gui_parameters.txt -Encoding UTF8 | Where-Object { $_ -notmatch "^#" } | Foreach-Object { $_ -split " " }
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ easygui==0.98.3
|
|||
einops==0.7.0
|
||||
fairscale==0.4.13
|
||||
ftfy==6.1.1
|
||||
gradio==5.0.1
|
||||
gradio==5.4.0
|
||||
huggingface-hub==0.25.2
|
||||
imagesize==1.4.1
|
||||
invisible-watermark==0.2.0
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
torch==2.4.1+cu124 --index-url https://download.pytorch.org/whl/cu124
|
||||
torchvision==0.19.1+cu124 --index-url https://download.pytorch.org/whl/cu124
|
||||
xformers==0.0.28.post1 --index-url https://download.pytorch.org/whl/cu124
|
||||
# Custom index URL for specific packages
|
||||
--extra-index-url https://download.pytorch.org/whl/cu124
|
||||
|
||||
torch==2.4.1+cu124
|
||||
torchvision==0.19.1+cu124
|
||||
xformers==0.0.28.post1
|
||||
|
||||
-r requirements_windows.txt
|
||||
|
|
@ -2,4 +2,5 @@ bitsandbytes==0.44.0
|
|||
tensorboard
|
||||
tensorflow>=2.16.1
|
||||
onnxruntime-gpu==1.17.1
|
||||
|
||||
-r requirements.txt
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 5fba6f514a0792851149ed1a7071070ee35cbeca
|
||||
Subproject commit 8549669f89ed05bb7ce0bf774a7c5589dc15df35
|
||||
|
|
@ -13,6 +13,9 @@ call .\venv\Scripts\deactivate.bat
|
|||
|
||||
call .\venv\Scripts\activate.bat
|
||||
|
||||
REM first make sure we have setuptools available in the venv
|
||||
python -m pip install --require-virtualenv --no-input -q -q setuptools
|
||||
|
||||
REM Check if the batch was started via double-click
|
||||
IF /i "%comspec% /c %~0 " equ "%cmdcmdline:"=%" (
|
||||
REM echo This script was started by double clicking.
|
||||
|
|
|
|||
|
|
@ -158,16 +158,16 @@ def install_requirements_inbulk(
|
|||
log.error(f"Could not find the requirements file in {requirements_file}.")
|
||||
return
|
||||
|
||||
log.info(f"Installing requirements from {requirements_file}...")
|
||||
log.info(f"Installing/Validating requirements from {requirements_file}...")
|
||||
|
||||
if upgrade:
|
||||
optional_parm += " -U"
|
||||
optional_parm += " -U" if upgrade else ""
|
||||
|
||||
if show_stdout:
|
||||
run_cmd(f"pip install -r {requirements_file} {optional_parm}")
|
||||
else:
|
||||
run_cmd(f"pip install -r {requirements_file} {optional_parm} --quiet")
|
||||
log.info(f"Requirements from {requirements_file} installed.")
|
||||
cmd = f"pip install -r {requirements_file} {optional_parm}"
|
||||
if not show_stdout:
|
||||
cmd += " --quiet"
|
||||
|
||||
run_cmd(cmd)
|
||||
log.info(f"Requirements from {requirements_file} installed/validated.")
|
||||
|
||||
|
||||
def configure_accelerate(run_accelerate=False):
|
||||
|
|
@ -649,7 +649,7 @@ def run_cmd(run_cmd):
|
|||
log.debug(f"Running command: {run_cmd}")
|
||||
try:
|
||||
subprocess.run(run_cmd, shell=True, check=True, env=os.environ)
|
||||
log.info(f"Command executed successfully: {run_cmd}")
|
||||
log.debug(f"Command executed successfully: {run_cmd}")
|
||||
except subprocess.CalledProcessError as e:
|
||||
log.error(f"Error occurred while running command: {run_cmd}")
|
||||
log.error(f"Error: {e}")
|
||||
|
|
|
|||
|
|
@ -123,12 +123,13 @@ def install_kohya_ss_torch2(headless: bool = False):
|
|||
# )
|
||||
|
||||
setup_common.install_requirements_inbulk(
|
||||
"requirements_pytorch_windows.txt", show_stdout=True, optional_parm="--index-url https://download.pytorch.org/whl/cu124"
|
||||
"requirements_pytorch_windows.txt", show_stdout=True,
|
||||
# optional_parm="--index-url https://download.pytorch.org/whl/cu124"
|
||||
)
|
||||
|
||||
setup_common.install_requirements_inbulk(
|
||||
"requirements_windows.txt", show_stdout=True, upgrade=True
|
||||
)
|
||||
# setup_common.install_requirements_inbulk(
|
||||
# "requirements_windows.txt", show_stdout=True, upgrade=True
|
||||
# )
|
||||
|
||||
setup_common.run_cmd("accelerate config default")
|
||||
|
||||
|
|
|
|||
|
|
@ -177,12 +177,18 @@ def main():
|
|||
# Install required packages from the specified requirements file
|
||||
requirements_file = args.requirements or "requirements_pytorch_windows.txt"
|
||||
log.debug(f"Installing requirements from: {requirements_file}")
|
||||
setup_common.install_requirements(requirements_file, check_no_verify_flag=True)
|
||||
log.debug("Installing additional requirements from: requirements_windows.txt")
|
||||
setup_common.install_requirements(
|
||||
"requirements_windows.txt", check_no_verify_flag=True
|
||||
setup_common.install_requirements_inbulk(
|
||||
requirements_file, show_stdout=False,
|
||||
# optional_parm="--index-url https://download.pytorch.org/whl/cu124"
|
||||
)
|
||||
|
||||
# setup_common.install_requirements(requirements_file, check_no_verify_flag=True)
|
||||
|
||||
# log.debug("Installing additional requirements from: requirements_windows.txt")
|
||||
# setup_common.install_requirements(
|
||||
# "requirements_windows.txt", check_no_verify_flag=True
|
||||
# )
|
||||
|
||||
if __name__ == "__main__":
|
||||
log.debug("Starting main function...")
|
||||
main()
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue