@mcptoolshop/style-dataset-lab 1.2.0 → 2.0.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.es.md +94 -54
  3. package/README.fr.md +86 -46
  4. package/README.hi.md +86 -46
  5. package/README.it.md +93 -53
  6. package/README.ja.md +86 -46
  7. package/README.md +95 -116
  8. package/README.pt-BR.md +86 -46
  9. package/README.zh.md +90 -50
  10. package/bin/sdlab.js +103 -0
  11. package/lib/args.js +106 -0
  12. package/lib/comfyui.js +109 -0
  13. package/lib/config.js +104 -0
  14. package/lib/deprecation.js +14 -0
  15. package/lib/paths.js +38 -0
  16. package/lib/records.js +69 -0
  17. package/package.json +13 -4
  18. package/scripts/bulk-curate-wave2-5.js +1 -1
  19. package/scripts/bulk-curate-waves11-18.js +1 -1
  20. package/scripts/canon-bind.js +268 -332
  21. package/scripts/compare.js +40 -30
  22. package/scripts/curate-wave25.js +1 -1
  23. package/scripts/curate.js +34 -28
  24. package/scripts/doctor.js +321 -0
  25. package/scripts/generate-controlnet.js +36 -121
  26. package/scripts/generate-identity.js +38 -106
  27. package/scripts/generate-ipadapter.js +42 -119
  28. package/scripts/generate.js +22 -81
  29. package/scripts/init.js +226 -0
  30. package/scripts/migrate-records.js +15 -21
  31. package/scripts/painterly-test.js +20 -47
  32. package/scripts/painterly.js +27 -106
  33. package/templates/domains/architecture/constitution.json +97 -0
  34. package/templates/domains/architecture/lanes.json +41 -0
  35. package/templates/domains/architecture/project.json +20 -0
  36. package/templates/domains/architecture/rubric.json +40 -0
  37. package/templates/domains/architecture/terminology.json +19 -0
  38. package/templates/domains/character-design/constitution.json +88 -0
  39. package/templates/domains/character-design/lanes.json +35 -0
  40. package/templates/domains/character-design/project.json +17 -0
  41. package/templates/domains/character-design/rubric.json +38 -0
  42. package/templates/domains/character-design/terminology.json +21 -0
  43. package/templates/domains/creature-design/constitution.json +87 -0
  44. package/templates/domains/creature-design/lanes.json +41 -0
  45. package/templates/domains/creature-design/project.json +18 -0
  46. package/templates/domains/creature-design/rubric.json +39 -0
  47. package/templates/domains/creature-design/terminology.json +20 -0
  48. package/templates/domains/game-art/constitution.json +113 -0
  49. package/templates/domains/game-art/lanes.json +47 -0
  50. package/templates/domains/game-art/project.json +17 -0
  51. package/templates/domains/game-art/rubric.json +36 -0
  52. package/templates/domains/game-art/terminology.json +30 -0
  53. package/templates/domains/vehicle-mech/constitution.json +87 -0
  54. package/templates/domains/vehicle-mech/lanes.json +41 -0
  55. package/templates/domains/vehicle-mech/project.json +17 -0
  56. package/templates/domains/vehicle-mech/rubric.json +40 -0
  57. package/templates/domains/vehicle-mech/terminology.json +21 -0
package/lib/records.js ADDED
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Record builder and I/O utilities.
3
+ *
4
+ * Standardizes the JSON record format used across all scripts.
5
+ */
6
+
7
+ import { readFile, writeFile } from 'node:fs/promises';
8
+ import { join } from 'node:path';
9
+
10
+ /**
11
+ * Build a base provenance record (generated by txt2img scripts).
12
+ */
13
+ export function buildBaseRecord(id, assetPath, imageData, provenance) {
14
+ return {
15
+ id,
16
+ schema_version: '2.0.0',
17
+ created_at: new Date().toISOString(),
18
+ asset_path: assetPath,
19
+ image: {
20
+ format: 'png',
21
+ width: imageData.width || 1024,
22
+ height: imageData.height || 1024,
23
+ bytes: imageData.bytes || 0,
24
+ },
25
+ provenance,
26
+ judgment: null,
27
+ canon: null,
28
+ iteration: null,
29
+ };
30
+ }
31
+
32
+ /**
33
+ * Build an identity record (extends base with identity + lineage blocks).
34
+ */
35
+ export function buildIdentityRecord(baseRecord, identity, lineage) {
36
+ return {
37
+ ...baseRecord,
38
+ identity,
39
+ lineage,
40
+ };
41
+ }
42
+
43
+ /**
44
+ * Load a record by asset ID from a records directory.
45
+ * @param {string} recordsDir — absolute path to records/
46
+ * @param {string} assetId — record filename (without .json)
47
+ * @returns {Promise<Object|null>}
48
+ */
49
+ export async function loadRecord(recordsDir, assetId) {
50
+ const path = join(recordsDir, `${assetId}.json`);
51
+ try {
52
+ const raw = await readFile(path, 'utf-8');
53
+ return JSON.parse(raw);
54
+ } catch (err) {
55
+ if (err.code === 'ENOENT') return null;
56
+ throw new Error(`Failed to load record ${assetId}: ${err.message}`);
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Save a record to disk.
62
+ * @param {string} recordsDir — absolute path to records/
63
+ * @param {string} assetId — record filename (without .json)
64
+ * @param {Object} record — the record object
65
+ */
66
+ export async function saveRecord(recordsDir, assetId, record) {
67
+ const path = join(recordsDir, `${assetId}.json`);
68
+ await writeFile(path, JSON.stringify(record, null, 2) + '\n');
69
+ }
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@mcptoolshop/style-dataset-lab",
3
- "version": "1.2.0",
4
- "description": "Visual dataset pipeline — canon to prompts to ComfyUI generation to curated, canon-bound training data",
3
+ "version": "2.0.0",
4
+ "description": "Canon-bound visual dataset pipeline — define project canon, generate and curate assets, bind to constitution rules, export trustworthy training data",
5
5
  "type": "module",
6
+ "bin": {
7
+ "sdlab": "./bin/sdlab.js"
8
+ },
6
9
  "scripts": {
7
10
  "generate": "node scripts/generate.js",
8
11
  "curate": "node scripts/curate.js",
@@ -10,10 +13,12 @@
10
13
  "canon-bind": "node scripts/canon-bind.js",
11
14
  "painterly": "node scripts/painterly.js",
12
15
  "generate:identity": "node scripts/generate-identity.js",
13
- "export": "echo 'Usage: repo-dataset visual generate ./games/<game> --format trl'",
14
- "inspect": "echo 'Usage: repo-dataset visual inspect ./games/<game>'"
16
+ "export": "echo 'Usage: repo-dataset visual generate ./projects/<project> --format trl'",
17
+ "inspect": "echo 'Usage: repo-dataset visual inspect ./projects/<project>'"
15
18
  },
16
19
  "files": [
20
+ "bin/",
21
+ "lib/",
17
22
  "scripts/",
18
23
  "templates/",
19
24
  "README.md",
@@ -25,6 +30,10 @@
25
30
  "dataset",
26
31
  "visual",
27
32
  "training-data",
33
+ "concept-art",
34
+ "visual-canon",
35
+ "art-direction",
36
+ "dataset-pipeline",
28
37
  "comfyui",
29
38
  "vlm",
30
39
  "fine-tuning",
@@ -11,7 +11,7 @@ import { join } from "node:path";
11
11
 
12
12
  const REPO_ROOT = new URL("..", import.meta.url).pathname.replace(/^\/([A-Z]:)/, "$1");
13
13
  const GAME = process.argv.find((a, i) => process.argv[i - 1] === '--game') || 'star-freight';
14
- const GAME_ROOT = join(REPO_ROOT, 'games', GAME);
14
+ const GAME_ROOT = join(REPO_ROOT, 'projects', GAME);
15
15
 
16
16
  const DEFAULT_APPROVED_SCORES = {
17
17
  silhouette_clarity: 0.8, palette_adherence: 0.8, material_fidelity: 0.8,
@@ -17,7 +17,7 @@ import { join, basename } from 'path';
17
17
 
18
18
  const REPO_ROOT = new URL("..", import.meta.url).pathname.replace(/^\/([A-Z]:)/, "$1");
19
19
  const GAME = process.argv.find((a, i) => process.argv[i - 1] === '--game') || 'star-freight';
20
- const GAME_ROOT = join(REPO_ROOT, 'games', GAME);
20
+ const GAME_ROOT = join(REPO_ROOT, 'projects', GAME);
21
21
 
22
22
  const RECORDS_DIR = join(GAME_ROOT, 'records');
23
23
  const CANDIDATES_DIR = join(GAME_ROOT, 'outputs', 'candidates');