@mcptoolshop/style-dataset-lab 2.0.0 → 2.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/README.it.md CHANGED
@@ -13,158 +13,187 @@
13
13
 
14
14
  # style-dataset-lab
15
15
 
16
- Una pipeline per la creazione di dataset visivi, che parte da regole definite (canon), passa attraverso prompt strutturati, generazione con ComfyUI e arriva a dati di training curati e conformi alle regole stabilite.
16
+ Trasformare i contenuti visivi approvati in set di dati versionati, supportati da revisioni, suddivisioni, pacchetti di esportazione e pacchetti di valutazione.
17
17
 
18
18
  ## Di cosa si tratta
19
19
 
20
- Una **pipeline** per la creazione di dataset visivi strutturati per l'addestramento. Si definiscono regole di stile (canon), si compongono prompt, si genera con ComfyUI, si effettua una selezione basata su criteri dimensionali, si collegano le valutazioni alle regole di stile e si esportano i dati in 10 formati tramite [`@mcptoolshop/repo-dataset`](https://github.com/mcp-tool-shop-org/repo-dataset).
20
+ Una **pipeline per la creazione di un canone visivo e di set di dati**. Definisci l'aspetto del tuo progetto. Seleziona i contenuti in base alle regole definite. Crea pacchetti di set di dati riproducibili con suddivisioni sicure da "data leakage". Genera pacchetti di valutazione per la verifica futura dei modelli.
21
21
 
22
- La pipeline è indipendente dal gioco. Ogni gioco ha la propria directory di dati, situata in `games/<nome>/`; gli script e i modelli predefiniti sono condivisi. Ogni risorsa generata contiene tre elementi:
22
+ La pipeline produce quattro elementi:
23
23
 
24
- 1. **Pixel dell'immagine** -- generati da ComfyUI con informazioni complete sulla provenienza (checkpoint, LoRA, seed, sampler, cfg).
25
- 2. **Spiegazione in base alle regole (canon)** -- motivazione per cui l'immagine è conforme o non conforme allo stile definito, basata su una costituzione di stile.
26
- 3. **Valutazione della qualità** -- approvata/rifiutata con punteggi dimensionali e regole citate.
24
+ | Elemento | Descrizione |
25
+ |----------|-----------|
26
+ | **Snapshot** | Selezione di record idonei, "congelata" e con "impronta digitale". Ogni inclusione ha una traccia esplicita della motivazione. |
27
+ | **Split** | Partizione train/val/test sicura da "data leakage". I record che condividono la stessa famiglia di soggetti vengono sempre inseriti nella stessa partizione. |
28
+ | **Export package** | Set di dati autonomo: manifest, metadati, immagini, suddivisioni, scheda del set di dati e checksum. |
29
+ | **Eval pack** | Compiti di verifica attenti al canone: copertura delle aree, prevenzione di derive indesiderate, ancoraggi/riferimenti, coerenza dei soggetti. |
27
30
 
28
- ## Modello di sicurezza
29
-
30
- **Esclusivamente locale.** style-dataset-lab comunica con ComfyUI su `localhost:8188` e non effettua richieste a reti esterne. Nessuna telemetria, nessuna analisi, nessuna trasmissione di dati. La generazione delle immagini avviene interamente sulla vostra GPU. I dati e le informazioni relative alle regole rimangono sul vostro filesystem.
31
-
32
- ## Cosa include il pacchetto npm
33
-
34
- `npm install @mcptoolshop/style-dataset-lab` fornisce:
31
+ Ogni risorsa all'interno della pipeline contiene tre elementi:
35
32
 
36
- - **13 script** -- per la generazione, la selezione, il confronto, l'associazione alle regole, la creazione di immagini pittoriche, la generazione di identità, la generazione con ControlNet/IP-Adapter, la selezione in blocco e la migrazione.
37
- - **Modelli predefiniti** -- costituzione di base, griglia di valutazione e pacchetto di esempi di prompt, situati nella directory `templates/`.
33
+ 1. **Provenienza** -- cronologia completa della generazione (checkpoint, LoRA, seed, sampler, cfg, timing)
34
+ 2. **Vincolo al canone** -- quali regole del canone questa risorsa soddisfa, non soddisfa o soddisfa parzialmente
35
+ 3. **Valutazione della qualità** -- approvato/rifiutato/al limite, con punteggi per ogni dimensione.
38
36
 
39
- Il pacchetto npm **non** include i dati del gioco. Clonate il repository se desiderate l'esempio di Star Freight (1.182 record, 28 sequenze di prompt, 18 categorie visive).
37
+ Adatto per arte di videogiochi, progettazione di personaggi, progettazione di creature, architettura, concept di veicoli/meccanismi e qualsiasi dominio in cui la produzione visiva deve rimanere coerente.
40
38
 
41
- ## Installazione
39
+ ## Guida rapida
42
40
 
43
41
  ```bash
44
- # Get the pipeline scripts + templates
45
- npm install @mcptoolshop/style-dataset-lab
42
+ # Install the CLI + pipeline
43
+ npm install -g @mcptoolshop/style-dataset-lab
46
44
 
47
- # Or clone the repo for the Star Freight example data
48
- git clone https://github.com/mcp-tool-shop-org/style-dataset-lab
49
- cd style-dataset-lab
50
- npm install
45
+ # Scaffold a new project
46
+ sdlab init my-project --domain character-design
47
+
48
+ # Validate the project structure
49
+ sdlab project doctor --project my-project
51
50
  ```
52
51
 
53
- Per iniziare un nuovo gioco a partire dai modelli:
52
+ Domini disponibili: `game-art`, `character-design`, `creature-design`, `architecture`, `vehicle-mech` o `generic`.
53
+
54
+ ## Interfaccia a riga di comando (CLI)
54
55
 
55
56
  ```bash
56
- # Copy templates into your game directory
57
- mkdir -p games/my-game/{records,comparisons,inputs/prompts,outputs/{candidates,approved,rejected,borderline,painterly},exports}
58
- cp -r templates/canon games/my-game/canon
59
- cp templates/inputs/prompts/example-wave.json games/my-game/inputs/prompts/wave1.json
60
- # Edit the canon and prompts, then generate
57
+ sdlab init <name> [--domain <domain>] # Scaffold a new project
58
+ sdlab project doctor [--project <name>] # Validate project config
59
+
60
+ sdlab generate <pack> [--project <name>] # Generate candidates via ComfyUI
61
+ sdlab generate:identity <packet> # Named-subject identity images
62
+ sdlab generate:controlnet # ControlNet-guided generation
63
+ sdlab generate:ipadapter # IP-Adapter reference-guided
64
+
65
+ sdlab curate <id> <status> <explanation> # Record review judgment
66
+ sdlab compare <a> <b> <winner> <reason> # Pairwise A-vs-B comparison
67
+ sdlab bind [--project <name>] # Bind records to constitution rules
68
+ sdlab painterly [--project <name>] # Post-processing style pass
69
+
70
+ sdlab snapshot create [--profile <name>] # Create frozen dataset snapshot
71
+ sdlab snapshot list # List all snapshots
72
+ sdlab snapshot diff <a> <b> # Compare two snapshots
73
+ sdlab eligibility audit # Audit record training eligibility
74
+ sdlab split build [--snapshot <id>] # Build train/val/test split
75
+ sdlab split audit <id> # Audit split for leakage + balance
76
+ sdlab card generate # Generate dataset card (md + JSON)
77
+ sdlab export build [--snapshot <id>] # Build versioned export package
78
+ sdlab eval-pack build # Build canon-aware eval pack
61
79
  ```
62
80
 
63
- ## Struttura del monorepository
81
+ Tutti i comandi accettano `--project <nome>` (predefinito: `star-freight`).
82
+
83
+ ## Modello del progetto
64
84
 
65
- La pipeline si trova nelle directory `scripts/` e `templates/`. Ogni gioco si trova nella directory `games/<nome>/` e contiene le proprie regole, i dati e le risorse. Gli script accettano l'argomento `--game <nome>` (il valore predefinito è `star-freight`).
85
+ Ogni progetto è una directory autonoma all'interno di `projects/`, con il proprio canone, configurazione e dati.
66
86
 
67
87
  ```
68
- style-dataset-lab/
69
- scripts/ 13 pipeline scripts (generate, curate, compare, etc.)
70
- templates/ Blank starting point for new games
71
- canon/ Starter constitution + review rubric
72
- inputs/prompts/ Example prompt pack
73
- games/
74
- star-freight/ Star Freight example (1,182 records, repo-only)
75
- canon/ Style constitution, review rubric, species canon
76
- records/ Per-asset JSON (provenance + judgment + canon)
77
- comparisons/ A-vs-B preference judgments
78
- inputs/ Prompt packs, identity packets, references
79
- outputs/ Generated images (gitignored)
80
- exports/ repo-dataset output (gitignored)
81
- <your-game>/ Add more games with the same structure
88
+ projects/
89
+ my-project/
90
+ project.json Project identity + generation defaults
91
+ constitution.json Rules array with rationale templates
92
+ lanes.json Subject lanes with detection patterns
93
+ rubric.json Scoring dimensions + thresholds
94
+ terminology.json Group vocabulary + detection order
95
+ canon/ Style constitution (markdown)
96
+ records/ Per-asset JSON (provenance + judgment + canon)
97
+ inputs/prompts/ Prompt packs (JSON)
98
+ outputs/ Generated images (gitignored)
99
+ comparisons/ A-vs-B preference judgments
100
+ snapshots/ Frozen dataset snapshots
101
+ splits/ Train/val/test partitions
102
+ exports/ Versioned export packages
103
+ eval-packs/ Canon-aware eval instruments
82
104
  ```
83
105
 
84
- ## Flusso di lavoro della pipeline
106
+ ## Pipeline
85
107
 
86
- L'intero flusso di lavoro, dalle regole alla creazione dei dati per l'addestramento:
87
-
88
- ```bash
89
- # 1. Write your canon -- style constitution + review rubric
90
- # (start from templates/ or write from scratch)
108
+ ```
109
+ canon → generate → curate → bind → snapshot → split → export → eval
110
+ | | | | | | | |
111
+ rules ComfyUI judgment rules frozen subject package verify
112
+ selection isolation
113
+ ```
91
114
 
92
- # 2. Create prompt packs in inputs/prompts/
93
- # (see templates/inputs/prompts/example-wave.json)
115
+ 1. **Definisci il canone** -- scrivi la tua costituzione dello stile e la griglia di valutazione.
116
+ 2. **Genera** -- ComfyUI produce candidati con piena provenienza.
117
+ 3. **Seleziona** -- approva/rifiuta con punteggi per ogni dimensione e modalità di errore.
118
+ 4. **Collega** -- associa ogni risorsa alle regole del canone con verdetto di successo/fallimento/parziale.
119
+ 5. **Snapshot** -- "congela" i record idonei in una selezione deterministica e con "impronta digitale".
120
+ 6. **Suddividi** -- partiziona in train/val/test con isolamento dei soggetti e bilanciamento delle aree.
121
+ 7. **Esporta** -- crea un pacchetto autonomo con manifest, metadati, immagini e checksum.
122
+ 8. **Valuta** -- genera strumenti di test attenti al canone per la verifica del modello.
94
123
 
95
- # 3. Start ComfyUI and generate candidates
96
- npm run generate -- --game star-freight inputs/prompts/wave1.json
97
- npm run generate -- --game star-freight inputs/prompts/wave1.json --dry-run
124
+ La conversione in formati specifici (TRL, LLaVA, Parquet, ecc.) è gestita da [`repo-dataset`](https://github.com/mcp-tool-shop-org/repo-dataset). `sdlab` definisce la "verità" del set di dati; `repo-dataset` la trasforma in formati specializzati.
98
125
 
99
- # 4. Generate identity-packet characters (named subjects)
100
- npm run generate:identity -- --game star-freight inputs/identity-packets/wave27a.json
126
+ ## Modelli per dominio
101
127
 
102
- # 5. Curate -- approve, reject, or mark borderline
103
- npm run curate -- --game star-freight <asset_id> approved "explanation"
104
- npm run curate -- --game star-freight <asset_id> rejected "explanation" --failures "too_clean"
128
+ Ogni modello per dominio include definizioni di aree, regole del canone, griglie di valutazione e strutture terminologiche progettate per quel contesto di produzione:
105
129
 
106
- # 6. Generate painterly variants of approved assets
107
- npm run painterly -- --game star-freight
130
+ | Dominio | Aree | Aspetti chiave |
131
+ |--------|-------|-------------|
132
+ | **game-art** | personaggio, ambiente, oggetto, interfaccia utente, nave, interno, equipaggiamento | Silhouette in scala di gioco, differenziazione delle fazioni, usura/invecchiamento |
133
+ | **character-design** | ritratto, figura intera, vista a 360°, foglio di espressioni, posa d'azione | accuratezza delle proporzioni, logica dell'abbigliamento, interpretazione della personalità, chiarezza dei gesti |
134
+ | **creature-design** | concept, proiezione ortogonale, studio dei dettagli, azione, riferimento di scala, habitat | plausibilità anatomica, logica evolutiva, distinzione della silhouette |
135
+ | **architecture** | esterno, interno, paesaggio urbano, dettaglio strutturale, rovina, paesaggio | plausibilità strutturale, coerenza dei materiali, prospettiva, coerenza dell'epoca |
136
+ | **vehicle-mech** | esterno, cabina di pilotaggio, componente, schema, foglio di silhouette, variante danneggiata | Logica meccanica, linguaggio di progettazione funzionale, punti di accesso, descrizione dei danni. |
108
137
 
109
- # 7. Bind canon explanations to curated assets
110
- npm run canon-bind -- --game star-freight
138
+ ## Produzione del dataset
111
139
 
112
- # 8. Record pairwise comparisons
113
- npm run compare -- --game star-freight <asset_a> <asset_b> a "A has better faction read"
140
+ La struttura completa del dataset: istantanea, suddivisione, esportazione, valutazione.
114
141
 
115
- # 9. Export training data via repo-dataset
116
- repo-dataset visual generate ./games/star-freight --format trl
117
- repo-dataset visual inspect ./games/star-freight
142
+ ```
143
+ snapshot --> split --> export --> eval-pack
144
+ | | | |
145
+ frozen subject package canon-aware
146
+ selection isolation (manifest, test instruments
147
+ + lane metadata, (4 task types)
148
+ balance images,
149
+ checksums,
150
+ card)
118
151
  ```
119
152
 
120
- ## Aggiunta di un nuovo gioco
153
+ Le **istantanee** congelano una selezione deterministica di record idonei. Ogni inclusione ha una traccia della motivazione. Le "impronte" di configurazione garantiscono la riproducibilità.
154
+
155
+ Le **suddivisioni** assegnano i record alle partizioni di training/validazione/test, con isolamento dei soggetti (nessuna famiglia di soggetti compare in più suddivisioni) e distribuzione bilanciata per "corsia". Un generatore di numeri pseudo-casuali (PRNG) con seme garantisce risultati identici a partire dallo stesso seme.
156
+
157
+ I **pacchetti di esportazione** sono autonomi: manifest, metadata.jsonl, immagini (collegate simbolicamente o copiate), suddivisioni, scheda del dataset (markdown + JSON) e checksum in formato BSD. Tutto il necessario per ricostruire il dataset da zero.
158
+
159
+ I **pacchetti di valutazione** sono strumenti di test standardizzati, con quattro tipi di attività: copertura delle "corsie", deriva proibita, ancoraggi/riferimenti e continuità dei soggetti. Dimostrano che la struttura del dataset alimenta la valutazione futura dei modelli, e non solo l'accumulo di file.
160
+
161
+ Esportazione in formati compatibili con sistemi esterni tramite [`repo-dataset`](https://github.com/mcp-tool-shop-org/repo-dataset) (TRL, LLaVA, Qwen2-VL, JSONL, Parquet, e altri). `repo-dataset` gestisce la conversione dei formati; `sdlab` garantisce l'integrità del dataset.
162
+
163
+ ## Esempio di Star Freight
164
+
165
+ Clonare il repository per un esempio funzionante completo: 1.182 record, 28 "onde" di prompt, 5 fazioni, 7 "corsie", 24 regole costituzionali e 892 risorse approvate provenienti da un RPG fantascientifico.
121
166
 
122
167
  ```bash
123
- # Create structure and copy blank templates
124
- mkdir -p games/my-game/{records,comparisons,inputs/prompts,outputs/{candidates,approved,rejected,borderline,painterly},exports}
125
- cp -r templates/canon games/my-game/canon
126
- cp templates/inputs/prompts/example-wave.json games/my-game/inputs/prompts/wave1.json
168
+ git clone https://github.com/mcp-tool-shop-org/style-dataset-lab
169
+ cd style-dataset-lab
170
+
171
+ # Validate the project
172
+ sdlab project doctor --project star-freight
127
173
 
128
- # Edit your canon/constitution.md and canon/review-rubric.md
129
- # Edit your prompt pack, then run the pipeline with --game my-game
174
+ # Run the full dataset spine
175
+ sdlab snapshot create --project star-freight # 839 eligible records
176
+ sdlab split build --project star-freight # ~80/10/10, zero leakage
177
+ sdlab export build --project star-freight # package with checksums
178
+ sdlab eval-pack build --project star-freight # 78 eval records
130
179
  ```
131
180
 
132
- ## Struttura della directory per ogni gioco
181
+ ## Migrazione dalla versione 1.x
133
182
 
134
- Ogni directory `games/<nome>/` contiene:
183
+ La versione 2.0 rinomina `games/` in `projects/` e `--game` in `--project`:
135
184
 
136
- ```
137
- canon/ Style constitution, review rubric, species canon, identity gates
138
- inputs/
139
- prompts/ Prompt packs per wave (JSON: subjects, variations, defaults)
140
- references/ IP-Adapter reference images
141
- control-guides/ ControlNet guide overlays
142
- identity-packets/ Named character identity spines
143
- outputs/
144
- candidates/ Raw generations (gitignored)
145
- approved/ Curated approved (gitignored)
146
- rejected/ Curated rejected (gitignored)
147
- borderline/ Curated borderline (gitignored)
148
- painterly/ Painterly-style variants (gitignored)
149
- records/ Per-asset JSON (provenance + judgment + canon binding)
150
- comparisons/ A-vs-B preference judgments
151
- exports/ repo-dataset output (gitignored)
152
- ```
185
+ ```bash
186
+ # Rename your data directory
187
+ mv games projects
153
188
 
154
- ## Configurazione della generazione
155
-
156
- ```yaml
157
- checkpoint: dreamshaperXL_v21TurboDPMSDE.safetensors
158
- lora: classipeintxl_v21.safetensors (weight: 1.0)
159
- resolution: 1024x1024
160
- steps: 8
161
- cfg: 2.0
162
- sampler: dpmpp_sde
163
- scheduler: karras
164
- speed: ~9s per image (RTX 5080)
189
+ # --game still works with a deprecation warning (removed in v3.0)
190
+ sdlab bind --game star-freight # works, prints warning
191
+ sdlab bind --project star-freight # canonical form
165
192
  ```
166
193
 
167
- Modalità di generazione aggiuntive: ControlNet (guidata da pose/profondità), IP-Adapter (basata su riferimento) e pacchetti di identità (coerenza dei personaggi).
194
+ ## Modello di sicurezza
195
+
196
+ **Solo locale.** Comunica con ComfyUI su `localhost:8188`. Nessuna telemetria, nessuna analisi, nessuna richiesta esterna. Le immagini rimangono sulla tua GPU e nel tuo filesystem.
168
197
 
169
198
  ## Requisiti
170
199
 
package/README.ja.md CHANGED
@@ -13,158 +13,187 @@
13
13
 
14
14
  # style-dataset-lab
15
15
 
16
- 視覚データセット作成のためのプロダクションパイプライン:基本ルールから構造化されたプロンプト、ComfyUIによる生成、そして厳選された、基本ルールに準拠したトレーニングデータまで。
16
+ 承認済みの画像データを、バージョン管理された、レビューに基づいたデータセット、分割データ、エクスポートパッケージ、および評価用パッケージに変換します。
17
17
 
18
18
  ## これは何ですか?
19
19
 
20
- 構造化された視覚トレーニングデータセットを構築するための**パイプライン**です。スタイルルール(基本ルール)を記述し、プロンプトを作成し、ComfyUIで生成し、各次元のスコアリングによる厳選を行い、判断を基本ルールに紐付け、`@mcptoolshop/repo-dataset` (https://github.com/mcp-tool-shop-org/repo-dataset) を使用して10種類の形式でエクスポートします。
20
+ **画像データ管理とデータセット生成のパイプライン**。プロジェクトのイメージを定義します。規定に基づいてデータを選別します。データ漏洩を防ぐための分割データセットを作成します。将来のモデル検証のための評価用パッケージを生成します。
21
21
 
22
- このパイプラインは、特定のゲームに依存しません。各ゲームごとに、`games/<ゲーム名>/` の下にデータディレクトリが作成され、13個のスクリプトとテンプレートが共有されます。生成されるすべてのデータには、以下の3つの情報が含まれます。
22
+ このパイプラインは、以下の4つの成果物(アーティファクト)を生成します。
23
23
 
24
- 1. **画像ピクセル**:ComfyUIによって生成され、完全な情報(チェックポイント、LoRA、シード値、サンプラー、CFG)が付与されています。
25
- 2. **規範的な説明**:なぜこの画像が特定のスタイルに合致しているか、または合致していないかを、スタイルに関する規定に基づいて説明します。
26
- 3. **品質評価**:各次元のスコアと参照ルールに基づいて、承認/却下の判断がなされます。
24
+ | 成果物 | 内容 |
25
+ |----------|-----------|
26
+ | **Snapshot** | 選択されたデータレコードの、不変で、フィンガープリントが付与されたもの。各データレコードの採用には、明確な理由が記録されています。 |
27
+ | **Split** | データ漏洩を防ぐための、トレーニングデータ/検証データ/テストデータの分割。同じ対象を含むデータレコードは、常に同じ分割に分類されます。 |
28
+ | **Export package** | 自己完結型のデータセット:マニフェスト、メタデータ、画像、分割データ、データセットの説明、およびチェックサム。 |
29
+ | **Eval pack** | 規定に準拠した検証タスク:表現の網羅性、許容されない変化、基準/正解データ、対象の一貫性。 |
27
30
 
28
- ## セキュリティモデル
29
-
30
- **ローカル環境のみ**。style-dataset-labは、`localhost:8188`で動作するComfyUIとのみ通信し、外部ネットワークへのアクセスは一切行いません。テレメトリー、分析、データ送信機能は一切ありません。画像生成はすべて、お客様のGPU上で行われます。記録データと規範データは、お客様のファイルシステム上に保存されます。
31
-
32
- ## このnpmパッケージに含まれるもの
33
-
34
- `npm install @mcptoolshop/style-dataset-lab` を実行すると、以下のものが利用できます。
31
+ このパイプライン内のすべてのデータには、以下の3つの情報が含まれています。
35
32
 
36
- - **13個のスクリプト**:生成、厳選、比較、基本ルールへの紐付け、絵画風生成、同一性生成、ControlNet/IP-Adapter生成、一括厳選、移行
37
- - **テンプレート**:`templates/` に、初期設定ファイル、レビュー基準、およびサンプルプロンプトが含まれています。
33
+ 1. **生成履歴 (Provenance)**:完全な生成履歴(チェックポイント、LoRA、シード値、サンプラー、CFG値、実行時間)
34
+ 2. **規定への適合性 (Canon binding)**:このデータが、どの規定に適合し、不適合であり、または部分的に適合しているか
35
+ 3. **品質評価 (Quality judgment)**:承認/拒否/境界値、および各評価項目のスコア
38
36
 
39
- このnpmパッケージには、ゲームデータは含まれていません。Star Freightのサンプルデータが必要な場合は、リポジトリをクローンしてください(1,182件のデータ、28種類のプロンプト、18種類の視覚カテゴリ)。
37
+ ゲームアート、キャラクターデザイン、クリーチャーデザイン、アーキテクチャ、車両/メカのコンセプト、および、画像データの品質を維持する必要があるあらゆる分野で利用できます。
40
38
 
41
- ## インストール
39
+ ## クイックスタート
42
40
 
43
41
  ```bash
44
- # Get the pipeline scripts + templates
45
- npm install @mcptoolshop/style-dataset-lab
42
+ # Install the CLI + pipeline
43
+ npm install -g @mcptoolshop/style-dataset-lab
46
44
 
47
- # Or clone the repo for the Star Freight example data
48
- git clone https://github.com/mcp-tool-shop-org/style-dataset-lab
49
- cd style-dataset-lab
50
- npm install
45
+ # Scaffold a new project
46
+ sdlab init my-project --domain character-design
47
+
48
+ # Validate the project structure
49
+ sdlab project doctor --project my-project
51
50
  ```
52
51
 
53
- 新しいゲームをテンプレートから開始するには:
52
+ 利用可能なドメイン:`game-art`、`character-design`、`creature-design`、`architecture`、`vehicle-mech`、または`generic`。
53
+
54
+ ## コマンドラインインターフェース (CLI)
54
55
 
55
56
  ```bash
56
- # Copy templates into your game directory
57
- mkdir -p games/my-game/{records,comparisons,inputs/prompts,outputs/{candidates,approved,rejected,borderline,painterly},exports}
58
- cp -r templates/canon games/my-game/canon
59
- cp templates/inputs/prompts/example-wave.json games/my-game/inputs/prompts/wave1.json
60
- # Edit the canon and prompts, then generate
57
+ sdlab init <name> [--domain <domain>] # Scaffold a new project
58
+ sdlab project doctor [--project <name>] # Validate project config
59
+
60
+ sdlab generate <pack> [--project <name>] # Generate candidates via ComfyUI
61
+ sdlab generate:identity <packet> # Named-subject identity images
62
+ sdlab generate:controlnet # ControlNet-guided generation
63
+ sdlab generate:ipadapter # IP-Adapter reference-guided
64
+
65
+ sdlab curate <id> <status> <explanation> # Record review judgment
66
+ sdlab compare <a> <b> <winner> <reason> # Pairwise A-vs-B comparison
67
+ sdlab bind [--project <name>] # Bind records to constitution rules
68
+ sdlab painterly [--project <name>] # Post-processing style pass
69
+
70
+ sdlab snapshot create [--profile <name>] # Create frozen dataset snapshot
71
+ sdlab snapshot list # List all snapshots
72
+ sdlab snapshot diff <a> <b> # Compare two snapshots
73
+ sdlab eligibility audit # Audit record training eligibility
74
+ sdlab split build [--snapshot <id>] # Build train/val/test split
75
+ sdlab split audit <id> # Audit split for leakage + balance
76
+ sdlab card generate # Generate dataset card (md + JSON)
77
+ sdlab export build [--snapshot <id>] # Build versioned export package
78
+ sdlab eval-pack build # Build canon-aware eval pack
61
79
  ```
62
80
 
63
- ## モノレポの構造
81
+ すべてのコマンドは、`--project <名前>`(デフォルト:`star-freight`)を受け入れます。
82
+
83
+ ## プロジェクトモデル
64
84
 
65
- このパイプラインは、`scripts/` と `templates/` にあります。各ゲームは、`games/<ゲーム名>/` に、それぞれの基本ルール、データ、およびアセットとともに配置されます。スクリプトは `--game <ゲーム名>` オプションを受け入れます(デフォルトは `star-freight`)。
85
+ 各プロジェクトは、`projects/`ディレクトリ内の自己完結型のディレクトリであり、独自の規定、設定、およびデータが含まれています。
66
86
 
67
87
  ```
68
- style-dataset-lab/
69
- scripts/ 13 pipeline scripts (generate, curate, compare, etc.)
70
- templates/ Blank starting point for new games
71
- canon/ Starter constitution + review rubric
72
- inputs/prompts/ Example prompt pack
73
- games/
74
- star-freight/ Star Freight example (1,182 records, repo-only)
75
- canon/ Style constitution, review rubric, species canon
76
- records/ Per-asset JSON (provenance + judgment + canon)
77
- comparisons/ A-vs-B preference judgments
78
- inputs/ Prompt packs, identity packets, references
79
- outputs/ Generated images (gitignored)
80
- exports/ repo-dataset output (gitignored)
81
- <your-game>/ Add more games with the same structure
88
+ projects/
89
+ my-project/
90
+ project.json Project identity + generation defaults
91
+ constitution.json Rules array with rationale templates
92
+ lanes.json Subject lanes with detection patterns
93
+ rubric.json Scoring dimensions + thresholds
94
+ terminology.json Group vocabulary + detection order
95
+ canon/ Style constitution (markdown)
96
+ records/ Per-asset JSON (provenance + judgment + canon)
97
+ inputs/prompts/ Prompt packs (JSON)
98
+ outputs/ Generated images (gitignored)
99
+ comparisons/ A-vs-B preference judgments
100
+ snapshots/ Frozen dataset snapshots
101
+ splits/ Train/val/test partitions
102
+ exports/ Versioned export packages
103
+ eval-packs/ Canon-aware eval instruments
82
104
  ```
83
105
 
84
- ## パイプラインのワークフロー
106
+ ## パイプライン
85
107
 
86
- 基本ルールからトレーニングデータのエクスポートまでの完全なパイプライン:
87
-
88
- ```bash
89
- # 1. Write your canon -- style constitution + review rubric
90
- # (start from templates/ or write from scratch)
108
+ ```
109
+ canon → generate → curate → bind → snapshot → split → export → eval
110
+ | | | | | | | |
111
+ rules ComfyUI judgment rules frozen subject package verify
112
+ selection isolation
113
+ ```
91
114
 
92
- # 2. Create prompt packs in inputs/prompts/
93
- # (see templates/inputs/prompts/example-wave.json)
115
+ 1. **規定の定義 (Define canon)**:スタイル規定とレビュー基準を記述します。
116
+ 2. **生成 (Generate)**:ComfyUIが、完全な生成履歴を持つ候補データを生成します。
117
+ 3. **選別 (Curate)**:各評価項目のスコアと、失敗モードに基づいて、承認または拒否を行います。
118
+ 4. **関連付け (Bind)**:各データと、規定への適合性(適合/不適合/部分適合)を関連付けます。
119
+ 5. **スナップショット (Snapshot)**:選択されたデータレコードを、不変で、フィンガープリントが付与された状態で凍結します。
120
+ 6. **分割 (Split)**:対象の分離と、表現のバランスを考慮して、トレーニングデータ/検証データ/テストデータに分割します。
121
+ 7. **エクスポート (Export)**:マニフェスト、メタデータ、画像、およびチェックサムを含む、自己完結型のパッケージを構築します。
122
+ 8. **評価 (Eval)**:モデル検証のための、規定に準拠したテストツールを生成します。
94
123
 
95
- # 3. Start ComfyUI and generate candidates
96
- npm run generate -- --game star-freight inputs/prompts/wave1.json
97
- npm run generate -- --game star-freight inputs/prompts/wave1.json --dry-run
124
+ 下流のフォーマット変換(TRL、LLaVA、Parquetなど)は、[`repo-dataset`](https://github.com/mcp-tool-shop-org/repo-dataset)によって処理されます。`sdlab`がデータセットの真実性を管理し、`repo-dataset`がそれを特殊なフォーマットに変換します。
98
125
 
99
- # 4. Generate identity-packet characters (named subjects)
100
- npm run generate:identity -- --game star-freight inputs/identity-packets/wave27a.json
126
+ ## ドメインテンプレート
101
127
 
102
- # 5. Curate -- approve, reject, or mark borderline
103
- npm run curate -- --game star-freight <asset_id> approved "explanation"
104
- npm run curate -- --game star-freight <asset_id> rejected "explanation" --failures "too_clean"
128
+ 各ドメインテンプレートには、表現の定義、規定、評価基準、および、その制作コンテキストに合わせた用語構造が含まれています。
105
129
 
106
- # 6. Generate painterly variants of approved assets
107
- npm run painterly -- --game star-freight
130
+ | ドメイン | 表現 | 主要な考慮事項 |
131
+ |--------|-------|-------------|
132
+ | **game-art** | キャラクター、環境、小道具、UI、船、内装、装備 | ゲームプレイ時のシルエット、派閥の区別、摩耗/経年劣化 |
133
+ | **character-design** | ポートレート、全身像、アングル図、表情シート、アクションポーズ | プロポーションの正確性、衣装の論理性、キャラクターの表現、ジェスチャーの明瞭さ |
134
+ | **creature-design** | コンセプト、正投影図、詳細図、アクション、スケール参照、生息地 | 解剖学的な妥当性、進化論的な論理性、シルエットの区別 |
135
+ | **architecture** | 外観、内装、街並み、構造の詳細、廃墟、風景 | 構造的な妥当性、素材の一貫性、遠近感、時代への適合性 |
136
+ | **vehicle-mech** | 外観、コックピット、コンポーネント、設計図、シルエット図、損傷バリエーション | 機械的なロジック、機能的なデザイン言語、アクセスポイント、損害状況の説明 |
108
137
 
109
- # 7. Bind canon explanations to curated assets
110
- npm run canon-bind -- --game star-freight
138
+ ## データセットの生成
111
139
 
112
- # 8. Record pairwise comparisons
113
- npm run compare -- --game star-freight <asset_a> <asset_b> a "A has better faction read"
140
+ データセット全体の構成:スナップショット、分割、エクスポート、評価。
114
141
 
115
- # 9. Export training data via repo-dataset
116
- repo-dataset visual generate ./games/star-freight --format trl
117
- repo-dataset visual inspect ./games/star-freight
142
+ ```
143
+ snapshot --> split --> export --> eval-pack
144
+ | | | |
145
+ frozen subject package canon-aware
146
+ selection isolation (manifest, test instruments
147
+ + lane metadata, (4 task types)
148
+ balance images,
149
+ checksums,
150
+ card)
118
151
  ```
119
152
 
120
- ## 新しいゲームの追加
153
+ **スナップショット**は、選択されたレコードを決定的に固定します。すべてのデータは、その理由が追跡可能です。設定のフィンガープリントにより、再現性が確保されます。
154
+
155
+ **分割**は、レコードをトレーニング用、検証用、テスト用のデータセットに割り当てます。この際、被験者の同一性が保たれ(同じ被験者のデータが複数の分割に属さない)、各分割におけるデータのバランスが調整されます。シード値が設定された疑似乱数生成器を使用することで、同じシード値を使用した場合、常に同じ結果が得られます。
156
+
157
+ **エクスポートパッケージ**は、すべてが完結したパッケージです。内容:マニフェスト、metadata.jsonl、画像(シンボリックリンクまたはコピー)、分割データ、データセットの説明(Markdown形式とJSON形式)、およびBSD形式のチェックサム。データセットを最初から再構築するために必要なものがすべて含まれています。
158
+
159
+ **評価パッケージ**は、基準に準拠したテストツールであり、4つのタスクタイプ(レーンカバレッジ、禁止ドリフト、アンカー/ゴールド、被験者の一貫性)が含まれています。これにより、データセットの構成が、単にファイルをダンプするだけでなく、将来のモデル評価に役立つことを証明します。
160
+
161
+ `repo-dataset` ([https://github.com/mcp-tool-shop-org/repo-dataset](https://github.com/mcp-tool-shop-org/repo-dataset)) を使用して、下流の形式にエクスポートします(TRL、LLaVA、Qwen2-VL、JSONL、Parquetなど)。`repo-dataset` が形式の変換を処理し、`sdlab` がデータセットの正確性を保証します。
162
+
163
+ ## Star Freightの例
164
+
165
+ 完全な動作例については、リポジトリをクローンしてください。1,182件のレコード、28種類のプロンプト、5つの派閥、7つのレーン、24の憲法ルール、および、ハードなSF RPGから抽出された892件の承認済みアセットが含まれています。
121
166
 
122
167
  ```bash
123
- # Create structure and copy blank templates
124
- mkdir -p games/my-game/{records,comparisons,inputs/prompts,outputs/{candidates,approved,rejected,borderline,painterly},exports}
125
- cp -r templates/canon games/my-game/canon
126
- cp templates/inputs/prompts/example-wave.json games/my-game/inputs/prompts/wave1.json
168
+ git clone https://github.com/mcp-tool-shop-org/style-dataset-lab
169
+ cd style-dataset-lab
170
+
171
+ # Validate the project
172
+ sdlab project doctor --project star-freight
127
173
 
128
- # Edit your canon/constitution.md and canon/review-rubric.md
129
- # Edit your prompt pack, then run the pipeline with --game my-game
174
+ # Run the full dataset spine
175
+ sdlab snapshot create --project star-freight # 839 eligible records
176
+ sdlab split build --project star-freight # ~80/10/10, zero leakage
177
+ sdlab export build --project star-freight # package with checksums
178
+ sdlab eval-pack build --project star-freight # 78 eval records
130
179
  ```
131
180
 
132
- ## ゲームごとのディレクトリ構成
181
+ ## v1.xからの移行
133
182
 
134
- 各 `games/<ゲーム名>/` ディレクトリには、以下のものが含まれます:
183
+ v2.0では、`games/`が`projects/`に、`--game`が`--project`に変更されました。
135
184
 
136
- ```
137
- canon/ Style constitution, review rubric, species canon, identity gates
138
- inputs/
139
- prompts/ Prompt packs per wave (JSON: subjects, variations, defaults)
140
- references/ IP-Adapter reference images
141
- control-guides/ ControlNet guide overlays
142
- identity-packets/ Named character identity spines
143
- outputs/
144
- candidates/ Raw generations (gitignored)
145
- approved/ Curated approved (gitignored)
146
- rejected/ Curated rejected (gitignored)
147
- borderline/ Curated borderline (gitignored)
148
- painterly/ Painterly-style variants (gitignored)
149
- records/ Per-asset JSON (provenance + judgment + canon binding)
150
- comparisons/ A-vs-B preference judgments
151
- exports/ repo-dataset output (gitignored)
152
- ```
185
+ ```bash
186
+ # Rename your data directory
187
+ mv games projects
153
188
 
154
- ## 生成設定
155
-
156
- ```yaml
157
- checkpoint: dreamshaperXL_v21TurboDPMSDE.safetensors
158
- lora: classipeintxl_v21.safetensors (weight: 1.0)
159
- resolution: 1024x1024
160
- steps: 8
161
- cfg: 2.0
162
- sampler: dpmpp_sde
163
- scheduler: karras
164
- speed: ~9s per image (RTX 5080)
189
+ # --game still works with a deprecation warning (removed in v3.0)
190
+ sdlab bind --game star-freight # works, prints warning
191
+ sdlab bind --project star-freight # canonical form
165
192
  ```
166
193
 
167
- 追加の生成モード:ControlNet(ポーズ/深度ガイド)、IP-Adapter(参照ベース)、IDパケット(名前付きキャラクターの一貫性)。
194
+ ## セキュリティモデル
195
+
196
+ **ローカル環境のみ。** `localhost:8188`で動作するComfyUIと通信します。テレメトリー、分析、外部へのリクエストは一切ありません。画像は、あなたのGPUとファイルシステムにのみ保存されます。
168
197
 
169
198
  ## 必要なもの
170
199