@melite/models-mask 0.1.5-pre-alpha → 0.2.2-alpha

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.md CHANGED
@@ -1,8 +1,3 @@
1
- ---
2
- description: The mask studio's selection lane as a model family — SAM3/RT-DETR detection, the SAM2 arm, and paint exports, bound by the mask card.
3
- kind: package-library
4
- ---
5
-
6
1
  # mask
7
2
 
8
3
  mask registers the model family `mask-select` (label "Mask", genre `image`): the mask studio's selection lane declared as one action — SAM3 CLIP/RT-DETR detection, the SAM2 impact-pack arm, and paint exports — which the mask card binds through the DECL's declared-action interlock. The id is `mask-select`, deliberately not the package name: a family id must not shadow its card.
package/lib/actions.js CHANGED
@@ -72,6 +72,15 @@ export const select = {
72
72
  const detectionDilation = p.detection_dilation ?? 10;
73
73
  const cropFactor = p.crop_factor ?? 3.0;
74
74
  const dropSize = p.drop_size ?? 10;
75
+ // THE DETECTOR THRESHOLD FOLD (audit 015 C5 — one fold for every
76
+ // detector seat): the effective detector threshold derives ONCE —
77
+ // per-entry tune → lane-flat param → the pack's 0.5 default. The
78
+ // SAM2 impact detectors AND the RT-DETR proposal seat read THIS
79
+ // derivation (the seats reference it, never re-stamp the fold):
80
+ // a second spelling let one graph carry two effective thresholds
81
+ // — SAM2 folded 0.5 while an unstated RT-DETR seat rode the raw
82
+ // cast to undefined (tests/threshold-fold-parity.spec.ts).
83
+ const detectorThreshold = (tune) => tune?.detection_threshold ?? p.detection_threshold ?? 0.5;
75
84
  const exportBoxes = p.export_boxes;
76
85
  const viaRtdetr = p.primary_via_rtdetr;
77
86
  // the lazy loader trio (see the header note — created on first use)
@@ -197,7 +206,7 @@ export const select = {
197
206
  const segs = g.node(detector.detectorNode, {
198
207
  [detector.detectorInput]: provider,
199
208
  image: img(),
200
- threshold: (tune?.detection_threshold ?? p.detection_threshold ?? 0.5),
209
+ threshold: detectorThreshold(tune),
201
210
  dilation: tune?.detection_dilation ?? detectionDilation,
202
211
  crop_factor: tune?.crop_factor ?? cropFactor,
203
212
  drop_size: tune?.drop_size ?? dropSize,
@@ -249,7 +258,7 @@ export const select = {
249
258
  rtdetrBoxes = g.node('RTDETR_detect', {
250
259
  model: rtdetrLoader(),
251
260
  image: img(),
252
- threshold: p.detection_threshold,
261
+ threshold: detectorThreshold(), // the SAME fold as the SAM2 detectors (audit 015 C5)
253
262
  class_name: 'person',
254
263
  max_detections: cap,
255
264
  }).out(0);
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IMPACT_DETECTOR_PROVISIONS } from "@melite/comfyui-card-kit";
2
- import { select } from "./actions.js";
2
+ import { select, MASK_WEIGHTS } from "./actions.js";
3
3
 
4
4
 
5
5
 
@@ -56,8 +56,9 @@ export const DETECTOR_PROVISIONS = [...IMPACT_DETECTOR_PROVISIONS];
56
56
  // shadows the card arm — discovery.spec's mask envelope wall catches
57
57
  // exactly that), and the bench plane keeps the self-naming strip for
58
58
  // era rows. The three weights are the family's constants (actions.ts
59
- // MASK_WEIGHTS — the LANE_FILES pattern), so the row carries no
60
- // lane_inputs. ONE variant, ONE address, no cells: the family's id
59
+ // MASK_WEIGHTS rides the loaders), and the DECL seats them as
60
+ // lane_inputs (the run-gate probe + anchor - the seat row below
61
+ // provisions). ONE variant, ONE address, no cells: the family's id
61
62
  // is its own route — and its six weights DOWNLOAD through the family
62
63
  // provisions above, like every other model (no separate
63
64
  // card-provision behavior).
@@ -68,6 +69,22 @@ export const DECL = {
68
69
  "genre": "image",
69
70
  "unoffered": true,
70
71
  "provisions": PROVISIONS,
72
+
73
+ // h3's crime shape closed for mask). The three weights stay the
74
+ // build's constants (MASK_WEIGHTS rides the loaders - a row value
75
+ // never reaches one, lane-laws pins that), but the DECL seats
76
+ // them as lane_inputs so the run gate PROBES presence at press
77
+ // and each miss's refusal anchors to its provisions URL (the
78
+ // anchor-at-the-door law). sam2 rides model_path + a declared
79
+ // sams home (the anny precedent - the stock folder map has no
80
+ // key for the sams pack, and EngineFacts' closed vocabulary
81
+ // forbids inventing one).
82
+ "lane_inputs": {
83
+ "checkpoint": MASK_WEIGHTS.checkpoint,
84
+ "unet": MASK_WEIGHTS.unet,
85
+ "model_path": MASK_WEIGHTS.sam2,
86
+ },
87
+ "lane_homes": { "model_path": "sams" },
71
88
  "variants": [
72
89
  {
73
90
  "id": "select",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@melite/models-mask",
3
- "version": "0.1.5-pre-alpha",
4
- "license": "SSPL-1.0",
3
+ "version": "0.2.2-alpha",
4
+ "license": "AGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -11,12 +11,7 @@
11
11
  "./package.json": "./package.json"
12
12
  },
13
13
  "dependencies": {
14
- "@melite/comfyui-card-kit": "0.1.5-pre-alpha"
15
- },
16
- "devDependencies": {
17
- "@types/node": "^22.20.0",
18
- "typescript": "^5.9.3",
19
- "@deepseek-ai/cordis": "^4.0.4"
14
+ "@melite/comfyui-card-kit": "0.2.2-alpha"
20
15
  },
21
16
  "files": [
22
17
  "lib/index.js",
@@ -24,12 +19,29 @@
24
19
  "lib/**/*.d.ts"
25
20
  ],
26
21
  "peerDependencies": {
27
- "@deepseek-ai/cordis": "^4.0.4"
22
+ "@deepseek-ai/cordis": "^4.0.5"
23
+ },
24
+ "description": "The mask studio's selection lane as a model family — SAM3/RT-DETR detection, the SAM2 arm, and paint exports, bound by the mask card.",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/JayDataEngineer/melite.git",
28
+ "directory": "packages/models/mask"
28
29
  },
30
+ "keywords": [
31
+ "melite",
32
+ "comfyui",
33
+ "cordis",
34
+ "agent",
35
+ "media-generation",
36
+ "library"
37
+ ],
29
38
  "scripts": {
30
39
  "build": "tsc -p tsconfig.build.json",
31
40
  "typecheck": "tsc --noEmit"
32
41
  },
42
+ "engines": {
43
+ "node": ">=22.18.0"
44
+ },
33
45
  "publishConfig": {
34
46
  "access": "public"
35
47
  }