Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

kohya_ss

> 编程语言
Open source

Kohya's GUI This is a GUI and CLI for training diffusion models. This project provides a user-friendly Gradio-based Graphical User Interfac…

12.5K stars0 likes2 views
WebsiteGitHub

About

Kohya's GUI This is a GUI and CLI for training diffusion models. This project provides a user-friendly Gradio-based Graphical User Interfac…

Kohya's GUI

This is a GUI and CLI for training diffusion models.

This project provides a user-friendly Gradio-based Graphical User Interface (GUI) for Kohya's Stable Diffusion training scripts. Stable Diffusion training empowers users to customize image generation models by fine-tuning existing models, creating unique artistic styles, and training specialized models like LoRA (Low-Rank Adaptation).

Key features of this GUI include:

  • Easy-to-use interface for setting a wide range of training parameters.
  • Automatic generation of the command-line interface (CLI) commands required to run the training scripts.
  • Support for LoRA, LoHa, LoKr, Dreambooth, fine-tuning, and Textual Inversion training.
  • Support for a wide range of base models: Stable Diffusion 1.5/2.x, SDXL, SD3, Flux.1, Lumina Image 2.0, Anima, and HunyuanImage-2.1.
  • LECO (concept erasure/editing) training.

Support for Linux and macOS is also available. While Linux support is actively maintained through community contributions, macOS compatibility may vary.

Table of Contents

  • Installation Options
    • Local Installation Overview
      • uv vs pip – What's the Difference?
    • Cloud Installation Overview
      • Colab
      • Runpod, Novita, Docker
    • Offline / air-gapped GUI shell
  • Custom Path Defaults
  • Server Options
    • allowed_paths
    • Remote / SSH: use --headless
  • LoRA
    • Sample image generation during training
    • Troubleshooting
    • Page File Limit
    • No module called tkinter
    • LORA Training on TESLA V100 - GPU Utilization Issue
  • SDXL training
  • Masked loss
  • Guides
    • Using Accelerate Lora Tab to Select GPU ID
      • Starting Accelerate in GUI
      • Running Multiple Instances (linux)
      • Monitoring Processes
  • Interesting Forks
  • Contributing
  • License
  • Change History
    • v26.0.0

Installation Options

You can run kohya_ss either locally on your machine or via cloud-based solutions like Colab or Runpod.

  • If you have a GPU-equipped PC and want full control: install it locally using uv or pip.
  • If your system doesn’t meet requirements or you prefer a browser-based setup: use Colab or a paid GPU provider like Runpod or Novita.
  • If you are a developer or DevOps user, Docker is also supported.

Local Installation Overview

You can install kohya_ss locally using either the uv or pip method. Choose one depending on your platform and preferences:

Platform Recommended Method Instructions
Linux uv uv_linux.md
Linux or Mac pip pip_linux.md
Windows uv uv_windows.md
Windows pip pip_windows.md

uv vs pip – What's the Difference?

  • uv is faster and isolates dependencies more cleanly, ideal if you want minimal setup hassle.
  • pip is more traditional, easier to debug if issues arise, and works better with some IDEs or Python tooling.
  • If unsure: try uv. If it doesn't work for you, fall back to pip.

Cloud Installation Overview

Colab

For browser-based training without local setup, use this Colab notebook:
https://github.com/camenduru/kohya_ss-colab

  • No installation required
  • Free to use (GPU availability may vary)
  • Maintained by camenduru, not the original author
Colab Info
kohya_ss_gui_colab

If you encounter issues, please report them on camenduru’s repo.

Special thanks
I would like to express my gratitude to camenduru for their valuable contribution.

Runpod, Novita, Docker

These options are for users running training on hosted GPU infrastructure or containers.

  • Runpod setup – Ready-made GPU background training via templates.
  • Novita setup – Similar to Runpod, but integrated into the Novita UI.
  • Docker setup – For developers/sysadmins using containerized environments.

Offline / air-gapped GUI shell

After a normal install, the local Gradio UI shell is intended to run without the browser (or server process) fetching third-party CDN hosts for core assets:

Layer Offline after install? Notes
GUI shell (HTML/JS/CSS, theme fonts, About tab) Yes No Google Fonts, cdnjs iframe-resizer, About remote badges, or Gradio analytics by default
Install (PyPI / torch wheels / uv sync) No One-time network (or a pre-populated cache / mirror) is still required
Captioning / HF models / W&B / HF upload Feature-dependent Needs local model caches or intentional network; for hard offline training set HF_HUB_OFFLINE=1 and TRANSFORMERS_OFFLINE=1

The public GitHub README.md may still use marketing badges; the in-app About → README view strips remote images so the browser does not load them.

Custom Path Defaults with config.toml

The GUI supports a configuration file named config.toml that allows you to set default paths for many of the input fields. This is useful for avoiding repetitive manual selection of directories every time you start the GUI.

Purpose of config.toml:

  • Pre-fill default directory paths for pretrained models, datasets, output folders, LoRA models, etc.
  • Streamline your workflow by having the GUI remember your preferred locations.

How to Use and Customize:

  1. Create your configuration file:
    • In the root directory of the kohya_ss repository, you'll find a file named config example.toml.
    • Copy this file and rename the copy to config.toml. This config.toml file will be automatically loaded when the GUI starts.
  2. Edit config.toml:
    • Open config.toml with a text editor.
    • The file uses TOML (Tom's Obvious, Minimal Language) format, which consists of key = "value" pairs.
    • Modify the paths for the keys according to your local directory structure.
    • Important:
      • Use absolute paths (e.g., C:/Users/YourName/StableDiffusion/Models or /home/yourname/sd-models).
      • Alternatively, you can use paths relative to the kohya_ss root directory.
      • Ensure you use forward slashes (/) for paths, even on Windows, as this is generally more compatible with TOML and Python.
      • Make sure the specified directories exist on your system.

Structure of config.toml:

The config.toml file can have several sections, typically corresponding to different training modes or general settings. Common keys you might want to set include:

  • model_dir: Default directory for loading base Stable Diffusion models.
  • lora_model_dir: Default directory for saving and loading LoRA models.
  • output_dir: Default base directory for training outputs (images, logs, model checkpoints).
  • dataset_dir: A general default if you store all your datasets in one place.
  • Specific input paths for different training tabs like Dreambooth, Finetune, LoRA, etc. (e.g., db_model_dir, ft_source_model_name_or_path).

Example Configurations:

Here's an example snippet of what your config.toml might look like:

…

Using a Custom Config File Path:

If you prefer to name your configuration file differently or store it in another location, you can specify its path using the --config command-line argument when launching the GUI:

  • On Windows: gui.bat --config D:/my_configs/kohya_settings.toml
  • On Linux/macOS: ./gui.sh --config /home/user/my_configs/kohya_settings.toml

By effectively using config.toml, you can significantly speed up your training setup process. Always refer to the config example.toml for the most up-to-date list of configurable paths.

Server Options

The config.toml file can also be used to configure the Gradio server.

allowed_paths

The allowed_paths option allows you to specify a list of directories that the application can access. This is useful if you want to store your models, datasets, or other files on an external drive or in a location outside of the application's root directory.

Example:

toml
[server]
allowed_paths = ["/mnt/external_drive/models", "/home/user/datasets"]

Remote / SSH: use --headless

When you run the GUI on a remote machine (SSH, Runpod, Docker, cloud GPU) and open it in a browser, start with --headless.

Without it, native OS dialogs (easygui overwrite confirmation, local file pickers) run on the server process. Over SSH there is usually no interactive display, so those prompts can block training indefinitely.

--headless does two things that matter for remote use:

  • Hides local file/folder picker buttons in the Gradio UI (type paths instead).
  • Skips the easygui “overwrite existing model?” prompt and overwrites if the output name already exists.

Examples:

bash
# Linux / macOS
./gui.sh --listen 0.0.0.0 --server_port 7860 --headless

# Windows
gui.bat --listen 0.0.0.0 --server_port 7860 --headless

If you start without --headless over SSH or without a display, the process logs a warning recommending --headless. There is no separate --skip_overwrite flag; use --headless for that behavior on train start.

LoRA

To train a LoRA, you can currently use the train_network.py code. You can create a LoRA network by using the all-in-one GUI.

Once you have created the LoRA network, you can generate images using auto1111 by installing this extension.

For more detailed information on LoRA training options and advanced configurations, please refer to our LoRA documentation:

  • LoRA Training Guide
  • LoRA Training Options

Sample image generation during training

A prompt file might look like this, for example:

txt
# prompt 1
masterpiece, best quality, (1girl), in white shirts, upper body, looking at viewer, simple background --n low quality, worst quality, bad anatomy, bad composition, poor, low effort --w 768 --h 768 --d 1 --l 7.5 --s 28

# prompt 2
masterpiece, best quality, 1boy, in business suit, standing at street, looking back --n (low quality, worst quality), bad anatomy, bad composition, poor, low effort --w 576 --h 832 --d 2 --l 5.5 --s 40

Lines beginning with # are comments. You can specify options for the generated image with options like --n after the prompt. The following options can be u

Issues· 533 open

View all issuesOpen on GitHub
  • #2965

    Incorrect calculation of “Max train steps”.

    Updated Sep 23, 2026
  • #3605

    `torch` resolves to 2.14.0+xpu (download.pytorch.org/whl/xpu) or 2.9.1+cu128 (download.pytorch.org/whl/cu128) depending on install path (pip install .` with the index configuration committed in the repo)

    Updated Sep 12, 2026
  • #3602

    No "Train U-Net Only" option for Anima training

    Updated Sep 10, 2026
  • #3603

    HuggingFace token written in cleartext to setup.log on plain GUI startup

    Updated Sep 7, 2026
  • #3600

    Consider using pre-built Flash Attention kernels via `kernels`

    Updated Aug 21, 2026
  • #3470

    How to install for AMD ROCm on Linux?

    Updated Aug 13, 2026
  • #3275

    Update via Stability Matrix fails and makes previous versions not work

    Updated Aug 11, 2026
  • #3590

    ValueError: Unsupported attention mode: None

    Updated Aug 3, 2026
  • #3598

    UnicodeEncodeError: 'charmap' codec can't encode characters in position 19-22: character maps

    Updated Aug 1, 2026
  • #3591

    Bad keys in Anima finetune output model

    Updated Jul 30, 2026

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言