Skip to content

Reference

Style Dataset Lab v2.1 ships the sdlab CLI, 12 shared library modules, and pipeline scripts. All commands accept --project <name> to target a project under projects/. The default is star-freight. The deprecated --game flag still works with a warning.

Scaffold a new project from a domain template.

Terminal window
sdlab init <project-name> [--domain <domain>]
sdlab init my-project --domain character-design
sdlab init # list available domains

Validate project config completeness and correctness.

Terminal window
sdlab project doctor --project <name>

Drive ComfyUI to produce candidate images from a prompt pack.

Terminal window
sdlab generate <prompt-pack-path> --project <name> [--dry-run]
FlagDefaultDescription
--game <name>star-freightTarget game directory under games/
--dry-runPrint what would be generated without calling ComfyUI
--subject <name>allOnly generate for one subject
--seeds <n>3Number of random seeds per subject-variation pair

Prompt pack format (inputs/prompts/*.json):

{
"defaults": {
"checkpoint": "dreamshaperXL_v21TurboDPMSDE.safetensors",
"loras": [{ "name": "classipeintxl_v21.safetensors", "weight": 1.0 }],
"steps": 8, "cfg": 2.0,
"sampler": "dpmpp_sde", "scheduler": "karras",
"width": 1024, "height": 1024,
"negative_prompt": "photorealistic, photograph, 3d render..."
},
"subjects": [
{
"id": "compact_officer",
"prompt": "concept art of a Compact military officer...",
"variations": [
{ "suffix": "bridge", "prompt_append": "on the bridge..." }
]
}
]
}

Outputs: Images to games/<name>/outputs/candidates/, records to games/<name>/records/.

Environment variables:

VariableDefaultDescription
COMFY_URLhttp://127.0.0.1:8188ComfyUI server URL

Move a candidate to approved/rejected/borderline and record the judgment.

Terminal window
node scripts/curate.js --game <name> <asset_id> <status> <explanation> [options]
node scripts/curate.js --game <name> --list
ArgumentRequiredDescription
asset_idyesRecord ID (filename without extension)
statusyesapproved, rejected, or borderline
explanationyesFree-text rationale for the judgment
FlagDefaultDescription
--game <name>star-freightTarget game directory under games/
--listShow uncurated candidates (no other args needed)
--scores <k:v,...>Per-dimension scores, e.g. silhouette:0.9,palette:0.8
--failures <f1,f2>Named failure modes, e.g. too_clean,wrong_material
--notes <text>Improvement notes for borderline or rejected images

Behavior: Updates the record’s judgment block, moves the image file from outputs/candidates/ to the status directory within the game folder. The record is written before the file move to prevent orphaned images.


Record a pairwise A-vs-B style comparison.

Terminal window
node scripts/compare.js --game <name> <asset_a_id> <asset_b_id> <winner> <reasoning>
ArgumentRequiredDescription
asset_a_idyesRecord ID of the first image
asset_b_idyesRecord ID of the second image
winneryesa, b, or tie
reasoningyesWhy the winner is better
FlagDefaultDescription
--game <name>star-freightTarget game directory under games/
--scores <k:v/v,...>Per-dimension comparison, e.g. silhouette:0.9/0.6

Outputs: Comparison record to games/<name>/comparisons/. Used by repo-dataset to produce preference training pairs.


Populate canon assertions in all records based on judgment scores and failure modes.

Terminal window
node scripts/canon-bind.js --game <name> [options]
FlagDefaultDescription
--game <name>star-freightTarget game directory under games/
--dry-runPreview bindings without writing to records
--statsPrint coverage statistics

Behavior: For each curated record, maps judgment scores and failure modes to constitution rules (e.g., RND-001, MAT-002) and writes canon.assertions with pass/fail/partial verdicts. Each assertion includes the rule ID, category, description, and a one-line rationale derived from the scores.


Post-process images through an img2img painterly pass via ComfyUI.

Terminal window
node scripts/painterly.js --game <name> [options]
FlagDefaultDescription
--game <name>star-freightTarget game directory under games/
--source <dir>outputs/approvedSource directory for images (relative to game dir)
--limit <n>allMaximum number of images to process
--offset <n>0Skip the first n images
--dry-runPreview without processing

Defaults:

ParameterValue
Denoise0.50
Steps10
CFG2.5
Seed42 (fixed for reproducibility)

Outputs: Processed images to games/<name>/outputs/painterly/.


Generate named-subject identity images with lineage tracking.

Terminal window
node scripts/generate-identity.js --game <name> <identity-packet-path> [options]
FlagDefaultDescription
--game <name>star-freightTarget game directory under games/
--dry-runPreview without generating
--subject <name>allOnly generate for one subject
--seeds <n>3Discovery seeds per shot
--phase <mode>discoveryGeneration phase: discovery or follow_on
--anchor <path>Anchor source image (required for follow_on)
--denoise <n>0.38Denoise strength for follow_on phase

Phases:

  1. Discovery — txt2img from prompt, multiple seeds. No prior image input.
  2. Follow-on — img2img from anchor image. Requires --anchor and --denoise. Anchor curation happens between phases (manual step).

Identity packet format (inputs/identity-packets/*.json): Defines subjects with identity locks, shot intents, and lineage metadata per canon/identity-gates.md.

Record extensions: Adds identity block (subject name, faction, role, view type, shot type) and lineage block (generation phase, anchor references, persistence scores).


Create, list, show, and diff frozen dataset snapshots.

Terminal window
sdlab snapshot create [--profile <name>] [--project <name>]
sdlab snapshot list [--project <name>]
sdlab snapshot show <snapshot-id> [--project <name>]
sdlab snapshot diff <id-a> <id-b> [--project <name>]

Audit training eligibility for all project records.

Terminal window
sdlab eligibility audit [--profile <name>] [--project <name>]

Build, list, show, and audit dataset splits.

Terminal window
sdlab split build [--snapshot <id>] [--profile <name>] [--project <name>]
sdlab split list [--project <name>]
sdlab split show <split-id> [--project <name>]
sdlab split audit <split-id> [--project <name>]

Generate dataset cards (markdown + JSON twin).

Terminal window
sdlab card generate [--snapshot <id>] [--split <id>] [--project <name>]

Build and list versioned export packages.

Terminal window
sdlab export build [--snapshot <id>] [--split <id>] [--profile <name>] [--copy] [--project <name>]
sdlab export list [--project <name>]

Use --copy to copy images instead of symlinking them.

Build and inspect canon-aware eval packs.

Terminal window
sdlab eval-pack build [--project <name>]
sdlab eval-pack list [--project <name>]
sdlab eval-pack show <eval-id> [--project <name>]

See Dataset Workflow for the full end-to-end walkthrough.


List and inspect training profiles.

Terminal window
sdlab training-profile list [--project <name>]
sdlab training-profile show <profile-id> [--project <name>]

Create, validate, and inspect frozen training contracts.

Terminal window
sdlab training-manifest create --export <id> --profile <id> [--adapter <target>] [--base-model <name>] [--project <name>]
sdlab training-manifest validate <manifest-id> [--project <name>]
sdlab training-manifest show <manifest-id> [--project <name>]
sdlab training-manifest list [--project <name>]

Build trainer-ready packages from manifests.

Terminal window
sdlab training-package build --manifest <id> [--adapter <target>] [--copy] [--project <name>]
sdlab training-package show <package-id> [--project <name>]
sdlab training-package list [--project <name>]

Available adapters: generic-image-caption, diffusers-lora.

Score generated outputs against eval packs.

Terminal window
sdlab eval-run create --manifest <id> --eval-pack <id> [--project <name>]
sdlab eval-run score <eval-run-id> --outputs <path> [--project <name>]
sdlab eval-run show <eval-run-id> [--project <name>]
sdlab eval-run list [--project <name>]

Build implementation example packs.

Terminal window
sdlab implementation-pack build --manifest <id> [--project <name>]
sdlab implementation-pack show <impl-id> [--project <name>]
sdlab implementation-pack list [--project <name>]

Re-ingest generated outputs as new project records.

Terminal window
sdlab reingest generated --source <dir> --manifest <id> [--dry-run] [--project <name>]
sdlab reingest audit [--project <name>]

Export is handled by the separate @mcptoolshop/repo-dataset CLI. Point it at the specific game directory:

Terminal window
# Generate training data
repo-dataset visual generate ./games/star-freight --format trl --output games/star-freight/exports
# With embedded images (base64 in JSONL)
repo-dataset visual generate ./games/star-freight --format trl --embed
# Inspect scanner results
repo-dataset visual inspect ./games/star-freight
# Validate output
repo-dataset visual validate games/star-freight/exports/dataset.jsonl

Supported formats: TRL, LLaVA, Qwen2-VL, Axolotl, LLaMA-Factory, ShareGPT, OpenAI, DPO, ORPO, KTO.


Generate candidates using ControlNet (pose/depth-guided generation).

Terminal window
node scripts/generate-controlnet.js --game <name> <prompt-pack-path> [options]

Generate candidates using IP-Adapter (reference-image-driven generation).

Terminal window
node scripts/generate-ipadapter.js --game <name> <prompt-pack-path> [options]

bulk-curate-wave2-5.js / bulk-curate-waves11-18.js

Section titled “bulk-curate-wave2-5.js / bulk-curate-waves11-18.js”

Batch curation scripts for processing multiple assets from specific waves.

Specialized curation for wave 25 (alien species) with species-specific scoring.

Migrate records from older schema versions to the current format.

Terminal window
node scripts/migrate-records.js --game <name> [--dry-run]

Test the painterly pipeline on a single image before running a full batch.