Use this method if you prefer pip or are on macOS.
- Python 3.10.9 (or higher, but below 3.13)
- 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
- Install Python and Git. On Ubuntu 22.04 or later:
sudo apt update
sudo apt install python3.11 python3.11-venv git- Install CUDA 12.8 Toolkit
Follow the instructions for your distribution.
Note
CUDA is usually not required and may not be compatible with Apple Silicon GPUs.
If you prefer Conda over venv, you can create an environment like this:
# Create Conda Environment
conda create -n kohyass python=3.11
conda activate kohyass
# Run the Scripts
chmod +x setup.sh
./setup.sh
chmod +x gui.sh
./gui.shClone with submodules:
git clone --recursive https://github.com/bmaltais/kohya_ss.git
cd kohya_ssMake the setup script executable:
chmod +x setup.shRun:
./setup.shNote
If you need additional options or information about the runpod environment, you can use setup.sh -h or setup.sh --help to display the help message.
Start with:
./gui.sh --listen 127.0.0.1 --server_port 7860 --inbrowser --shareYou can also run kohya_gui.py directly with the same flags.
For help:
./gui.sh --helpThis method uses a standard Python virtual environment.
You can pass the following arguments to gui.sh or kohya_gui.py:
--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
To upgrade, pull the latest changes and rerun setup:
git pull
./setup.shOn Linux, the setup script will install in the current directory if possible.
If that fails:
- Fallback:
/opt/kohya_ss - If not writable:
$HOME/kohya_ss - If all fail: stays in the current directory
To override the location, use:
./setup.sh -d /your/custom/pathOn macOS, the behavior is similar but defaults to $HOME/kohya_ss.
If you use interactive mode, the default Accelerate values are:
- Machine:
This machine - Compute:
None - Others:
No