kohya_ss/docs/Installation/pip_windows.md

4.2 KiB
Raw Permalink Blame History

Windows Installation (pip method)

Use this method if uv is not available or you prefer the traditional approach.

Table of Contents

Prerequisites

  • Python 3.10.11
  • Git Required for cloning the repository
  • NVIDIA CUDA Toolkit 12.8
  • NVIDIA GPU Required for training; VRAM needs vary
  • (Optional) NVIDIA cuDNN Improves training speed and batch size
  • (Optional) Visual Studio Redistributables: vc_redist.x64.exe

Installation Steps

  1. Install Python 3.11.9
    Enable the "Add to PATH" option during setup

  2. Install CUDA 12.8 Toolkit

  3. Install Git

  4. Install Visual Studio Redistributables

Using Conda (Optional)

If you prefer Conda over venv, you can create an environment like this:

conda create -n kohyass python=3.10
conda activate kohyass

setup.bat

You can also use:

setup-3.10.bat

Then run:

gui.ps1

or:

gui.bat

Clone the Repository

Clone with submodules:

git clone --recursive https://github.com/bmaltais/kohya_ss.git
cd kohya_ss

The --recursive flag ensures all submodules are fetched.

Run the Setup Script

Run:

setup.bat

If you have multiple Python versions installed:

setup-3.10.bat

During the Accelerate configuration step, use the default values as proposed 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

These optional steps improve training speed for NVIDIA 30X0/40X0 GPUs. They allow for larger batch sizes and faster training.

Run:

setup.bat

Then select:

2. (Optional) Install cudnn files (if you want to use the latest supported cudnn version)

Start the GUI

If you installed using the pip method, use either the gui.ps1 or gui.bat script located in the root directory. Choose the script that suits your preference and run it in a terminal, providing the desired command line arguments. Here's an example:

gui.ps1 --listen 127.0.0.1 --server_port 7860 --inbrowser --share

or

gui.bat --listen 127.0.0.1 --server_port 7860 --inbrowser --share

You can also run kohya_gui.py directly with the same flags.

For help:

gui.bat --help

This method uses a Python virtual environment managed via pip.

Available CLI Options

  --help                show this help message and exit
  --config CONFIG       Path to the toml config file for interface defaults
  --debug               Debug on
  --listen LISTEN       IP to listen on for connections to Gradio
  --username USERNAME   Username for authentication
  --password PASSWORD   Password for authentication
  --server_port SERVER_PORT
                        Port to run the server listener on
  --inbrowser           Open in browser
  --share               Share the gradio UI
  --headless            Is the server headless
  --language LANGUAGE   Set custom language
  --use-ipex            Use IPEX environment
  --use-rocm            Use ROCm environment
  --do_not_use_shell    Enforce not to use shell=True when running external commands
  --do_not_share        Do not share the gradio UI
  --requirements REQUIREMENTS
                        requirements file to use for validation
  --root_path ROOT_PATH
                        `root_path` for Gradio to enable reverse proxy support. e.g. /kohya_ss
  --noverify            Disable requirements verification

Upgrade Instructions

To upgrade your environment:

git pull
setup.bat