Skip to content
Back to skills

Data Preparation

ASecurity

"Prepare, validate, and troubleshoot sd-scripts training data

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
toolspythonbash

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill data-preparation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Preparation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data Preparation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-data-preparation-a089e60b/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-data-preparation-a089e60b)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: data-preparation
description: "Prepare, validate, and troubleshoot sd-scripts training data
  before LoRA, fine-tuning, Textual Inversion, ControlNet, or inpainting
  training."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# 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

1. Decide the dataset style per `[[datasets]]` block:
   - DreamBooth: every subset has `image_dir` and no `metadata_file`.
   - Fine-tuning: every subset has `metadata_file`; `image_dir` is required when metadata paths are relative.
   - ControlNet-style paired data: every subset has `image_dir` and `conditioning_data_dir`.
2. Put shared defaults in `[general]`, dataset-level shape/batch/bucket settings in `[[datasets]]`, and directory/metadata-specific settings in `[[datasets.subsets]]`.
3. Validate the TOML and metadata before training:

```bash
python skills/sd-scripts/sub-skills/data-preparation/scripts/validate_dataset_inputs.py --dataset-config dataset_config.toml
```

4. If the config passes, use `../training` to construct the matching `accelerate launch ... --dataset_config dataset_config.toml` command.

## 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_inpainting` needs source images at training time and is incompatible with latent caching flags.

Files in this skill

  • SKILL.md2.7 KB
  • references/data-formats.md5.9 KB
  • references/troubleshooting.md6.1 KB
  • references/workflows.md6.1 KB
  • scripts/validate_dataset_inputs.py16.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.