Lora Pipeline
by @iskwang
Manages end-to-end LoRA training: collects and verifies photos, scrapes datasets, applies quality checks, captions, and trains the LoRA model locally.
clawhub install lora-pipelineπ About This Skill
name: lora-pipeline description: End-to-end LoRA training pipeline: reference photo collection β face verification β dataset scraping β quality check β WD14 captioning β RunPod training. Use this skill whenever a user asks to build a training dataset, collect photos for a LoRA, or train a LoRA model.
LoRA Pipeline
Orchestrates the full LoRA dataset-to-model pipeline. Each phase is self-contained and can be delegated to a sub-agent independently.
Pipeline Overview
Phase 1: θιη―δΎη
§η β collect 3β6 reference face photos
Phase 2: η’ΊθͺδΊΊθζ£η’Ί β user confirms refs; deepface cross-check
Phase 3: θι datasets β scrape web sources guided by face features
Phase 4: η’Ίθͺη
§ηζ£η’Ί β face verify + dedup + quality filter + crop
Phase 5: ιε§ caption β WD14 local tagging + trigger word
Phase 6: LoRA training β RunPod Kohya training β retrieve outputs
Phase Index
| Phase | File | Can Sub-Agent | Model | Est. Time |
|-------|------|:---:|---|---|
| 01 β Reference Collection | phases/01-reference.md | β
| Haiku (Worker) | 5β10 min |
| 02 β Scraping | phases/02-scraping.md | β
| Haiku (Worker) | 10β30 min |
| 03 β Verify & Clean | phases/03-verify.md | β
| Haiku (Worker) | 2β5 min |
| 04 β Caption | phases/04-caption.md | β
| Haiku (Worker) | 1β3 min |
| 05 β Training | phases/05-training.md | β
| Haiku (Worker) + Sentry | 15β30 min |
To load a specific phase: read skills/lora-pipeline/phases/ β each file is independently readable.
Directory Structure
~/.openclaw/workspace/
βββ datasets/
βββ face_references/
β βββ / # Phase 1β2: Gold standard refs (3β6 photos)
β βββ ref_01.jpg
β βββ ...
βββ _raw/ # Phase 3: Raw scraped images (pre-verification)
β βββ ...
βββ / # Phase 4β5: Verified + captioned training set
βββ image001.png
βββ image001.txt
βββ ...
Privacy Rules (CRITICAL β All Phases)
cat, read, or analyze image file contents or .txt caption files.Quality Standards (SDXL)
Scripts
| Script | Location | Purpose |
|--------|----------|---------|
| tag_batch.py | skills/lora-pipeline/scripts/tag_batch.py | Local WD14 ONNX tagger for a directory |
| smart_crop.py | skills/lora-pipeline/scripts/smart_crop.py | Interactive or automated single-subject cropping |
| batch_lora_train.py | skills/lora-pipeline/scripts/batch_lora_train.py | Kohya batch training runner for RunPod |
Sub-Agent Protocol
Each phase file contains:
1. Input Contract β what must already exist before this phase starts
2. Output Contract β what this phase produces
3. Completion Signal β how to report back (sessions_send + status file fallback)
4. Error Escalation β sub-agent reports to parent, never self-escalates model tier