@melite/image-tagger 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.
Files changed (4) hide show
  1. package/LICENSE +561 -457
  2. package/README.md +2 -6
  3. package/lib/card.js +21 -11
  4. package/package.json +32 -17
package/README.md CHANGED
@@ -1,15 +1,11 @@
1
- ---
2
- description: Caption-and-tag card over four tagger families — wd14, joytag, florence2, and joycaption.
3
- kind: package-library
4
- ---
5
-
6
1
  # @melite/image-tagger
7
2
 
8
- `@melite/image-tagger` is the image captioning card (`id: 'tagger'`): one image in, a caption or tag list out as a `tags.txt` run artifact. Four families board, each through its own declared `tag` action: `wd14`, `joytag`, `florence2`, and `joycaption`. The lane is weightless — models load, nothing else computes. The package's single source module is the root face the cardPackages SSOT composes (`@melite/image-tagger`); there is no tool or client face.
3
+ `@melite/image-tagger` is the image captioning card (`id: 'tagger'`): one image in, a caption or tag list out as a `tags.txt` run artifact. Four families board, each through its own declared `tag` action: `wd14`, `joytag`, `florence2`, and `joycaption`. The lane is weightless — models load, nothing else computes. The package's single source module is the root face the cardPackages SSOT composes (`@melite/image-tagger`), which the manifest spells again as the explicit `./card` door; there is no tool or client face.
9
4
 
10
5
  ## Contract
11
6
 
12
7
  - `.` — the card definition and registration (the root module carries `inject = ['comfyui']`). Schema: `input_image` (required); `threshold` — the general-tag confidence floor; `character_threshold` — the person-identity floor, deliberately higher; and four defaultless optionals backfilled per family: `exclude_tags` (wd14), `add_tag`/`remove_tag` (joytag), and `extra_option` (joycaption). Ride keys carry NO `.default` — the model picks the floor by default, the caller overrides explicitly. The per-family requirement map is declared here by augmenting `CardDefinition` (`requiresByFamily`), and the SaveText tail plus the caption vocabularies (`TAGGER_CAPTION_TASKS`, `TAGGER_CAPTION_TYPES`, `TAGGER_CAPTION_LENGTHS`, `TAGGER_EXTRA_OPTIONS`) come from `@melite/comfyui-card-kit`. There is NO weights knob — the Model/Variant/Quant rail is the only picker, and validation stamps `resolver_defaults` (absent keys only).
8
+ - `./card` — the same card module as the root face, re-exported as the explicit named door (one file, two specifiers).
13
9
  - `./package.json` — the manifest.
14
10
 
15
11
  ## Model Experience
package/lib/card.js CHANGED
@@ -54,26 +54,36 @@ export const ACTION_BINDINGS = {
54
54
  // paths ride explicit params (API/bare bodies).
55
55
  const schema = z.object({
56
56
  input_image: z.string().role('path').description("Input image").extra('extra', bag(inputImageExtra({ tooltip: 'The image to invert. Absolute mount path or artifact ref.' }))),
57
- threshold: z.number().description("Threshold").min(0).max(1).step(0.05).extra('extra', bag({ order: 1, group: "tagger", width: 1, tooltip: "General-tag confidence floor." })),
58
- character_threshold: z.number().description("Character threshold").min(0).max(1).step(0.05).extra('extra', bag({ order: 2, group: "tagger", width: 1, tooltip: "Character-tag confidence floor — keep high." })),
59
- exclude_tags: z.string().description("Exclude tags").extra('extra', bag({ order: 3, group: "tagger", width: 1, tooltip: "Comma-separated tags to prune from the output." })),
60
- replace_underscore: z.boolean().description("Replace underscores").extra('extra', bag({ order: 4, group: "tagger", width: 1, tooltip: "Emit \"silver hair\" instead of \"silver_hair\"." })),
61
- trailing_comma: z.boolean().description("Trailing comma").extra('extra', bag({ order: 5, group: "tagger", width: 1, tooltip: "Terminate the tag list with a comma (prompt-paste shape)." })),
62
- add_tag: z.string().description("Add tag").extra('extra', bag({ order: 6, group: "tagger", width: 1, tooltip: "JoyTag: tags force-prepended to the output (comma-separated). Ignored by WD14." })),
63
- remove_tag: z.string().description("Remove tag").extra('extra', bag({ order: 7, group: "tagger", width: 1, tooltip: "JoyTag: tags pruned from the output (comma-separated). Ignored by WD14." })),
64
- caption_task: vocabulary([...TAGGER_CAPTION_TASKS]).description("Caption task").extra('extra', bag({ order: 8, group: "tagger", width: 1, tooltip: "Florence-2: the vision task (live task vocabulary). Ignored by WD14/JoyTag.", wtype: 'select' })),
65
- caption_type: vocabulary([...TAGGER_CAPTION_TYPES]).description("Caption style").extra('extra', bag({ order: 9, group: "tagger", width: 1, tooltip: "JoyCaption: the caption template (live vocabulary). Ignored by WD14/JoyTag/Florence-2.", wtype: 'select' })),
57
+
58
+ // number knob with no floor on the families that never read it
59
+ // rendered "undefined — REFUSED: not a number"). Every knob
60
+ // scopes to the families whose declared action consumes it
61
+ // (wd14: threshold/character_threshold/exclude_tags/
62
+ // replace_underscore/trailing_comma; joytag: threshold/add_tag/
63
+ // remove_tag; florence2: caption_task; joycaption: caption_type/
64
+ // caption_length/extra_option) — an unscoped number is a
65
+ // refused face waiting to happen, a scoped one never renders
66
+ // for the family that has no floor for it.
67
+ threshold: z.number().description("Threshold").min(0).max(1).step(0.05).extra('extra', bag({ order: 1, group: "tagger", width: 1, families: ["wd14", "joytag"], tooltip: "General-tag confidence floor (WD14 + JoyTag)." })),
68
+ character_threshold: z.number().description("Character threshold").min(0).max(1).step(0.05).extra('extra', bag({ order: 2, group: "tagger", width: 1, families: ["wd14"], tooltip: "Character-tag confidence floor — keep high (WD14 only)." })),
69
+ exclude_tags: z.string().description("Exclude tags").extra('extra', bag({ order: 3, group: "tagger", width: 1, families: ["wd14"], tooltip: "Comma-separated tags to prune from the output (WD14 only)." })),
70
+ replace_underscore: z.boolean().description("Replace underscores").extra('extra', bag({ order: 4, group: "tagger", width: 1, families: ["wd14"], tooltip: "Emit \"silver hair\" instead of \"silver_hair\" (WD14 only)." })),
71
+ trailing_comma: z.boolean().description("Trailing comma").extra('extra', bag({ order: 5, group: "tagger", width: 1, families: ["wd14"], tooltip: "Terminate the tag list with a comma (prompt-paste shape; WD14 only)." })),
72
+ add_tag: z.string().description("Add tag").extra('extra', bag({ order: 6, group: "tagger", width: 1, families: ["joytag"], tooltip: "JoyTag: tags force-prepended to the output (comma-separated)." })),
73
+ remove_tag: z.string().description("Remove tag").extra('extra', bag({ order: 7, group: "tagger", width: 1, families: ["joytag"], tooltip: "JoyTag: tags pruned from the output (comma-separated)." })),
74
+ caption_task: vocabulary([...TAGGER_CAPTION_TASKS]).default("more_detailed_caption").description("Caption task").extra('extra', bag({ order: 8, group: "tagger", width: 1, families: ["florence2"], tooltip: "Florence-2: the vision task (live task vocabulary).", wtype: 'select' })),
75
+ caption_type: vocabulary([...TAGGER_CAPTION_TYPES]).default("Descriptive").description("Caption style").extra('extra', bag({ order: 9, group: "tagger", width: 1, families: ["joycaption"], tooltip: "JoyCaption: the caption template (live vocabulary).", wtype: 'select' })),
66
76
  // the FORM subset (the named six) of the kit's full set (which
67
77
  // also carries the node's 20-260 word counts, for bare/API
68
78
  // bodies) — a named subset, never a retyped copy that can
69
79
  // drift from the node's own vocabulary (the card-plane
70
80
  // audit's H2)
71
- caption_length: vocabulary([...TAGGER_CAPTION_LENGTHS]).description("Caption length").extra('extra', bag({ order: 10, group: "tagger", width: 1, tooltip: "JoyCaption: target length (the named six; the node also takes word counts 20-260, which bare/API bodies may send). Ignored by other families.", wtype: 'select' })),
81
+ caption_length: vocabulary([...TAGGER_CAPTION_LENGTHS]).default("long").description("Caption length").extra('extra', bag({ order: 10, group: "tagger", width: 1, families: ["joycaption"], tooltip: "JoyCaption: target length (the named six; the node also takes word counts 20-260, which bare/API bodies may send).", wtype: 'select' })),
72
82
  // the FULL kit list: the card had retyped a 14-option subset and
73
83
  // one entry had ALREADY drifted into a truncated fork of the
74
84
  // upstream canned string, which rode verbatim into the node
75
85
  // (the card-plane audit's H2 — the one entry proved it)
76
- extra_option: vocabulary([...TAGGER_EXTRA_OPTIONS]).description("Extra instruction").extra('extra', bag({ order: 11, group: "tagger", width: 1, tooltip: "JoyCaption: one appended instruction (the full 27-option list rides bare/API bodies; the engine's own vulgar-caption row is dropped at this surface — release hygiene). Ignored by other families.", wtype: 'select' })),
86
+ extra_option: vocabulary([...TAGGER_EXTRA_OPTIONS]).default("").description("Extra instruction").extra('extra', bag({ order: 11, group: "tagger", width: 1, families: ["joycaption"], tooltip: "JoyCaption: one appended instruction (the full 27-option list rides bare/API bodies; the engine's own vulgar-caption row is dropped at this surface — release hygiene).", wtype: 'select' })),
77
87
  // NO filename_prefix (card: "the run routes outputs by run id
78
88
  // (compose stamps `<run>/tags`) — a user knob here was silently
79
89
  // overwritten, a dead promise"). Old drafts naming it still parse
package/package.json CHANGED
@@ -1,28 +1,27 @@
1
1
  {
2
- "version": "0.1.5-pre-alpha",
3
- "license": "SSPL-1.0",
2
+ "version": "0.2.2-alpha",
3
+ "license": "AGPL-3.0-or-later",
4
4
  "type": "module",
5
- "description": "the tagger card (the image lane) — one card one package: card.ts host face (no tool face, no ui/, no agents/ — the view is constructed by @melite/card-base from the emission)",
5
+ "description": "Caption-and-tag card over four tagger families — wd14, joytag, florence2, and joycaption.",
6
6
  "exports": {
7
7
  ".": {
8
8
  "types": "./lib/card.d.ts",
9
9
  "default": "./lib/card.js"
10
10
  },
11
- "./package.json": "./package.json"
11
+ "./package.json": "./package.json",
12
+ "./card": {
13
+ "types": "./lib/card.d.ts",
14
+ "default": "./lib/card.js"
15
+ }
12
16
  },
13
17
  "dependencies": {
14
- "@deepseek-ai/schemastery": "^3.18.4",
15
- "@melite/comfyui-card-kit": "0.1.5-pre-alpha",
16
- "@melite/contracts": "0.1.5-pre-alpha",
17
- "@melite/models-florence2": "0.1.5-pre-alpha",
18
- "@melite/models-joycaption": "0.1.5-pre-alpha",
19
- "@melite/models-wd14": "0.1.5-pre-alpha",
20
- "@melite/models-joytag": "0.1.5-pre-alpha"
21
- },
22
- "devDependencies": {
23
- "@types/node": "^22.20.0",
24
- "typescript": "^5.9.3",
25
- "@deepseek-ai/cordis": "^4.0.4"
18
+ "@deepseek-ai/schemastery": "^3.18.5",
19
+ "@melite/comfyui-card-kit": "0.2.2-alpha",
20
+ "@melite/contracts": "0.2.2-alpha",
21
+ "@melite/models-florence2": "0.2.2-alpha",
22
+ "@melite/models-joycaption": "0.2.2-alpha",
23
+ "@melite/models-joytag": "0.2.2-alpha",
24
+ "@melite/models-wd14": "0.2.2-alpha"
26
25
  },
27
26
  "name": "@melite/image-tagger",
28
27
  "files": [
@@ -31,12 +30,28 @@
31
30
  "lib/**/*.d.ts"
32
31
  ],
33
32
  "peerDependencies": {
34
- "@deepseek-ai/cordis": "^4.0.4"
33
+ "@deepseek-ai/cordis": "^4.0.5"
35
34
  },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/JayDataEngineer/melite.git",
38
+ "directory": "packages/image/tagger"
39
+ },
40
+ "keywords": [
41
+ "melite",
42
+ "comfyui",
43
+ "cordis",
44
+ "agent",
45
+ "media-generation",
46
+ "library"
47
+ ],
36
48
  "scripts": {
37
49
  "build": "tsc -p tsconfig.build.json",
38
50
  "typecheck": "tsc --noEmit"
39
51
  },
52
+ "engines": {
53
+ "node": ">=22.18.0"
54
+ },
40
55
  "publishConfig": {
41
56
  "access": "public"
42
57
  }