How To Open Kohya Ss And Start Training Stable Diffusion Models

You Downloaded Kohya SS But Can’t Get It Running

You’ve heard the buzz about training your own Stable Diffusion models. Maybe you want to create a consistent character for a comic, develop a unique art style, or fine-tune a model on your own photography. The powerful, free tool everyone recommends is Kohya SS.

You found the GitHub repository, downloaded the files, and now you’re staring at a folder full of scripts and configuration files. Double-clicking does nothing. Running the install script throws errors. The command line looks like a foreign language. This is the exact moment most people give up.

Opening Kohya SS isn’t about finding a single “open” button. It’s about setting up a complete Python machine learning environment and launching a specialized web interface. This guide will walk you through every step, from zero to a working training GUI, explaining the “why” behind each command so you’re not just copying and pasting.

What Kohya SS Actually Is and What You Need

Kohya SS is not a standalone desktop application. It’s a collection of Python scripts packaged with a Gradio-based web user interface (UI). Think of it like a custom control panel for the underlying Stable Diffusion training libraries. To “open” it, you need to install its dependencies and then launch a local web server that hosts the UI in your browser.

Before you begin, ensure your system meets these prerequisites. Skipping this check is the number one cause of failure.

A Windows 10 or 11 PC is recommended for the easiest path, though it can run on Linux and macOS. You need a dedicated NVIDIA GPU with at least 8GB of VRAM for effective training. While you can run the interface on a lower-end GPU or even a CPU, actual model training will be impractically slow or impossible without a capable NVIDIA card.

You must have enough free disk space. Set aside 20-30GB for the software, Python environments, base models, and your training datasets.

Most importantly, you need administrative rights on your computer to install software and modify system paths.

Preparing Your System: The Foundational Steps

The first hurdle is getting Python and Git correctly installed. These are non-negotiable.

Download and install Python 3.10.9 from the official Python website. During installation, check the box that says “Add Python to PATH”. This crucial step allows your command line to find the Python executable. Do not install a newer version like Python 3.11 or 3.12, as many machine learning libraries are not yet compatible.

Next, download and install Git. This is the tool that will clone the Kohya SS repository. The default installation options are fine.

To verify your installations, open a new Command Prompt (search for “cmd” in the Start menu). Type python --version and press Enter. It should return “Python 3.10.9”. Then type git --version. You should see a Git version number. If either command is not recognized, restart your computer and try again; the PATH changes need a reboot to take effect.

The Foolproof Method: Using the Automatic Installer

The easiest way for most users, especially on Windows, is to use the dedicated installer script. This method automates 90% of the complex setup.

Navigate to the Kohya SS GitHub repository. Look for the “Code” button and select “Download ZIP”. Extract this ZIP file to a simple folder on your drive, like C:\kohya_ss. Avoid paths with spaces or special characters.

Inside the extracted folder, find the file named setup.bat (for Windows). This is your golden ticket. Right-click this file and select “Run as administrator”. The administrator rights are essential for creating the Python virtual environment.

A terminal window will open and begin a long series of automated steps. It will create a virtual environment, install PyTorch with CUDA support for your GPU, and download all necessary Python packages. This process can take 10-30 minutes depending on your internet speed. Let it run uninterrupted. You will see many lines of text scrolling by; this is normal.

how to open kohya ss

When it completes, the terminal might pause. Look for a message indicating success or for a new prompt. The script may also create a desktop shortcut. The most reliable next step is to find the gui.bat file in the same folder.

Launching the Web Interface

With the setup complete, you “open” Kohya SS by running the GUI launcher. In your Kohya SS folder, double-click the gui.bat file. Another terminal window will open. It will take a moment to load, and then you will see output similar to this:

Running on local URL: http://127.0.0.1:7860

This is the signal that the local web server is running. Do not close this terminal window. It is the server process. Minimize it if you wish.

Open your web browser (Chrome, Firefox, Edge) and go to the address shown: http://127.0.0.1:7860. The Kohya SS web interface will load. You have successfully opened Kohya SS. The interface is divided into tabs like “Dreambooth LoRA”, “Utilities”, and “Configuration”. This is where you will prepare datasets, set training parameters, and start your training sessions.

Manual Installation and Troubleshooting Common Errors

If the automatic installer fails or you prefer more control, a manual installation is your backup plan. Open a Command Prompt as administrator and navigate to your desired installation folder using the cd command.

Clone the repository: git clone https://github.com/bmaltais/kohya_ss.git

Navigate into the new folder: cd kohya_ss

Create a Python virtual environment: python -m venv venv

Activate the environment: .\venv\Scripts\activate

Your command prompt should now be prefixed with (venv). This isolates your Kohya SS dependencies from other Python projects.

Upgrade pip: python -m pip install --upgrade pip

Install the core requirements: pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 (Note: The CUDA version, like ‘cu121’, may change. Check the Kohya SS wiki for the latest command).

Finally, install the rest of the requirements: pip install -r requirements.txt

Once finished, launch the GUI manually: python kohya_gui.py

how to open kohya ss

Fixing “Could Not Locate runpod” or “Torch” Errors

The most common errors relate to failed package installations. If you see a “Could not locate runpod” error, it often means a package failed to compile. The simplest fix is to re-run the setup in a clean state.

Delete the entire Kohya SS folder and the venv folder if it exists separately. Start the download and installation process again from the beginning, ensuring you run the setup.bat as administrator on a fresh copy.

If you get a Torch-related error mentioning CUDA or no GPU, the PyTorch installation likely failed. The manual install command above specifies the correct version. Ensure your NVIDIA drivers are up to date by visiting the NVIDIA website and downloading the latest Game Ready or Studio Driver for your GPU.

When the Web Page Won’t Load

If the terminal says it’s running but you get a “connection refused” error in your browser, a few things could be wrong. First, ensure you haven’t closed the terminal window. Second, check that the URL is exactly http://127.0.0.1:7860 and not https.

Sometimes, another program is using port 7860. You can specify a different port when launching. Edit the gui.bat file with Notepad, find the line with the python command, and add --server_port 7865 at the end. Then use http://127.0.0.1:7865 in your browser.

Firewall software can also block the local connection. You may need to allow Python through your Windows Defender Firewall when prompted.

Your First Steps Inside the Kohya SS Interface

Now that the interface is open, you’ll see several tabs. Don’t be overwhelmed. For training a simple LoRA, you’ll primarily use the “Dreambooth LoRA” tab.

The workflow generally follows these steps: Prepare your training images in the “Utilities” tab, caption them if necessary, then move to the “Dreambooth LoRA” tab to set up the training parameters, point to your dataset and a base model, and begin training.

Before you train anything, use the “Configuration” tab to set up your paths for models, outputs, and datasets. This keeps your projects organized.

For your very first test, consider using the “Training” section to create a simple LoRA on a small dataset of 10-15 images. The community provides many presets; loading one can give you a safe starting point for learning rate, steps, and network settings.

What to Do After a Successful Training Session

Once your training finishes, the output will be a .safetensors file (your LoRA model). You do not “open” this file in Kohya SS. Instead, you use it with a Stable Diffusion web UI like Automatic1111 or ComfyUI. Place the .safetensors file in the appropriate models/Lora folder of your Stable Diffusion interface, then activate it in a prompt using the syntax <lora:filename:weight>.

Kohya SS itself remains “open” as long as the terminal server window is running. When you’re done for the day, you can simply close that terminal window to shut down the server. Your installed software and trained models remain on your disk for next time. To restart, just run gui.bat again; the setup is a one-time process.

Moving From Setup to Mastery

Getting Kohya SS open is the first technical gate. The real journey begins with understanding how to effectively prepare data, choose the right training parameters, and interpret the loss graphs to create high-quality models. The interface provides immense power, but that power requires study.

Your immediate next step should be to gather a small, consistent set of images (e.g., 10 pictures of the same object from different angles) and run a short, low-epoch training job just to see the process end-to-end. Use a simple base model like Stable Diffusion 1.5. This hands-on run, even if the output isn’t perfect, will demystify the entire pipeline and give you context for the more advanced settings.

The community around Kohya SS is vast. If you encounter an error message, search for its exact text along with “Kohya SS”. Chances are, someone has already solved it. With the software now running on your machine, you’ve unlocked the capability to move from being just a user of AI art to being a creator of the AI models themselves. The initial setup is the hardest part, and you’ve just completed it.

Leave a Comment

close