data-preparation
Prepare, validate, and troubleshoot sd-scripts training data before LoRA, fine-tuning, Textual Inversion, ControlNet, or inpainting training.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- data-preparation
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Prepare, validate, and troubleshoot sd-scripts training data before LoRA, fine-tuning, Textual Inversion, ControlNet, or inpainting training.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/data-formats.md5.9 KB
- 参考文档references/troubleshooting.md6.1 KB
- 参考文档references/workflows.md6.1 KB
- 脚本scripts/validate_dataset_inputs.py16.2 KB
03 SKILL.md 正文
Data Preparation
Use this sub-skill when a user needs to build or debug sd-scripts dataset inputs before launching training. It covers dataset TOML files, DreamBooth directory subsets, fine-tuning metadata JSON/JSONL, captions/tags, validation splits, bucketing/resolution choices, cached latents/text-encoder outputs, and safe data sanity checks.
Route actual training commands to ../training. Route generation prompt files to ../generation. Route LoRA merge/convert or checkpoint utilities to ../model-utilities.
Fast Path
- Decide the dataset style per
[[datasets]]block:- DreamBooth: every subset has
image_dirand nometadata_file. - Fine-tuning: every subset has
metadata_file;image_diris required when metadata paths are relative. - ControlNet-style paired data: every subset has
image_dirandconditioning_data_dir.
- DreamBooth: every subset has
- Put shared defaults in
[general], dataset-level shape/batch/bucket settings in[[datasets]], and directory/metadata-specific settings in[[datasets.subsets]]. - Validate the TOML and metadata before training:
python skills/sd-scripts/sub-skills/data-preparation/scripts/validate_dataset_inputs.py --dataset-config dataset_config.toml
- If the config passes, use
../trainingto construct the matchingaccelerate launch ... --dataset_config dataset_config.tomlcommand.
References
references/data-formats.md: TOML structure, metadata formats, caption/tag rules, and validation split precedence.references/workflows.md: Practical data prep flows for DreamBooth, fine-tuning metadata, ControlNet/masked loss, resize/bucketing, and cache helpers.references/troubleshooting.md: Common errors and corrective actions.scripts/validate_dataset_inputs.py: Read-only local preflight for TOML, JSON/JSONL, directories, metadata paths, image presence, mixed subset modes, and likely cache-only entries.
Safety Notes
- The bundled validator is read-only and does not load sd-scripts, model weights, VAE, CLIP, T5, BLIP, WD14, ONNX, TensorFlow, or torch.
- Cache and caption/tag generation tools can write many files or download models. Treat them as explicit user-approved preprocessing steps, not as automatic validation.
- Do not mix DreamBooth and fine-tuning subsets inside one
[[datasets]]. Split them into separate[[datasets]]blocks if a training script supports both. - Inpainting training with
--train_inpaintingneeds source images at training time and is incompatible with latent caching flags.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).