Getting Started
Prerequisites
Section titled “Prerequisites”You need three things running before you start:
-
ComfyUI — a local Stable Diffusion backend. Install from github.com/comfyanonymous/ComfyUI. Style Dataset Lab drives it over HTTP on
localhost:8188. -
Node.js 20+ — all scripts are ESM JavaScript. No build step, no TypeScript compilation.
-
repo-dataset (optional, for export) — the
@mcptoolshop/repo-datasetCLI reads your records and images to produce training data. Install from github.com/mcp-tool-shop-org/repo-dataset.
Model weights
Section titled “Model weights”The default generation setup uses an SDXL checkpoint and a style LoRA. Configure these in your project’s project.json under defaults.checkpoint and defaults.loras. Place model files in your ComfyUI models/checkpoints/ and models/loras/ directories.
Install
Section titled “Install”# Install globally for the sdlab CLInpm install -g @mcptoolshop/style-dataset-lab
# Or clone the repo for the Star Freight examplegit clone https://github.com/mcp-tool-shop-org/style-dataset-labcd style-dataset-labScaffold a project
Section titled “Scaffold a project”# Create a project from a domain templatesdlab init my-project --domain character-design
# See available domainssdlab initAvailable domains: game-art, character-design, creature-design, architecture, vehicle-mech, or omit --domain for a generic starter.
This creates projects/my-project/ with config files, canon templates, directory structure, and a starter prompt pack.
Validate the project
Section titled “Validate the project”sdlab project doctor --project my-projectDoctor checks config files, lane patterns, rubric dimensions, constitution rules, and directory structure. Fix any failures before generating.
Customize your canon
Section titled “Customize your canon”Edit the config files in your project root:
constitution.json— add or modify rules that define your visual lawlanes.json— define subject categories (portrait, full_body, etc.)rubric.json— set scoring dimensions and approval thresholdsterminology.json— define style groups/factions with detection patternscanon/constitution.md— human-readable style rules for the team
Start ComfyUI
Section titled “Start ComfyUI”cd /path/to/ComfyUIpython main.py --listen 127.0.0.1 --port 8188Verify it is running:
curl http://127.0.0.1:8188/system_statsGenerate your first wave
Section titled “Generate your first wave”Edit projects/my-project/inputs/prompts/example-wave.json with your subjects, style prefix, and generation defaults. Then:
# Preview what would be generated (no ComfyUI calls)sdlab generate inputs/prompts/example-wave.json --project my-project --dry-run
# Generate for realsdlab generate inputs/prompts/example-wave.json --project my-projectEach generated image lands in outputs/candidates/ with a matching record in records/. The record captures full provenance: checkpoint, LoRA, seed, steps, cfg, sampler, scheduler, resolution, and the exact prompt used.
Curate
Section titled “Curate”Once you have candidates, curate them:
# List uncurated candidatessdlab curate --list --project my-project
# Approve with per-dimension scoressdlab curate my_subject_v1 approved "Clean proportions, good gesture" \ --scores proportion_accuracy:0.9,gesture_clarity:0.85 --project my-project
# Reject with failure modessdlab curate my_subject_v2 rejected "Broken anatomy, stiff pose" \ --failures broken_anatomy,stiff_pose --project my-projectCuration moves the image from outputs/candidates/ to outputs/approved/ (or rejected/, borderline/) and writes the judgment into the record.
Bind to canon
Section titled “Bind to canon”After curation, bind records to constitution rules:
# Bind all curated recordssdlab bind --project my-project
# Preview without writingsdlab bind --project my-project --dry-run
# Print coverage statssdlab bind --project my-project --statsEach record gets canon.assertions — an array of rule citations with pass/fail/partial verdicts and rationale strings.
Export training data
Section titled “Export training data”Use repo-dataset to produce training data from your curated, canon-bound records:
repo-dataset visual generate ./projects/my-project --format trlrepo-dataset visual inspect ./projects/my-projectExplore the Star Freight example
Section titled “Explore the Star Freight example”If you cloned the repo, the Star Freight project has 1,182 records ready to explore:
sdlab bind --stats --project star-freightsdlab project doctor --project star-freight