[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-70954":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":8,"rankLanguage":8,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":8,"pushedAt":8,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":14,"starSnapshotCount":14,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},70954,"kohya_ss","bmaltais\u002Fkohya_ss","bmaltais",null,"Python",12365,1591,108,573,0,19,42,106,57,116.61,"Apache License 2.0",false,"master",true,[],"2026-06-12 04:00:58","# Kohya's GUI\n\n[![GitHub stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fbmaltais\u002Fkohya_ss?style=social)](https:\u002F\u002Fgithub.com\u002Fbmaltais\u002Fkohya_ss\u002Fstargazers)\n[![GitHub forks](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002Fbmaltais\u002Fkohya_ss?style=social)](https:\u002F\u002Fgithub.com\u002Fbmaltais\u002Fkohya_ss\u002Fnetwork\u002Fmembers)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fbmaltais\u002Fkohya_ss)](LICENSE.md)\n[![GitHub issues](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fbmaltais\u002Fkohya_ss)](https:\u002F\u002Fgithub.com\u002Fbmaltais\u002Fkohya_ss\u002Fissues)\n\nThis is a GUI and CLI for training diffusion models.\n\nThis project provides a user-friendly Gradio-based Graphical User Interface (GUI) for [Kohya's Stable Diffusion training scripts](https:\u002F\u002Fgithub.com\u002Fkohya-ss\u002Fsd-scripts). \nStable Diffusion training empowers users to customize image generation models by fine-tuning existing models, creating unique artistic styles, \nand training specialized models like LoRA (Low-Rank Adaptation).\n\nKey features of this GUI include:\n*   Easy-to-use interface for setting a wide range of training parameters.\n*   Automatic generation of the command-line interface (CLI) commands required to run the training scripts.\n*   Support for various training methods, including LoRA, Dreambooth, fine-tuning, and SDXL training.\n\nSupport for Linux and macOS is also available. While Linux support is actively maintained through community contributions, macOS compatibility may vary.\n\n## Table of Contents\n\n- [Installation Options](#installation-options)\n  - [Local Installation Overview](#local-installation-overview)\n    - [`uv` vs `pip` – What's the Difference?](#uv-vs-pip--whats-the-difference)\n  - [Cloud Installation Overview](#cloud-installation-overview)\n    - [Colab](#-colab)\n    - [Runpod, Novita, Docker](#runpod-novita-docker)\n- [Custom Path Defaults](#custom-path-defaults)\n    - [LoRA](#lora)\n  - [Sample image generation during training](#sample-image-generation-during-training)\n  - [Troubleshooting](#troubleshooting)\n  - [Page File Limit](#page-file-limit)\n  - [No module called tkinter](#no-module-called-tkinter)\n  - [LORA Training on TESLA V100 - GPU Utilization Issue](#lora-training-on-tesla-v100---gpu-utilization-issue)\n- [SDXL training](#sdxl-training)\n- [Masked loss](#masked-loss)\n- [Guides](#guides)\n  - [Using Accelerate Lora Tab to Select GPU ID](#using-accelerate-lora-tab-to-select-gpu-id)\n    - [Starting Accelerate in GUI](#starting-accelerate-in-gui)\n    - [Running Multiple Instances (linux)](#running-multiple-instances-linux)\n    - [Monitoring Processes](#monitoring-processes)\n- [Interesting Forks](#interesting-forks)\n- [Contributing](#contributing)\n- [License](#license)\n- [Change History](#change-history)\n  - [v25.0.3](#v2503)\n  - [v25.0.2](#v2502)\n  - [v25.0.1](#v2501)\n  - [v25.0.0](#v2500)\n\n\n## Installation Options\n\nYou can run `kohya_ss` either **locally on your machine** or via **cloud-based solutions** like Colab or Runpod.\n\n- If you have a GPU-equipped PC and want full control: install it locally using `uv` or `pip`.\n- 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.\n- If you are a developer or DevOps user, Docker is also supported.\n\n---\n\n### Local Installation Overview\n\nYou can install `kohya_ss` locally using either the `uv` or `pip` method. Choose one depending on your platform and preferences:\n\n| Platform     | Recommended Method | Instructions                                |\n|--------------|----------------|---------------------------------------------|\n| Linux        | `uv`           | [uv_linux.md](.\u002Fdocs\u002FInstallation\u002Fuv_linux.md) |\n| Linux or Mac | `pip`              | [pip_linux.md](.\u002Fdocs\u002FInstallation\u002Fpip_linux.md)               |\n| Windows      | `uv`           | [uv_windows.md](.\u002Fdocs\u002FInstallation\u002Fuv_windows.md)             |\n| Windows      | `pip`          | [pip_windows.md](.\u002Fdocs\u002FInstallation\u002Fpip_windows.md)           |\n\n#### `uv` vs `pip` – What's the Difference?\n\n- `uv` is faster and isolates dependencies more cleanly, ideal if you want minimal setup hassle.\n- `pip` is more traditional, easier to debug if issues arise, and works better with some IDEs or Python tooling.\n- If unsure: try `uv`. If it doesn't work for you, fall back to `pip`.\n\n### Cloud Installation Overview\n\n#### 🦒 Colab\n\nFor browser-based training without local setup, use this Colab notebook:  \n\u003Chttps:\u002F\u002Fgithub.com\u002Fcamenduru\u002Fkohya_ss-colab>\n\n- No installation required\n- Free to use (GPU availability may vary)\n- Maintained by **camenduru**, not the original author\n\n| Colab                                                                                                                                                                          | Info               |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ |\n| [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fcamenduru\u002Fkohya_ss-colab\u002Fblob\u002Fmain\u002Fkohya_ss_colab.ipynb) | kohya_ss_gui_colab |\n\n> 💡 If you encounter issues, please report them on camenduru’s repo.\n\n**Special thanks**  \nI would like to express my gratitude to camenduru for their valuable contribution.\n\n#### Runpod, Novita, Docker\n\nThese options are for users running training on hosted GPU infrastructure or containers.\n\n- **[Runpod setup](docs\u002Frunpod_setup.md)** – Ready-made GPU background training via templates.\n- **[Novita setup](docs\u002Fnovita_setup.md)** – Similar to Runpod, but integrated into the Novita UI.\n- **[Docker setup](docs\u002Fdocker.md)** – For developers\u002Fsysadmins using containerized environments.\n\n\n## Custom Path Defaults with `config.toml`\n\nThe 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.\n\n**Purpose of `config.toml`:**\n\n*   Pre-fill default directory paths for pretrained models, datasets, output folders, LoRA models, etc.\n*   Streamline your workflow by having the GUI remember your preferred locations.\n\n**How to Use and Customize:**\n\n1.  **Create your configuration file:**\n    *   In the root directory of the `kohya_ss` repository, you'll find a file named `config example.toml`.\n    *   Copy this file and rename the copy to `config.toml`. This `config.toml` file will be automatically loaded when the GUI starts.\n2.  **Edit `config.toml`:**\n    *   Open `config.toml` with a text editor.\n    *   The file uses TOML (Tom's Obvious, Minimal Language) format, which consists of `key = \"value\"` pairs.\n    *   Modify the paths for the keys according to your local directory structure.\n    *   **Important:**\n        *   Use absolute paths (e.g., `C:\u002FUsers\u002FYourName\u002FStableDiffusion\u002FModels` or `\u002Fhome\u002Fyourname\u002Fsd-models`).\n        *   Alternatively, you can use paths relative to the `kohya_ss` root directory.\n        *   Ensure you use forward slashes (`\u002F`) for paths, even on Windows, as this is generally more compatible with TOML and Python.\n        *   Make sure the specified directories exist on your system.\n\n**Structure of `config.toml`:**\n\nThe `config.toml` file can have several sections, typically corresponding to different training modes or general settings. Common keys you might want to set include:\n\n*   `model_dir`: Default directory for loading base Stable Diffusion models.\n*   `lora_model_dir`: Default directory for saving and loading LoRA models.\n*   `output_dir`: Default base directory for training outputs (images, logs, model checkpoints).\n*   `dataset_dir`: A general default if you store all your datasets in one place.\n*   Specific input paths for different training tabs like Dreambooth, Finetune, LoRA, etc. (e.g., `db_model_dir`, `ft_source_model_name_or_path`).\n\n**Example Configurations:**\n\nHere's an example snippet of what your `config.toml` might look like:\n\n```toml\n# General settings\nmodel_dir = \"C:\u002Fai_stuff\u002Fstable-diffusion-webui\u002Fmodels\u002FStable-diffusion\"\nlora_model_dir = \"C:\u002Fai_stuff\u002Fstable-diffusion-webui\u002Fmodels\u002FLora\"\nvae_dir = \"C:\u002Fai_stuff\u002Fstable-diffusion-webui\u002Fmodels\u002FVAE\"\noutput_dir = \"C:\u002Fai_stuff\u002Fkohya_ss_outputs\"\nlogging_dir = \"C:\u002Fai_stuff\u002Fkohya_ss_outputs\u002Flogs\"\n\n# Dreambooth specific paths\ndb_model_dir = \"C:\u002Fai_stuff\u002Fstable-diffusion-webui\u002Fmodels\u002FStable-diffusion\"\ndb_reg_image_dir = \"C:\u002Fai_stuff\u002Fdatasets\u002Fdreambooth_regularization_images\"\n# Add other db_... paths as needed\n\n# Finetune specific paths\nft_model_dir = \"C:\u002Fai_stuff\u002Fstable-diffusion-webui\u002Fmodels\u002FStable-diffusion\"\n# Add other ft_... paths as needed\n\n# LoRA \u002F LoCon specific paths\nlc_model_dir = \"C:\u002Fai_stuff\u002Fstable-diffusion-webui\u002Fmodels\u002FStable-diffusion\" # Base model for LoRA training\nlc_output_dir = \"C:\u002Fai_stuff\u002Fkohya_ss_outputs\u002Flora\"\nlc_dataset_dir = \"C:\u002Fai_stuff\u002Fdatasets\u002Fmy_lora_project\"\n# Add other lc_... paths as needed\n\n# You can find a comprehensive list of all available keys in the `config example.toml` file.\n# Refer to it to customize paths for all supported options in the GUI.\n```\n\n**Using a Custom Config File Path:**\n\nIf 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:\n\n*   On Windows: `gui.bat --config D:\u002Fmy_configs\u002Fkohya_settings.toml`\n*   On Linux\u002FmacOS: `.\u002Fgui.sh --config \u002Fhome\u002Fuser\u002Fmy_configs\u002Fkohya_settings.toml`\n\nBy 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.\n\n## LoRA\n\nTo 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.\n\nOnce you have created the LoRA network, you can generate images using auto1111 by installing [this extension](https:\u002F\u002Fgithub.com\u002Fkohya-ss\u002Fsd-webui-additional-networks).\n\nFor more detailed information on LoRA training options and advanced configurations, please refer to our LoRA documentation:\n- [LoRA Training Guide](docs\u002FLoRA\u002Ftop_level.md)\n- [LoRA Training Options](docs\u002FLoRA\u002Foptions.md)\n\n## Sample image generation during training\n\nA prompt file might look like this, for example:\n\n```txt\n# prompt 1\nmasterpiece, 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\n\n# prompt 2\nmasterpiece, 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\n```\n\nLines beginning with `#` are comments. You can specify options for the generated image with options like `--n` after the prompt. The following options can be used:\n\n- `--n`: Negative prompt up to the next option.\n- `--w`: Specifies the width of the generated image.\n- `--h`: Specifies the height of the generated image.\n- `--d`: Specifies the seed of the generated image.\n- `--l`: Specifies the CFG scale of the generated image.\n- `--s`: Specifies the number of steps in the generation.\n\nThe prompt weighting such as `( )` and `[ ]` is working.\n\n## Troubleshooting\n\nIf you encounter any issues, refer to the troubleshooting steps below.\n\n### Page File Limit\n\nIf you encounter an X error related to the page file, you may need to increase the page file size limit in Windows.\n\n### No module called tkinter\n\nIf you encounter an error indicating that the module `tkinter` is not found, try reinstalling Python 3.10 on your system.\n\n### LORA Training on TESLA V100 - GPU Utilization Issue\n\nSee [Troubleshooting LORA Training on TESLA V100](docs\u002Ftroubleshooting_tesla_v100.md) for details.\n\n## SDXL training\n\nFor detailed guidance on SDXL training, please refer to the [official sd-scripts documentation](https:\u002F\u002Fgithub.com\u002Fkohya-ss\u002Fsd-scripts\u002Fblob\u002Fmain\u002FREADME.md#sdxl-training) and relevant sections in our [LoRA Training Guide](docs\u002FLoRA\u002Ftop_level.md).\n\n## Masked loss\n\nThe masked loss is supported in each training script. To enable the masked loss, specify the `--masked_loss` option.\n\n> [!WARNING]\n> The feature is not fully tested, so there may be bugs. If you find any issues, please open an Issue.\n\nControlNet dataset is used to specify the mask. The mask images should be the RGB images. The pixel value 255 in R channel is treated as the mask (the loss is calculated only for the pixels with the mask), and 0 is treated as the non-mask. The pixel values 0-255 are converted to 0-1 (i.e., the pixel value 128 is treated as the half weight of the loss). See details for the dataset specification in the [LLLite documentation](.\u002Fdocs\u002Ftrain_lllite_README.md#preparing-the-dataset).\n\n## Guides\n\nThe following are guides extracted from issues discussions\n\n### Using Accelerate Lora Tab to Select GPU ID\n\n#### Starting Accelerate in GUI\n\n- Open the kohya GUI on your desired port.\n- Open the `Accelerate launch` tab\n- Ensure the Multi-GPU checkbox is unchecked.\n- Set GPU IDs to the desired GPU (like 1).\n\n#### Running Multiple Instances (linux)\n\n- For tracking multiple processes, use separate kohya GUI instances on different ports (e.g., 7860, 7861).\n- Start instances using `nohup .\u002Fgui.sh --listen 0.0.0.0 --server_port \u003Cport> --headless > log.log 2>&1 &`.\n\n#### Monitoring Processes\n\n- Open each GUI in a separate browser tab.\n- For terminal access, use SSH and tools like `tmux` or `screen`.\n\nFor more details, visit the [GitHub issue](https:\u002F\u002Fgithub.com\u002Fbmaltais\u002Fkohya_ss\u002Fissues\u002F2577).\n\n## Interesting Forks\n\nTo finetune HunyuanDiT models or create LoRAs, visit this [fork](https:\u002F\u002Fgithub.com\u002FTencent\u002FHunyuanDiT\u002Ftree\u002Fmain\u002Fkohya_ss-hydit)\n\n## Contributing\n\nContributions are welcome! If you'd like to contribute to this project, please consider the following:\n- For bug reports or feature requests, please open an issue on the [GitHub Issues page](https:\u002F\u002Fgithub.com\u002Fbmaltais\u002Fkohya_ss\u002Fissues).\n- If you'd like to submit code changes, please open a pull request. Ensure your changes are well-tested and follow the existing code style.\n- For security-related concerns, please refer to our `SECURITY.md` file.\n\n## License\n\nThis project is licensed under the Apache License 2.0. See the [LICENSE.md](LICENSE.md) file for details.\n\n## Change History\n\n### v25.0.3\n\n- Upgrade Gradio, diffusers and huggingface-hub to latest release to fix issue with ASGI.\n- Add a new method to setup and run the GUI. You will find two new script for both Windows (gui-uv.bat) and Linux (gui-uv.sh). With those scripts there is no need to run setup.bat or setup.sh anymore.\n\n### v25.0.2\n\n- Force gradio to 5.14.0 or greater so it is updated.\n\n### v25.0.1\n\n- Fix issue with requirements version causing huggingface download issues\n\n### v25.0.0\n\n- Major update: Introduced support for flux.1 and sd3, moving the GUI to align with more recent script functionalities.\n- Users preferring the pre-flux.1\u002Fsd3 version can check out tag `v24.1.7`.\n  ```shell\n  git checkout v24.1.7\n  ```\n- For details on new flux.1 and sd3 parameters, refer to the [sd-scripts README](https:\u002F\u002Fgithub.com\u002Fkohya-ss\u002Fsd-scripts\u002Fblob\u002Fsd3\u002FREADME.md).\n","Kohya's GUI 是一个用于训练扩散模型的图形用户界面和命令行工具。该项目基于Gradio框架，为Kohya的Stable Diffusion训练脚本提供了一个易于使用的界面，允许用户通过微调现有模型来定制图像生成模型，创建独特的艺术风格，以及训练如LoRA等专业模型。其核心功能包括设置广泛的训练参数、自动生成运行训练脚本所需的CLI命令，并支持多种训练方法。适用于希望在本地或云端（例如Colab, Runpod）环境下对Stable Diffusion模型进行个性化调整的研究人员与开发者。",2,"2026-06-11 03:35:08","high_star"]