@mcptoolshop/style-dataset-lab 3.0.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/README.es.md +154 -41
- package/README.fr.md +153 -40
- package/README.hi.md +160 -47
- package/README.it.md +155 -42
- package/README.ja.md +159 -46
- package/README.md +40 -0
- package/README.pt-BR.md +154 -41
- package/README.zh.md +154 -41
- package/bin/sdlab.js +81 -2
- package/lib/adapters/ai-toolkit.js +209 -0
- package/lib/adapters/comfyui-runner.js +11 -15
- package/lib/adapters/comfyui-workflows.js +133 -2
- package/lib/adapters/diffusers-lora.js +46 -66
- package/lib/adapters/generic-image-caption.js +22 -50
- package/lib/batch-runs.js +62 -0
- package/lib/canon-build/build.js +450 -0
- package/lib/canon-build/emitters/base.js +122 -0
- package/lib/canon-build/emitters/character.js +167 -0
- package/lib/canon-build/emitters/deity.js +165 -0
- package/lib/canon-build/emitters/faction.js +161 -0
- package/lib/canon-build/emitters/index.js +38 -0
- package/lib/canon-build/emitters/location.js +153 -0
- package/lib/canon-build/emitters/monster.js +131 -0
- package/lib/canon-build/emitters/relic.js +142 -0
- package/lib/canon-build/emitters/ship.js +154 -0
- package/lib/canon-build/emitters/species.js +165 -0
- package/lib/canon-build/frontmatter.js +76 -0
- package/lib/canon-build/lane-resolve.js +64 -0
- package/lib/canon-build/load-config.js +117 -0
- package/lib/canon-build/load-entry.js +62 -0
- package/lib/canon-build/load-schema.js +46 -0
- package/lib/captions.js +197 -0
- package/lib/comfyui-output.js +70 -0
- package/lib/config.js +19 -0
- package/lib/freeze-events.js +109 -0
- package/lib/freeze-gate.js +165 -0
- package/lib/freeze-stamp.js +161 -0
- package/lib/rows.js +228 -0
- package/lib/training-adapters.js +84 -0
- package/lib/training-packages.js +25 -32
- package/lib/training-profiles.js +43 -0
- package/package.json +29 -2
- package/scripts/_batch_cut.py +71 -0
- package/scripts/_seam_cutout.py +74 -0
- package/scripts/batch-generate.js +56 -13
- package/scripts/canon-build.js +88 -0
- package/scripts/canon-drift.js +193 -0
- package/scripts/canon-freeze-status.js +85 -0
- package/scripts/canon-freeze.js +211 -0
- package/scripts/canon-unfreeze.js +137 -0
- package/scripts/curate.js +12 -0
- package/scripts/generate-controlnet.js +12 -0
- package/scripts/generate-identity.js +20 -4
- package/scripts/generate-ipadapter.js +11 -0
- package/scripts/generate.js +250 -102
- package/scripts/qwen_generate.py +124 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,83 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## [3.2.0] - 2026-07-06
|
|
8
|
+
|
|
9
|
+
The **canon authoring** release. A new `sdlab canon *` namespace turns a project's canon entity store into the projections training actually consumes, and wraps a witness-backed freeze spine around entries that must not drift — plus first-class Flux and Qwen-Image training paths.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Canon authoring namespace (`sdlab canon *`)** — the headline of this release:
|
|
14
|
+
- **`sdlab canon build`** (#16) — builds three canonical projections from a project's canon entity store: `dataset.jsonl` (for training adapters), `prompts/<id>.j2` (Jinja2 templates for ComfyUI invocation), and `context/<id>.md` (narrative blocks for Role OS dispatch). Output keyed by `<canon_sha>` with a content-addressable cache under `canon-build/.cache/`. Flags: `--full`, `--no-cache`, `--dry-run`, `--only <ids>`, `--json`, `--quiet`.
|
|
15
|
+
- **`sdlab canon freeze` / `unfreeze` / `freeze-status`** (#17) — witness-chain freeze tooling. `freeze` stamps a freeze block on an entry (witnessed against a canon-build output via `locked_at_build`), writing both the entry frontmatter and an append-only `canon-build/freeze-events.jsonl`. Statuses: `frozen` (regen refused; unfreeze ceremony required) and `soft-advisory` (refused by default, bypassable with `--i-know`). `--reason` is required on freeze/unfreeze — the audit record depends on it. `freeze-status` is a read-only glance at an entry's state.
|
|
16
|
+
- **`sdlab canon drift`** (#19) — for every frozen / on-canon-change entry, recomputes the watch-field hash and compares against the hash stamped in the latest canon-build manifest; reports drifted entries and overrides since a given build.
|
|
17
|
+
- **Canon schema system** (#18) — Star Freight Grounded canon shipped as worked example data (28 entities across 5 entry schemas), demonstrating the entity format `canon build` consumes.
|
|
18
|
+
- **`flux-natural-language` caption strategy** (#11) — natural-language captions for Flux.1-dev LoRA training, alongside the existing SDXL trigger-word strategy.
|
|
19
|
+
- **Two-LoRA stack training contract** (#15) — threads the `is_style_lora` boolean through profiles and adapters (world/style LoRAs → `true`, per-character subject LoRAs → `false`), driving trainer regularization for the two-LoRA stacking pattern.
|
|
20
|
+
- **Flux training targets** — Flux-target training profiles (#12) and Flux-target ComfyUI workflow profiles (#13) for Star Freight, plus the **`ai-toolkit` adapter** for Flux LoRA training (#14): emits `dataset/<partition>/<record_id>.{png,txt}` + `metadata/<partition>.jsonl` + an `ai-toolkit-config.yaml` that Ostris [ai-toolkit](https://github.com/ostris/ai-toolkit) consumes directly. Flux-only — rejects non-Flux profiles with `ADAPTER_TARGET_FAMILY_MISMATCH`; emits `is_style` from the profile's `is_style_lora`. Registered in `ADAPTER_REGISTRY` beside `generic-image-caption` and `diffusers-lora`.
|
|
21
|
+
- **Qwen-Image native generation** (#24) — native non-anime Qwen-Image generation path with a `gpu_model` override.
|
|
22
|
+
- **Qwen DiT LoRA chain** (#25) — DiT LoRA chaining in both Qwen runners, with tallow-fen style-LoRA dataset wiring.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **Caption prompt bleed** (#9) — routed captions through the shared research-backed builder so prompt fragments no longer bleed across records.
|
|
27
|
+
- **Freeze witness-chain drift** (#19) — the drift CLI reads `.watch_hash` from the rich freeze stamp, and `freeze-status` surfaces resolved `watch_fields`.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- Training adapter registry now exposes three adapters — `generic-image-caption`, `diffusers-lora`, `ai-toolkit`; the handbook reference and README document the `ai-toolkit` Flux-only precondition.
|
|
32
|
+
- `projects/`: rustline and tallow-fen production style datasets added as worked examples (repo-clone content; not shipped in the npm package).
|
|
33
|
+
|
|
34
|
+
### Dependencies
|
|
35
|
+
|
|
36
|
+
- **`yaml@^2.8.3`** added as a runtime dependency for the ai-toolkit YAML config (#14), kept current in the range (#23). CI: `actions/checkout` 6→7 (#30), `codecov/codecov-action` 5→7 (#31).
|
|
37
|
+
|
|
38
|
+
### Tests & coverage
|
|
39
|
+
|
|
40
|
+
- **368 tests, 0 failing.** Coverage: statements **60.36%** / branches **75.5%** / functions **68.35%**.
|
|
41
|
+
|
|
42
|
+
## [3.1.0] - 2026-04-22
|
|
43
|
+
|
|
44
|
+
### Added — `--resume` for `generate` and `batch generate`
|
|
45
|
+
|
|
46
|
+
- **`sdlab generate --resume`** — skip subjects whose record JSON and output PNG are already on disk. Seeds remain stable: skipped slots still advance the seed counter so resumed runs are bit-identical to a fresh run that reaches the same point. Final summary now reports `(N errors, M resumed)`.
|
|
47
|
+
- **`sdlab batch generate --resume <batch_id>`** — re-runs only failed/missing slots in an existing batch, keeps the same `batch_id`, and inherits `mode_id`/`subject_id`/`theme`/`asset_ref` from the prior manifest. Surfaces "(C/T slots already complete)" in the header. Throws `BATCH_NOT_FOUND` for a bad id and `BATCH_NO_PROGRESS` for pre-checkpoint manifests that can't be partially resumed.
|
|
48
|
+
- **Manifest format:** `slots[].status` is now persisted (`'ok'` or `'error'`) so resume can distinguish failures from successes. Older manifests fall back to "selected_output truthy = success" for compatibility.
|
|
49
|
+
- New helpers: `buildCompletedSlotMap()`, `openBatchDirForResume()` in `lib/batch-runs.js`.
|
|
50
|
+
- 7 new tests in `tests/lib-pipeline/batch-resume.test.js`.
|
|
51
|
+
|
|
52
|
+
### Fixed — Deterministic SaveImage node selection (PB-003)
|
|
53
|
+
|
|
54
|
+
- **`lib/comfyui-output.js`** (new): `pickOutputImage(outputs, { preferNodeId })` selects the canonical SaveImage output deterministically. Previously, `comfyui-runner.js` and `generate.js` used `Object.values(outputs)` and broke on the first node with images — first-wins ordering depends on ComfyUI's execution scheduler, not the workflow graph.
|
|
55
|
+
- **Selection precedence:** explicit `preferNodeId` (from the workflow builder's `saveNodeId` or a brief's `expected_outputs.save_node_id`) → highest numeric node id (typical "final save" convention) → first iteration entry (only for non-numeric ids).
|
|
56
|
+
- `lib/adapters/comfyui-runner.js` and `scripts/generate.js` both updated to thread `saveNodeId` through to the picker.
|
|
57
|
+
- Run output records now include `comfy_node_id` so the chosen save node is auditable from the manifest.
|
|
58
|
+
- 9 new tests in `tests/lib-pipeline/comfyui-output.test.js`.
|
|
59
|
+
|
|
60
|
+
### Added — CI coverage reporting
|
|
61
|
+
|
|
62
|
+
- **`c8`** added as a `devDependency`; new `npm run coverage` script runs the full test suite under c8 with text + lcov + text-summary reporters (covering `lib/**/*.js`).
|
|
63
|
+
- **CI**: Node 22 matrix entry now runs `npm run coverage` and uploads `coverage/lcov.info` to Codecov via `codecov/codecov-action@v5` (`continue-on-error: true` so a Codecov outage never blocks the PR).
|
|
64
|
+
- **README**: CI and Codecov badges added beside the npm/license badges.
|
|
65
|
+
- **`.gitignore`**: `coverage/` and `.nyc_output/` excluded.
|
|
66
|
+
- Baseline coverage at this commit: **statements 40.6% / branches 70.7% / functions 54.0%** — meaningful coverage on `lib/snapshot.js`, `lib/split.js`, `lib/log.js`, `lib/args.js`, `lib/runtime-runs.js`; adapters and selection layers still uncovered (deferred to future passes).
|
|
67
|
+
|
|
68
|
+
### Fixed — Mobile nav on landing + handbook (SB-SDL-007)
|
|
69
|
+
|
|
70
|
+
- **`site/src/layouts/SiteLayout.astro`**: header was `hidden md:flex` for both the link nav and the npm/GitHub buttons, leaving phones with the brand mark and nothing else. Added a hamburger toggle (`md:hidden`) that opens a drawer containing all the same links plus npm/GitHub. Implemented as a `<details>`/`<summary>` so it works without any JavaScript or framework dependency.
|
|
71
|
+
- The desktop nav and the GitHub button still render unchanged at `md:` and up.
|
|
72
|
+
|
|
73
|
+
### Changed — Training adapter registry (DB-007)
|
|
74
|
+
|
|
75
|
+
- **`lib/training-adapters.js`** (new): explicit `ADAPTER_REGISTRY` with `loadAdapter()`, `listAdapters()`, `isRegisteredAdapter()`. Replaces the hand-maintained adapter list embedded in a `lib/training-packages.js` error string.
|
|
76
|
+
- **`lib/training-packages.js`**: dropped its private `loadAdapter()`; now imports from the registry. Unknown adapters throw `ADAPTER_NOT_REGISTERED` (input error, exit 1) with the available-adapter list always in sync. Registered-but-missing modules throw `ADAPTER_MODULE_LOAD_FAILED` (distinct from a typo).
|
|
77
|
+
- **`lib/training-profiles.js`**: `validateProfile()` now rejects profiles whose `adapter_targets[]` cite an unregistered adapter — surfaces typos at profile load time instead of at package-build time.
|
|
78
|
+
- 8 new tests in `tests/lib-pipeline/training-adapters.test.js`.
|
|
79
|
+
|
|
80
|
+
To add a new adapter (e.g. `kohya-lora`, `onedtrainer`): write `lib/adapters/<id>.js` exporting `buildPackage(opts)` and add a one-line entry to `ADAPTER_REGISTRY`. The error message, profile validation, and (eventually) CLI completion all pick it up automatically.
|
|
81
|
+
|
|
5
82
|
## [3.0.1] - 2026-04-21
|
|
6
83
|
|
|
7
84
|
### Fixed — Dogfood swarm health pass (Stage A: bugs & security)
|
package/README.es.md
CHANGED
|
@@ -8,16 +8,18 @@
|
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
10
|
<a href="https://www.npmjs.com/package/@mcptoolshop/style-dataset-lab"><img src="https://img.shields.io/npm/v/@mcptoolshop/style-dataset-lab" alt="npm"></a>
|
|
11
|
+
<a href="https://github.com/mcp-tool-shop-org/style-dataset-lab/actions/workflows/ci.yml"><img src="https://github.com/mcp-tool-shop-org/style-dataset-lab/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
12
|
+
<a href="https://codecov.io/gh/mcp-tool-shop-org/style-dataset-lab"><img src="https://codecov.io/gh/mcp-tool-shop-org/style-dataset-lab/branch/main/graph/badge.svg" alt="codecov"></a>
|
|
11
13
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License"></a>
|
|
12
14
|
</p>
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
Escribe tus reglas visuales. Genera arte. Evalúa cada imagen según esas reglas. Entrega los resultados como datos de entrenamiento auditables y versionados, y luego utiliza los modelos entrenados en flujos de trabajo de producción reales, e introduce las mejores salidas nuevamente en tu corpus.
|
|
15
17
|
|
|
16
|
-
Style Dataset Lab conecta lo que
|
|
18
|
+
Style Dataset Lab conecta lo que has definido sobre tu estilo artístico con el conjunto de datos del cual realmente estás entrenando, y luego cierra el ciclo a lo largo de todo el proceso de producción. Defines una constitución: reglas de silueta, restricciones de paleta, lenguaje de materiales, o cualquier cosa que sea importante para tu proyecto. El flujo de trabajo genera candidatos, los evalúa según esas reglas y empaqueta el trabajo aprobado en conjuntos de datos reproducibles donde cada registro explica por qué se incluyó.
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
Luego, el entorno de trabajo de producción toma el control: compila resúmenes de generación a partir de la información del proyecto, ejecútalos a través de ComfyUI, evalúa las salidas, produce en lote hojas de expresión y paneles de entorno, selecciona los mejores resultados y vuelve a introducirlos como nuevos candidatos. El ciclo se cierra: producir, seleccionar, revisar, mejorar.
|
|
19
21
|
|
|
20
|
-
## El
|
|
22
|
+
## El flujo de trabajo
|
|
21
23
|
|
|
22
24
|
```bash
|
|
23
25
|
# Write your canon. Scaffold the project.
|
|
@@ -28,59 +30,104 @@ sdlab generate inputs/prompts/wave1.json --project my-project
|
|
|
28
30
|
sdlab curate <id> approved "Strong silhouette, correct faction palette"
|
|
29
31
|
|
|
30
32
|
# Bind approved work to constitution rules
|
|
31
|
-
sdlab bind
|
|
33
|
+
# (`sdlab bind` is a shorter alias for `canon-bind`)
|
|
34
|
+
sdlab canon-bind --project my-project
|
|
32
35
|
|
|
33
36
|
# Freeze a versioned dataset
|
|
34
37
|
sdlab snapshot create --project my-project
|
|
35
38
|
sdlab split build
|
|
36
39
|
sdlab export build
|
|
37
40
|
|
|
38
|
-
# Build a training package
|
|
41
|
+
# Build a training package
|
|
39
42
|
sdlab training-manifest create --profile character-style-lora
|
|
40
43
|
sdlab training-package build
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
|
|
45
|
+
# Compile a production brief and run it
|
|
46
|
+
sdlab brief compile --workflow character-portrait-set --subject kael_maren
|
|
47
|
+
sdlab run generate --brief brief_2026-04-16_001
|
|
48
|
+
|
|
49
|
+
# Critique, refine, batch-produce
|
|
50
|
+
sdlab critique --run run_2026-04-16_001
|
|
51
|
+
sdlab refine --run run_2026-04-16_001 --pick 001.png
|
|
52
|
+
sdlab batch generate --mode expression-sheet --subject kael_maren
|
|
53
|
+
|
|
54
|
+
# Select the best outputs and bring them back
|
|
55
|
+
sdlab select --run run_2026-04-16_001 --approve 001.png,003.png
|
|
56
|
+
sdlab reingest selected --selection selection_2026-04-16_001
|
|
43
57
|
```
|
|
44
58
|
|
|
45
|
-
|
|
59
|
+
Ese último comando es el punto clave. Las salidas seleccionadas vuelven a pasar por el mismo proceso de revisión que todo lo demás. El corpus crece y las reglas se mantienen.
|
|
60
|
+
|
|
61
|
+
## Creación del canon
|
|
62
|
+
|
|
63
|
+
Antes de que se ejecute el flujo de trabajo del conjunto de datos, el espacio de nombres `sdlab canon *` convierte el almacén de entidades del canon de tu proyecto en los tres proyecciones que realmente utiliza el entrenamiento y la producción, y bloquea las entradas que no deben modificarse.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Build three projections from the canon entity store:
|
|
67
|
+
# dataset.jsonl → training adapters
|
|
68
|
+
# prompts/*.j2 → ComfyUI workflow invocation
|
|
69
|
+
# context/*.md → Role OS narrative dispatch
|
|
70
|
+
sdlab canon build --project my-project
|
|
71
|
+
|
|
72
|
+
# Freeze an entry so regeneration can't silently change it
|
|
73
|
+
sdlab canon freeze kael_maren --project my-project --reason "prologue portrait locked"
|
|
74
|
+
|
|
75
|
+
# Report drift on frozen entries since the last clean build
|
|
76
|
+
sdlab canon drift --project my-project
|
|
77
|
+
```
|
|
46
78
|
|
|
47
|
-
|
|
79
|
+
`canon build` es direccionable por contenido: su salida se identifica mediante un `canon_sha` y se almacena en caché, de modo que una reconstrucción del canon sin cambios se realiza instantáneamente. `canon freeze` registra cada congelación frente a una compilación específica y la agrega a un registro de auditoría `freeze-events.jsonl`: las entradas `frozen` rechazan explícitamente la regeneración, las entradas `soft-advisory` la rechazan por defecto (se puede omitir con `--i-know`). `canon drift` vuelve a calcular el hash de cada entrada observada y marca cualquier cosa que haya cambiado desde la última compilación limpia.
|
|
48
80
|
|
|
49
|
-
|
|
81
|
+
Flujo de trabajo completo en el manual: [Canon build](handbook/canon-build/), [Canon freeze](handbook/canon-freeze/) y [Two-LoRA stacking](handbook/two-lora-stacking/).
|
|
50
82
|
|
|
51
|
-
|
|
83
|
+
## Qué produce
|
|
84
|
+
|
|
85
|
+
Siete artefactos del conjunto de datos y un entorno de trabajo de producción completo. Cada artefacto se vincula a sus predecesores para que puedas rastrear cualquier registro de entrenamiento hasta la regla que lo aprobó.
|
|
86
|
+
|
|
87
|
+
| Artefacto | Qué es |
|
|
52
88
|
|----------|-----------|
|
|
53
|
-
| **Snapshot** | Selección de registros
|
|
54
|
-
| **Split** | Partición de entrenamiento/validación/prueba donde las familias de sujetos nunca cruzan límites. |
|
|
55
|
-
| **Export package** | Conjunto de datos
|
|
56
|
-
| **Eval pack** | Tareas de prueba
|
|
57
|
-
| **Training package** | Diseño listo para el entrenamiento a través de adaptadores (`diffusers-lora`, `generic-image-caption`). La misma información,
|
|
58
|
-
| **Eval scorecard** |
|
|
59
|
-
| **Implementation pack** | Ejemplos de indicaciones,
|
|
89
|
+
| **Snapshot** | Selección de registros congelados con huella digital de configuración. Cada inclusión tiene una razón explícita. |
|
|
90
|
+
| **Split** | Partición de entrenamiento/validación/prueba donde las familias de sujetos nunca cruzan los límites. |
|
|
91
|
+
| **Export package** | Conjunto de datos autónomo: manifiesto, metadatos, imágenes, divisiones, tarjeta del conjunto de datos, sumas de comprobación. |
|
|
92
|
+
| **Eval pack** | Tareas de prueba con conocimiento del canon: cobertura de carriles, desviación prohibida, ancla/oro, continuidad del sujeto. |
|
|
93
|
+
| **Training package** | Diseño listo para el entrenamiento a través de adaptadores (`diffusers-lora`, `generic-image-caption`). La misma información, diferente formato. |
|
|
94
|
+
| **Eval scorecard** | Aprobación/rechazo por tarea basada en la evaluación de las salidas generadas con respecto a los paquetes de evaluación. |
|
|
95
|
+
| **Implementation pack** | Ejemplos de indicaciones, fallas conocidas, pruebas de continuidad y orientación para volver a introducir datos. |
|
|
96
|
+
|
|
97
|
+
El entorno de trabajo de producción agrega:
|
|
60
98
|
|
|
61
|
-
|
|
99
|
+
| Superficie | Qué hace |
|
|
100
|
+
|---------|-------------|
|
|
101
|
+
| **Compiled brief** | Instrucción de generación determinista a partir del perfil del flujo de trabajo + la información del proyecto. |
|
|
102
|
+
| **Run** | Artefacto de ejecución congelado: resumen + semillas + salidas de ComfyUI + manifiesto. |
|
|
103
|
+
| **Critique** | Evaluación estructurada multidimensional de las salidas de ejecución con respecto al canon. |
|
|
104
|
+
| **Batch** | Producción coordinada en múltiples ranuras (hojas de expresión, paneles de entorno, paquetes de silueta). |
|
|
105
|
+
| **Selection** | Artefacto de decisión creativa: qué salidas se eligieron, por qué y de dónde provienen. |
|
|
106
|
+
| **Re-ingest** | Las salidas seleccionadas se devuelven como registros candidatos con el origen completo de la generación. |
|
|
62
107
|
|
|
63
|
-
|
|
108
|
+
## Por qué existe esto
|
|
64
109
|
|
|
65
|
-
|
|
110
|
+
Los datos de entrenamiento son el artefacto más importante en cualquier flujo de trabajo de IA visual. Pero la mayoría de los datos de entrenamiento son una carpeta de imágenes sin historial, sin rastro de evaluación y sin conexión con las reglas de estilo que se suponía que debían seguir.
|
|
66
111
|
|
|
67
|
-
|
|
112
|
+
Style Dataset Lab hace que la conexión sea explícita. Tu constitución define las reglas. Tu rúbrica define las dimensiones de puntuación. Tus registros de curación registran el juicio. El enlace del canon prueba la conexión. Y tu conjunto de datos lleva todo eso adelante como información estructurada, consultable y reproducible.
|
|
113
|
+
|
|
114
|
+
El resultado práctico: cuando tu LoRA se desvía, puedes preguntar *por qué*. Cuando tu próxima ronda de entrenamiento necesita mejores datos, sabes exactamente qué registros son casi correctos y cuál es la única regla que no cumplieron. Cuando un nuevo miembro del equipo pregunta cuál es el lenguaje visual del proyecto, la respuesta no es un panel de Figma, sino una constitución consultable con 1182 ejemplos calificados.
|
|
68
115
|
|
|
69
116
|
## Cinco dominios, reglas reales
|
|
70
117
|
|
|
71
|
-
No son plantillas genéricas. Cada dominio
|
|
118
|
+
No son plantillas genéricas. Cada dominio se entrega con reglas de constitución de grado de producción, definiciones de carriles, rúbricas de puntuación y vocabulario de grupo.
|
|
72
119
|
|
|
73
|
-
| Dominio
|
|
120
|
+
| Dominio | Carriles | Qué se evalúa |
|
|
74
121
|
|--------|-------|-----------------|
|
|
75
|
-
| **game-art** | personaje, entorno, accesorio, interfaz de usuario, nave, interior, equipo
|
|
76
|
-
| **character-design** | retrato, cuerpo
|
|
77
|
-
| **creature-design** | concepto, ortográfico, estudio de detalles, acción, referencia de escala, hábitat
|
|
78
|
-
| **architecture** | exterior, interior, paisaje urbano, detalle estructural, ruina, paisaje
|
|
79
|
-
| **vehicle-mech** | exterior, cabina, componente, esquema, hoja de silueta, variante de daño
|
|
122
|
+
| **game-art** | personaje, entorno, accesorio, interfaz de usuario, nave, interior, equipo | Silueta a escala de juego, identificación de facción, desgaste y envejecimiento |
|
|
123
|
+
| **character-design** | retrato, cuerpo completo, rotación, hoja de expresión, pose de acción | Proporciones, lógica del disfraz, personalidad, claridad del gesto |
|
|
124
|
+
| **creature-design** | concepto, ortográfico, estudio de detalles, acción, referencia de escala, hábitat | Anatomía, lógica evolutiva, distinción de la silueta |
|
|
125
|
+
| **architecture** | exterior, interior, paisaje urbano, detalle estructural, ruina, paisaje | Estructura, consistencia del material, perspectiva, coherencia de la época |
|
|
126
|
+
| **vehicle-mech** | exterior, cabina, componente, esquema, hoja de silueta, variante de daño | Lógica mecánica, lenguaje de diseño, puntos de acceso, narrativa de daños |
|
|
80
127
|
|
|
81
128
|
## Estructura del proyecto
|
|
82
129
|
|
|
83
|
-
Cada proyecto es independiente. Cinco archivos de configuración JSON definen las reglas; todo lo demás
|
|
130
|
+
Cada proyecto es independiente. Cinco archivos de configuración JSON definen las reglas; todo lo demás son datos.
|
|
84
131
|
|
|
85
132
|
```
|
|
86
133
|
projects/my-project/
|
|
@@ -94,21 +141,27 @@ projects/my-project/
|
|
|
94
141
|
splits/ Train/val/test partitions
|
|
95
142
|
exports/ Versioned export packages
|
|
96
143
|
training/ Profiles, manifests, packages, eval runs, implementations
|
|
144
|
+
workflows/ Workflow profiles + batch mode definitions
|
|
145
|
+
briefs/ Compiled generation briefs
|
|
146
|
+
runs/ Execution artifacts (brief + outputs + manifest)
|
|
147
|
+
batches/ Coordinated multi-slot productions
|
|
148
|
+
selections/ Chosen outputs with reasons and provenance
|
|
149
|
+
inbox/generated/ Re-ingested images awaiting review
|
|
97
150
|
```
|
|
98
151
|
|
|
99
152
|
## Propiedades de confianza
|
|
100
153
|
|
|
101
|
-
Estas no son
|
|
154
|
+
Estas no son aspiracionales. Se aplican rigurosamente.
|
|
102
155
|
|
|
103
156
|
- **Las instantáneas son inmutables.** La huella digital de la configuración (SHA-256) demuestra que nada ha cambiado.
|
|
104
|
-
- **Las divisiones evitan fugas
|
|
105
|
-
- **Los manifiestos son contratos
|
|
106
|
-
- **Los adaptadores no pueden modificar la
|
|
107
|
-
- **Las salidas generadas
|
|
157
|
+
- **Las divisiones evitan fugas.** Las familias de sujetos (por identidad, linaje o sufijo de ID) nunca cruzan los límites de las particiones.
|
|
158
|
+
- **Los manifiestos son contratos congelados.** Hash de exportación + huella digital de la configuración. Si algo cambia, cree uno nuevo.
|
|
159
|
+
- **Los adaptadores no pueden modificar la verdad.** Diseño diferente, mismos registros. Sin adiciones, sin eliminaciones, sin reclasificaciones.
|
|
160
|
+
- **Las salidas generadas vuelven a entrar mediante revisión.** No hay atajos. Curar y vincular como todo lo demás.
|
|
108
161
|
|
|
109
162
|
## Star Freight
|
|
110
163
|
|
|
111
|
-
El repositorio incluye un ejemplo
|
|
164
|
+
El repositorio incluye un ejemplo completo y funcional: 1.182 registros, 5 facciones, 7 rutas, 24 reglas de constitución, 892 activos aprobados, 2 perfiles de entrenamiento. Un canon visual de ciencia ficción con toques ásperos, totalmente curado.
|
|
112
165
|
|
|
113
166
|
```bash
|
|
114
167
|
git clone https://github.com/mcp-tool-shop-org/style-dataset-lab
|
|
@@ -118,9 +171,9 @@ sdlab snapshot create --project star-freight # 839 eligible records
|
|
|
118
171
|
sdlab split build --project star-freight # zero subject leakage
|
|
119
172
|
```
|
|
120
173
|
|
|
121
|
-
## Formatos
|
|
174
|
+
## Formatos posteriores
|
|
122
175
|
|
|
123
|
-
`sdlab` es el propietario del conjunto de datos. La conversión de
|
|
176
|
+
`sdlab` es el propietario del conjunto de datos. La conversión de formato la gestiona [`repo-dataset`](https://github.com/mcp-tool-shop-org/repo-dataset): TRL, LLaVA, Qwen2-VL, JSONL, Parquet y más. `repo-dataset` renderiza; nunca decide qué incluir.
|
|
124
177
|
|
|
125
178
|
## Instalación
|
|
126
179
|
|
|
@@ -130,9 +183,69 @@ npm install -g @mcptoolshop/style-dataset-lab
|
|
|
130
183
|
|
|
131
184
|
Requiere Node.js 20+ y [ComfyUI](https://github.com/comfyanonymous/ComfyUI) en localhost:8188 para la generación.
|
|
132
185
|
|
|
186
|
+
### Pruébalo sin ComfyUI
|
|
187
|
+
|
|
188
|
+
Puedes explorar toda la funcionalidad que no implica la generación (inspección, curación, instantánea, división, exportación) utilizando el proyecto Star Freight incluido sin instalar ComfyUI ni descargar ningún peso de SDXL.
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Scaffold a fresh project (no ComfyUI needed)
|
|
192
|
+
sdlab init test --domain game-art
|
|
193
|
+
|
|
194
|
+
# Run the canonical health check (no ComfyUI needed)
|
|
195
|
+
sdlab project doctor --project test
|
|
196
|
+
|
|
197
|
+
# Dry-run a snapshot against the bundled Star Freight corpus
|
|
198
|
+
sdlab snapshot create --dry-run --project star-freight
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
`sdlab project doctor` valida cada configuración del proyecto (constitución, rutas, rúbrica, terminología) e informa sobre la elegibilidad sin tocar la GPU. Cualquier comando que modifique el estado generado acepta `--dry-run` para previsualizar el efecto primero.
|
|
202
|
+
|
|
203
|
+
Si olvidas `--project`, la CLI recurre al primer proyecto que encuentra en `projects/` e imprime una advertencia; pasa `--project` explícitamente para silenciarla.
|
|
204
|
+
|
|
205
|
+
### Reanudando una ejecución interrumpida
|
|
206
|
+
|
|
207
|
+
Las ejecuciones de generación largas se pueden reanudar sin rehacer el trabajo completado:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Skip subjects whose record + image are already on disk.
|
|
211
|
+
# Seeds are preserved — resumed runs are bit-identical to fresh ones.
|
|
212
|
+
sdlab generate inputs/prompts/wave1.json --project my-project --resume
|
|
213
|
+
|
|
214
|
+
# Re-run only failed/missing slots in an existing batch.
|
|
215
|
+
# Inherits mode/subject/theme from the prior manifest.
|
|
216
|
+
sdlab batch generate --resume batch_2026-04-22_001 --project my-project
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Ambos comandos funcionan porque cada ranura escribe su entrada de manifiesto atómicamente al finalizar; un fallo a mitad de la ejecución nunca corrompe el estado parcial.
|
|
220
|
+
|
|
221
|
+
## Solución de problemas
|
|
222
|
+
|
|
223
|
+
Modos de fallo comunes y soluciones:
|
|
224
|
+
|
|
225
|
+
**`ECONNREFUSED 127.0.0.1:8188` en cualquier `sdlab generate` / `sdlab run generate` / `sdlab batch generate`**
|
|
226
|
+
ComfyUI no se está ejecutando. Inicia ComfyUI (`python main.py --listen 127.0.0.1 --port 8188`) y confirma con `curl http://127.0.0.1:8188/system_stats`. Para apuntar a un host/puerto diferente, establece `COMFY_URL=http://host:port`.
|
|
227
|
+
|
|
228
|
+
**`missing checkpoint` / `LoRA weight not found`**
|
|
229
|
+
El perfil de flujo de trabajo especifica un archivo de modelo que no está en la carpeta `models/checkpoints/` o `models/loras/` de ComfyUI. Abre `projects/<project>/workflows/profiles/<profile>.json`, localiza el campo `checkpoint` o `lora` y, ya sea descarga el peso referenciado o cámbialo por uno que ya tengas. Vuelve a ejecutar `sdlab project doctor --project <project>` para confirmar la solución.
|
|
230
|
+
|
|
231
|
+
**Errores de `sdlab project doctor`**
|
|
232
|
+
Doctor devuelve códigos de error estructurados. Algunos comunes:
|
|
233
|
+
- `E_PROJECT_NOT_FOUND`: el directorio del proyecto no existe en `projects/`. Verifica la ortografía.
|
|
234
|
+
- `E_CONFIG_INVALID`: uno de los cinco archivos de configuración JSON falló la validación del esquema. El campo `hint` indica el archivo y el campo incorrectos.
|
|
235
|
+
- `E_RECORD_DRIFT`: la huella digital de la configuración de un registro ya no coincide con su origen. Vuelve a curar o vuelve a vincular según lo que sugiera la pista.
|
|
236
|
+
|
|
237
|
+
**`No --project specified, falling back to <name>`**
|
|
238
|
+
Una advertencia leve. Pasa `--project <name>` explícitamente para seleccionar el proyecto correcto y silenciar la advertencia.
|
|
239
|
+
|
|
240
|
+
**Problemas de memoria VRAM / "Painterly"**
|
|
241
|
+
Consulta `docs/internal/HANDOFF.md` para obtener las notas sobre el ajuste del ruido "painterly". En resumen: reduce la intensidad del ruido, disminuye el tamaño del lote o cambia a un punto de control más pequeño en tu perfil de flujo de trabajo.
|
|
242
|
+
|
|
243
|
+
**Informar errores**
|
|
244
|
+
Crea un problema en https://github.com/mcp-tool-shop-org/style-dataset-lab/issues con tu versión de sdlab (`sdlab --version`), la versión de Node (`node -v`), el comando completo y la salida de error estructurada. Una plantilla de informe de errores rellena previamente los campos.
|
|
245
|
+
|
|
133
246
|
## Seguridad
|
|
134
247
|
|
|
135
|
-
Solo
|
|
248
|
+
Solo local. Sin telemetría, sin análisis, sin solicitudes externas. Las imágenes permanecen en tu GPU y sistema de archivos.
|
|
136
249
|
|
|
137
250
|
## Licencia
|
|
138
251
|
|
|
@@ -140,4 +253,4 @@ MIT
|
|
|
140
253
|
|
|
141
254
|
---
|
|
142
255
|
|
|
143
|
-
Creado por <a href="https://mcp-tool-shop.github.io/">MCP Tool Shop</a
|
|
256
|
+
Creado por <a href="https://mcp-tool-shop.github.io/">MCP Tool Shop</a>
|