跳到主要内容Skip to main content
训练与微调Training & Fine-tuning生产可用Production

kohya_ss

bmaltais / kohya_ss

Stable Diffusion 系模型的训练 GUI 与脚本集合:LoRA、DreamBooth、fine-tune、数据集打标与工具,覆盖 SD1/SDXL/FLUX 等。A training GUI and script collection for Stable Diffusion models: LoRA, DreamBooth, fine-tuning, dataset tagging and utilities across SD1, SDXL and FLUX.

12.7k stars 1610 forks Python 语言Language Apache-2.0 许可License 最近推送Last push 2026-08-01

为什么选Why choose it

  • GUI 把复杂训练参数摊开,适合个人与小队做角色/风格 LoRA。Covers several fine-tuning methods in one toolkit.
  • 脚本成熟,社区教程多,能和 ComfyUI 工作流衔接。Dataset tagging utilities reduce manual work.
  • 支持多种基础模型与训练方式,迁移成本低。Supports SD1, SDXL and FLUX lines.

不适合Not for

不是一键出图产品;数据清洗、打标与参数调试决定结果。You need a hosted training service.
训练吃显存与时间,云 GPU 成本要算。You cannot curate and license a training dataset.
GUI 封装会隐藏细节,出问题仍要读日志与脚本。GUI 封装会隐藏细节,出问题仍要读日志与脚本。

最小上手Minimum setup

  1. 按 README 装 venv 与依赖,启动 gui.py。Train a small LoRA on 10 licensed images.
  2. 准备 20-50 张同主体图,用 WD14 打标。Compare the same seed before and after training.
  3. 先跑一个低步数 LoRA,固定 seed 对比基模,确认过拟合前停。Check overfitting on a held-out prompt.

依赖与成本Dependencies and cost

Python + PyTorch/CUDA;NVIDIA GPU(8GB 起,越大越稳);训练图片与正则图;可选 wandb/tensorboard。Check runtime, model weights and external service dependencies in the README.

许可与使用边界License and usage boundaries

Apache-2.0;基础模型、数据集与生成内容各自许可。Code is Apache-2.0; model weights, training data and generated content may have separate terms — check each before commercial use.

开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.

替代与相邻Alternatives and neighbors

  • Diffusers — 生产可用Production,扩散模型的 Python 库:pipeline、调度器、训练与量化,适合写代码而不是点界面。A Python library for diffusion models: pipelines, schedulers, training and quantisation, built for code rather than a UI.
  • Stable Diffusion WebUI — 先试这个Start here,最经典的 SD 图形界面,文生图、图生图、LoRA、ControlNet 都在一个页面。The classic Stable Diffusion web UI: text-to-image, image-to-image, LoRA and ControlNet on one page.
  • SD.Next — 生产可用Production,Stable Diffusion WebUI 的现代分支,支持新模型、Diffusers/ONNX/OpenVINO 多后端,也兼顾 AMD 与 Intel。A modern fork of Stable Diffusion WebUI supporting new models, Diffusers/ONNX/OpenVINO backends and AMD or Intel hardware.

下一步Next steps

  • 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
  • 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
  • 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.

GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare

快照口径:stars / forks / language / license / pushed_at 来自 GitHub API 2026-11-20 快照;之后的变化没有回写。标签与“适合 / 不适合”是编辑判断,不是 GitHub 元数据。Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
不背书:本站只做索引与风险提示,不审计代码、不保证安全、不替你做许可判断。仓库脚本与模型权重请自行审查。No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.