Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Build an Anima LoRA from a single-character or style name, from Danbooru collection through curation, section-ordered WD14 captions, dataset checks, confirmed training, fixed-seed checkpoint validation, and a staged Civitai draft. Use for requests such as make a LoRA of X, collect images and train a character LoRA, train and upload to Civitai, or build a dataset from scratch and publish. Delegate training to lora-trainer and structural checks to dataset-doctor; never train without confirmation a
.claude/skills/rinne414-lora-pipeline/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | 70% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 91% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 89% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 94% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 89% | 0% |
把「帮我做一个 X 的 LoRA」变成一条受控流水线:收图 → 精修 → 打标/复查 → 体检 → 训练 → 验证 → 打包上传(停在 Draft)。本 skill 是总指挥——真正的训练交给 lora-trainer,质量交给 dataset-doctor,自己负责把两端(收集/精修/打标 和 验证/发布)接起来。默认 Anima 优先。
> 两道人类闸门,不可移动: > 1. 训练前必须出「确认卡」 并取得明确同意(继承 lora-trainer 的规则)——训练慢、占显存、难回退。 > 2. 绝不自动发布。 全流程可以自动到 Draft(草稿)为止;点 Publish 是公开行为、会被索引,必须由用户亲自点。没有用户当场明说「发布」,绝不传 --publish。
这些是外部本地工具;表中路径/端口是惯例默认值,脚本都可用 flag/env 覆盖。契约细节见两份参考文档。
| 工具 | 用途 | 默认位置 | |---|---|---| | DanbooruDownload | 按 tag 下载图 | C:\tools\DanbooruDownload(env DANBOORU_DL_DIR) | | sd-image-sorter | WD14 打标 FastAPI | Rinne414/sd-image-sorter,:8487,兼容版本见 collect-and-tag.md | | SD-Trainer | 训练后端 mikazuki API | http://127.0.0.1:28000,run_gui.bat 启动 | | ComfyUI | 验证出图 | http://127.0.0.1:8188(env COMFY_URL) | | civitai-uploader | 填 Civitai 上传向导 | <repo>\tools\civitai-uploader(安装见其 README) |
<PY> = 任意带 Pillow 的 Python 3.10+(如 <DanbooruDownload>\.venv\Scripts\python.exe)。管线脚本在 scripts/,纯 stdlib + Pillow。
一个 --work <dir> 项目根,各阶段写入子目录:
<work>/
raw/ collect.py → danbooru 图 + .txt sidecar
curation_manifest.json curate.py → keep/drop 名单
dataset/<R>_<concept>/ build_dataset.py → 精修后的 RGB 图(kohya 结构)
dataset/<R>_<concept>/*.txt tag_dataset.py → WD14 Anima 分段 caption
dataset/<R>_<concept>.tag-audit.json → 特征修剪 + 二次语义审查
output/<name>/ lora-trainer → safetensors 快照
validation/ validate.py → ComfyUI 样图
civitai_upload/ make_civitai_pack.py → MODEL_CARD + *.civitai.json + samples/0 输入:角色/概念「名字」(必需)。目标:单角色|画风(用户没说才问);单角色还要明确 1girl|1boy|1other。
推导:danbooru tag(默认 name_(series))、trigger(小写去空格,常见词做变体 mychar→mych4r)、
output_name = <concept>-anima-v1、work 目录。
1 COLLECT scripts/collect.py --tag "<danbooru tag>" --work <work> --limit 200 --apply
→ 建议 raw/ ≥30 张;不足时提示扩大来源或检查多样性,但不以数量单独硬拦截。见 collect-and-tag.md。
2 CURATE scripts/curate.py --work <work> --subject-tag <1girl|1boy|1other>
画风改传 --style → 丢错主体/多人/漫画/参考图/太小/坏图
BUILD scripts/build_dataset.py --work <work> --concept <c> → dataset/<R>_<c>/(自动定 repeats)
3 TAG scripts/tag_dataset.py --dataset-dir <work>/dataset/<R>_<c> --trigger <t>
--subject-tag <1girl|1boy|1other>;画风传 --style 且 trigger 必须以 @ 开头
→ Anima 正确打标:干净 tagger(eva02/swinv2,不用 pixai 单跑、绝不用 toriigate 当 tagger)
→ `content_mode=template` + `preset_id=anima_tags_only`(官方段落顺序、@artist、
safety 词表 questionable→nsfw、单行、未评分图片不伪造质量标签)→ **caption 悖论修剪**:
把 ≥0.9 出现率的不变身份特征加进 blacklist,并把候选与决定写入 tag-audit.json。
重打标后再报告错主体/多人语义警告;只警告,由用户复查,不自动删除。
4 DOCTOR ../dataset-doctor/scripts/doctor.py "<work>/dataset" --trigger <t> --epochs 10 --report
→ 按 dataset-doctor 修复到 PASS(FAIL 挡下,WARN 让用户接受)。
5 TRAIN 交给 lora-trainer:以约 1500 步作首轮预算并核对 doctor 实际步数
→【确认卡】→ POST /api/run → 监看 log。
train_data_dir = "<work>/dataset";output_dir = "<work>/output/<name>"。
6 VALIDATE 把至少一个早期与最终快照拷进 ComfyUI/models/loras/ → scripts/validate.py
--work <work> --lora <early> <final> --trigger <t> --target character --subject-tag <count>
→ 同 seed 比 baseline/各快照;身份或画风成立且姿势/内容仍可变才通过。画风用 --target style。
7 PUBLISH scripts/make_civitai_pack.py --work <work> --concept <c> --trigger <t> --name <name>
--lora-file <...safetensors> --display "<title>" --series "<series>"
→ civitai_upload/。一次性 login.bat 后:
<civitai-uploader>\upload.bat "<work>\civitai_upload\<name>.civitai.json"
→ 填满 4 步向导、传文件+样图、**停在 Draft**。报告草稿 URL,让用户点 Publish。阶段 1–4、6–7a 只动数据、可离线/本地;只有打标(2)、训练(5)、验证(6)、上传(7b)需要对应服务在线。任一服务连不上 ≠ 中止:先把能离线做的做完,再提示用户启动缺的服务(可建议在输入框 ! run.bat / ! run_gui.bat 直接在会话里起)。
| 阶段 | 读取 / 执行 | |---|---| | 1–3 收集 / 精修 / 打标 的契约与坑 | ../references/collect-and-tag.md + scripts/collect.py·curate.py·build_dataset.py·tag_dataset.py | | 4 体检 + 一行修复 | ../dataset-doctor/SKILL.md(doctor.py / fix_dataset.py) | | 5 选参 · 确认卡 · 开训 · 监看 | ../lora-trainer/SKILL.md + ../references/{trainer-api,anima-params,presets}.md | | caption 格式 / 触发词 / 官方推荐质量词 | ../references/caption-guide.md | | 6–7 验证出图 + Civitai 上传的契约与坑 | ../references/validate-and-publish.md + scripts/validate.py·make_civitai_pack.py |
Anima 官方 tag 顺序把质量/元信息放最前。本流程针对 Anima base 的出图/样图 prompt 使用官方前缀 masterpiece, best quality, score_7, safe;Anima-Aesthetic 不需要 score_*。 训练 caption 可使用 human quality 或 score_9 到 score_1,但必须来自逐图评分;没评分就省略。 段落顺序、@artist、safety 词表、单行、以及角色的 caption 悖论修剪,全部由 anima preset + trait-candidates 处理——细节与「为什么」见 caption-guide.md 的 Anima tagging craft 一节。
content_mode="template" + Anima preset;阈值绑定 tagger;未评分时 quality_override="";已复查 tag-audit 的语义警告与 trait prune 决定。dataset-doctor 闸门:FAIL 没放行,WARN 已让用户接受;触发词一致率达标。Anima。--publish。报告了草稿 URL。用户:「帮我做一个 my_character_(my_series) 的角色 LoRA,用 Anima,收图打标训练完自动传 Civitai,我只点发布。」
my_character_(my_series)、trigger=mychar、name=mychar-anima-v1、work=D:/work/mychar。collect.py --apply → raw/ 126 张 → curate.py --subject-tag 1girl → build_dataset.py --concept mychar → dataset/5_mychar/。tag_dataset.py --dataset-dir ... --trigger mychar --subject-tag 1girl → 复查 tag-audit → doctor.py → 修到 PASS/WARN 已接受。lora-trainer:以约 1500 步作首轮预算 →【确认卡】→ 用户「确认」→ 开训 → 监看。validate.py --lora <early> <final> --target character --subject-tag 1girl → 与 baseline 比较后选快照。make_civitai_pack.py ... → civitai_upload/ → upload.bat *.civitai.json → Draft(LoRA/Character、tags、base_model Anima、trigger mychar、文件、样图都已填)→ 报告草稿 URL,等用户点 Publish。lora-trainer;数据质量 → dataset-doctor;工具契约与坑 → 两份 references/*.md。| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | fail→pass | 15,743 | 8,731 | -45% | 1 | 1 | 0% | 2,612 | 4,442 | +70% | 0 | 0 | — |
case-01 | fail→pass | 15,452 | 10,867 | -30% | 1 | 1 | 0% | 2,563 | 4,895 | +91% | 0 | 0 | — |
case-02 | fail→fail | 19,260 | 8,916 | -54% | 1 | 1 | 0% | 2,891 | 4,599 | +59% | 0 | 0 | — |
case-03 | fail→fail | 18,398 | 13,934 | -24% | 1 | 1 | 0% | 3,260 | 5,376 | +65% | 0 | 0 | — |
case-04 | fail→fail | 17,260 | 13,466 | -22% | 1 | 1 | 0% | 3,031 | 5,168 | +71% | 0 | 0 | — |
case-05 | fail→fail | 17,408 | 13,230 | -24% | 1 | 1 | 0% | 3,270 | 5,300 | +62% | 0 | 0 | — |
case-06 | fail→fail | 24,324 | 19,019 | -22% | 1 | 1 | 0% | 4,556 | 6,318 | +39% | 0 | 0 | — |
case-07 | pass→pass | 10,093 | 6,085 | -40% | 1 | 1 | 0% | 1,601 | 3,955 | +147% | 0 | 0 | — |
case-09 | fail→pass | 15,212 | 10,116 | -33% | 1 | 1 | 0% | 2,412 | 4,554 | +89% | 0 | 0 | — |
case-10 | fail→pass | 14,663 | 12,040 | -18% | 1 | 1 | 0% | 2,471 | 4,803 | +94% | 0 | 0 | — |
case-11 | fail→pass | 15,051 | 7,945 | -47% | 1 | 1 | 0% | 2,222 | 4,200 | +89% | 0 | 0 | — |
case-12 | pass→pass | 14,630 | 7,933 | -46% | 1 | 1 | 0% | 2,374 | 4,292 | +81% | 0 | 0 | — |
case-22 | fail→pass | 15,420 | 3,987 | -74% | 1 | 1 | 0% | 2,310 | 3,538 | +53% | 0 | 0 | — |
case-13 | fail→pass | 9,728 | 10,967 | +13% | 1 | 1 | 0% | 1,691 | 4,529 | +168% | 0 | 0 | — |
case-14 | fail→pass | 18,607 | 14,770 | -21% | 1 | 1 | 0% | 2,940 | 5,887 | +100% | 0 | 0 | — |
case-15 | fail→pass | 11,262 | 4,384 | -61% | 1 | 1 | 0% | 1,786 | 3,677 | +106% | 0 | 0 | — |
case-16 | pass→pass | 14,831 | 10,021 | -32% | 1 | 1 | 0% | 2,179 | 4,406 | +102% | 0 | 0 | — |
case-17 | fail→pass | 15,033 | 6,977 | -54% | 1 | 1 | 0% | 2,534 | 4,086 | +61% | 0 | 0 | — |
case-18 | fail→fail | 14,825 | 6,576 | -56% | 1 | 1 | 0% | 2,561 | 3,934 | +54% | 0 | 0 | — |
case-19 | fail→pass | 10,643 | 2,823 | -73% | 1 | 1 | 0% | 1,656 | 3,374 | +104% | 0 | 0 | — |
case-20 | fail→pass | 12,919 | 3,038 | -76% | 1 | 1 | 0% | 2,070 | 3,347 | +62% | 0 | 0 | — |
case-21 | fail→pass | 13,687 | 7,087 | -48% | 1 | 1 | 0% | 2,283 | 3,870 | +70% | 0 | 0 | — |
case-23 | pass→pass | 13,642 | 8,876 | -35% | 1 | 1 | 0% | 1,906 | 4,080 | +114% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +57 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.