Individual skill

dataset-doctor

Audit and repair a kohya-style LoRA dataset before training. Use when the user asks to check, validate, inspect, fix, clean, 体检, or 修 a dataset, captions, or tags. Inspect image count, repeats and step budget, resolution and aspect buckets, duplicates, corrupt or non-RGB images, missing or empty captions, trigger consistency, and tag-frequency hygiene. Return a structural PASS, WARN, or FAIL report and apply only confirmed fix_dataset.py actions, dry-run first with displaced originals quarantined.

dataset-doctor/SKILL.md

Read pinned source

Source commit c2dbaa0bf8ae4f19aaa3f9d56714ce450793c63c

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
No
Repository scan complete
Yes
Skill scan complete
Yes
Observed behavior
Not checked yet
Last checked
Nov 4, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
13
Repository last updated
Oct 26, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# dataset-doctor — LoRA 数据集 / caption 体检 + 修复

在训练前对 LoRA 数据集与标注做**结构/卫生预检**,给出 **PASS / WARN / FAIL** 结论和按优先级排序的修复建议;PASS 不代表图像与 caption 的语义已经人工验证。确认后用 `fix_dataset.py` 一行命令执行修复。**体检只读**;修复**默认 dry-run**,加 `--apply` 才动文件,且**从不删除**——被移除的文件全部进数据集内的 `_quarantine/`(体检与训练都会忽略它),随时可还原。任何 `--apply` 都必须先得到用户确认。

底层针对 `lora-scripts-next`(SD-Trainer)的数据集约定:`train_data_dir` 下放 `<repeats>_<concept>` 子文件夹(如 `7_zkz` = 重复 7 次、概念 `zkz`),caption 是与图同名的 sidecar `.txt`——**单行**、逗号分隔、可在末尾用「`. `」接自然语言(已验证格式见 `../references/caption-guide.md`)。Anima `.json` caption 仅是 UI 宣称的可选项,训练端 v2.7.0 未发现读取实现,不要依赖。

## 默认职责

接收一个数据集路径,运行体检脚本,解读 JSON/报告,向用户说明问题与修复顺序;用户确认后用 `fix_dataset.py` 执行修复并重检。trainer 本身**只检查目录是否存在、有没有图**,不检查质量——质量这块由本 skill 负责,二者互补。

## 适用范围(不限 SD-Trainer)

体检与修复是**训练器无关**的:检查对象是标准 kohya 数据集约定(`<repeats>_<concept>` 文件夹 + 同名 sidecar caption),sd-scripts / kohya_ss / OneTrainer 等训练器通用;脚本全程离线、不碰 GPU、不需要 trainer 在线。用户打算在**任何**训练器上练 LoRA,体检都照做。只有两处例外: