Skip to content

Commit

Permalink
Implement support to setup venv with python 3.10.x on windows (#2444)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaltais authored May 5, 2024
1 parent adc3335 commit a6e7e10
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,20 @@ To set up the project, follow these steps:
cd kohya_ss
```

4. Run the setup script by executing the following command:
4. Run one of the following setup script by executing the following command:

For systems with only python 3.10.11 installed:

```shell
.\setup.bat
```

For systems with only more than one python release installed:

```shell
.\setup-3.10.bat
```

During the accelerate config step, use the default values as proposed during the configuration unless you know your hardware demands otherwise. The amount of VRAM on your GPU does not impact the values used.

#### Optional: CUDNN 8.9.6.50
Expand Down Expand Up @@ -438,3 +446,4 @@ ControlNet dataset is used to specify the mask. The mask images should be the RG
- To ensure cross-platform compatibility and security, the GUI now defaults to using "shell=False" when running subprocesses. This is based on documentation and should not cause issues on most platforms. However, some users have reported issues on specific platforms such as runpod and colab. PLease open an issue if you encounter any issues.
- Add support for custom LyCORIS toml config files. Simply type the path to the config file in the LyCORIS preset dropdown.
- Improve files and folders validation
- Added a new setup-3.10.bat file to set the venv to specifically use python 3.10.x instead of the default python the system might use.
26 changes: 26 additions & 0 deletions setup-3.10.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@echo off

IF NOT EXIST venv (
echo Creating venv...
py -3.10 -m venv venv
)

:: Create the directory if it doesn't exist
mkdir ".\logs\setup" > nul 2>&1

:: Deactivate the virtual environment to prevent error
call .\venv\Scripts\deactivate.bat

call .\venv\Scripts\activate.bat

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.
cmd /k python .\setup\setup_windows.py
) ELSE (
REM echo This script was started from a command prompt.
python .\setup\setup_windows.py %*
)

:: Deactivate the virtual environment
call .\venv\Scripts\deactivate.bat

0 comments on commit a6e7e10

Please sign in to comment.