@melite/models-wd14 0.1.4-alpha → 0.1.5-pre-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 +42 -0
- package/lib/actions.d.ts +2 -15
- package/lib/actions.js +3 -14
- package/lib/index.d.ts +4 -2
- package/lib/index.js +18 -1
- package/package.json +2 -3
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: WD14 Tagger family — booru keyword tagging of images for NovelAI, Pony, and Illustrious prompt recreation, with the tag action on the ComfyUI engine.
|
|
3
|
+
kind: package-library
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @melite/models-wd14
|
|
7
|
+
|
|
8
|
+
`@melite/models-wd14` is the model family package for the WD14 booru tagger (`form_tagger`, genre image, engine comfyui): a light ONNX lane from the WaifuDiffusion v3 lineage that reads an image and writes comma-separated Danbooru tags for NovelAI / Pony / Illustrious prompt recreation. The DECL declares the `tag` action, an eleven-checkpoint variant rail, and the required `input_image` relation. The estate boot mounts it as a Cordis plugin through `ctx.models.registerFamily` inside `ctx.effect`; the tagger card binds the action. The lane is weightless — no `lane_inputs` — and the segment is the wd14 arm of the legacy tagger lane, pinned byte-identical in `tests/action.spec.ts`.
|
|
9
|
+
|
|
10
|
+
## Declaration
|
|
11
|
+
|
|
12
|
+
The variant rail IS the checkpoint picker: one variant per live `WD14Tagger|pysssss` model name, pinned off the engine's `object_info` — unknown names are refused at selection time, and `wd-v1-4-moat-tagger-v2` rides first as the family default (its cell carries the measured ~4 GB VRAM peak; the other backbones are unmeasured and omit the figure). Family defaults: `threshold` 0.35, `character_threshold` 0.85, empty `exclude_tags`, underscores kept, no trailing comma. The `tag` action requires `input_image` — a tagger inverts an image, and nothing to tag is a refusal. The build loads the image (or a `$`-spelled upstream tensor), runs `WD14Tagger|pysssss`, and saves the text under `<run>/tags`. First run downloads the selected checkpoint's weights.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
.
|
|
16
|
+
./package.json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Model Experience
|
|
20
|
+
|
|
21
|
+
### Request context and condition
|
|
22
|
+
|
|
23
|
+
#### What the model sees
|
|
24
|
+
|
|
25
|
+
- **input_image** — required; the image to invert into tags.
|
|
26
|
+
- **checkpoint** — the variant-stamped backbone name (admitted, never rendered).
|
|
27
|
+
- **threshold / character_threshold** — the general and character confidence floors.
|
|
28
|
+
- **exclude_tags / replace_underscore / trailing_comma** — output shaping flags.
|
|
29
|
+
|
|
30
|
+
#### Token effect
|
|
31
|
+
|
|
32
|
+
Zero-direct token effect — the fields ride the composed ComfyUI graph; the tag text is engine output, not harness context.
|
|
33
|
+
|
|
34
|
+
#### KV Cache effect
|
|
35
|
+
|
|
36
|
+
Independent — each tagging run is its own engine request; no shared prefix.
|
|
37
|
+
|
|
38
|
+
## Known Limitations and Deferred Work
|
|
39
|
+
|
|
40
|
+
- **Weights not provisioned** — no provisions block; the first run fetches the checkpoint itself, so an offline estate tags nothing.
|
|
41
|
+
- **One measured VRAM figure** — only moat carries a peak number; the rest of the rail is unmeasured by declaration.
|
|
42
|
+
- **Tag vocabulary** — output is Danbooru-style tags; quality on non-anime images is not verified against the running engine.
|
package/lib/actions.d.ts
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import type { ComfyActionSpec } from "@melite/comfyui-card-kit";
|
|
2
|
-
import type
|
|
3
|
-
/** The closed facts shape the tag segment reads: nothing — the arm
|
|
4
|
-
* is weightless (every wire value comes from params). */
|
|
5
|
-
export type TagFacts = Record<string, never>;
|
|
6
|
-
/** The gated params doc the tag segment reads (the card's schema
|
|
7
|
-
* walk validated types and bounds — a same-process typed boundary;
|
|
8
|
-
* the arm reads its own subset of the card's union surface). */
|
|
9
|
-
export type TagParams = Record<string, unknown>;
|
|
10
|
-
/** The weightless door: the family declares no lane_inputs, so
|
|
11
|
-
* there is nothing to parse and nothing that can drift. The raw
|
|
12
|
-
* view rides unvalidated by contract (absent ≡ {}).
|
|
13
|
-
* @param _raw the resolved lane_inputs (empty for this family)
|
|
14
|
-
* @returns the vacuous facts shape */
|
|
15
|
-
export declare function parseTagFacts(_raw: LaneInputsFacts): TagFacts;
|
|
2
|
+
import { type WeightlessFacts, type WeightlessParams } from "@melite/comfyui-card-kit";
|
|
16
3
|
/** The image prompt-inversion action: the WD14 booru interrogator —
|
|
17
4
|
* LoadImage (or the wired spell), WD14Tagger|pysssss at the
|
|
18
5
|
* confidence floors, SaveText under <run>/tags. */
|
|
19
|
-
export declare const tag: ComfyActionSpec<
|
|
6
|
+
export declare const tag: ComfyActionSpec<WeightlessParams, WeightlessFacts>;
|
|
20
7
|
//# sourceMappingURL=actions.d.ts.map
|
package/lib/actions.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import { taggerSaveText } from "@melite/comfyui-card-kit";
|
|
2
|
-
/** The weightless door: the family declares no lane_inputs, so
|
|
3
|
-
* there is nothing to parse and nothing that can drift. The raw
|
|
4
|
-
* view rides unvalidated by contract (absent ≡ {}).
|
|
5
|
-
* @param _raw the resolved lane_inputs (empty for this family)
|
|
6
|
-
* @returns the vacuous facts shape */
|
|
7
|
-
export function parseTagFacts(_raw) {
|
|
8
|
-
return {};
|
|
9
|
-
}
|
|
1
|
+
import { taggerSaveText, parseWeightlessFacts, assertTagInput } from "@melite/comfyui-card-kit";
|
|
10
2
|
/** The image prompt-inversion action: the WD14 booru interrogator —
|
|
11
3
|
* LoadImage (or the wired spell), WD14Tagger|pysssss at the
|
|
12
4
|
* confidence floors, SaveText under <run>/tags. */
|
|
@@ -28,12 +20,9 @@ export const tag = {
|
|
|
28
20
|
{ name: "replace_underscore", type: "boolean" },
|
|
29
21
|
{ name: "trailing_comma", type: "boolean" },
|
|
30
22
|
],
|
|
31
|
-
facts:
|
|
23
|
+
facts: parseWeightlessFacts,
|
|
32
24
|
build({ p, g, runId }) {
|
|
33
|
-
const img =
|
|
34
|
-
if (!img.trim()) {
|
|
35
|
-
throw new Error("required param 'input_image' missing or blank on the tagger card (the tagger inverts an image; nothing to tag is a refusal)");
|
|
36
|
-
}
|
|
25
|
+
const img = assertTagInput(p);
|
|
37
26
|
// THE SPELLED ANCHOR (same law — the arm bypasses the loader
|
|
38
27
|
// for a wired image; the card admits the spell).
|
|
39
28
|
const src = img.startsWith("$") ? img : g.node("LoadImage", { image: img }).out();
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Plugin } from "@deepseek-ai/cordis";
|
|
2
|
-
import type { ModelDecl } from
|
|
2
|
+
import type { ModelDecl } from '@melite/comfyui-card-kit/model-contract';
|
|
3
3
|
export declare const DECL: ModelDecl;
|
|
4
4
|
export declare const family: Plugin;
|
|
5
|
-
export { tag
|
|
5
|
+
export { tag } from "./actions.js";
|
|
6
|
+
export { parseWeightlessFacts as parseTagFacts, type WeightlessFacts as TagFacts, type WeightlessParams as TagParams } from "@melite/comfyui-card-kit";
|
|
7
|
+
export { family as default };
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -138,6 +138,15 @@ export const DECL = {
|
|
|
138
138
|
},
|
|
139
139
|
],
|
|
140
140
|
},
|
|
141
|
+
// THE LANE SURFACE (the z-image precedent): exactly the knobs the
|
|
142
|
+
// tagger card serves — the face the four tagger families share.
|
|
143
|
+
"params": [
|
|
144
|
+
"input_image",
|
|
145
|
+
"threshold", "character_threshold",
|
|
146
|
+
"exclude_tags", "replace_underscore", "trailing_comma",
|
|
147
|
+
"add_tag", "remove_tag",
|
|
148
|
+
"caption_task", "caption_type", "caption_length", "extra_option",
|
|
149
|
+
],
|
|
141
150
|
// THE FAMILY'S DECLARED ACTIONS (the atom vocabulary, stroke 3):
|
|
142
151
|
// the tagger card binds this segment through ACTION_BINDINGS —
|
|
143
152
|
// the admission gate runs the (vacuous, weightless) facts parse
|
|
@@ -151,5 +160,13 @@ export const family = {
|
|
|
151
160
|
ctx.effect(() => ctx.models.registerFamily(DECL));
|
|
152
161
|
},
|
|
153
162
|
};
|
|
154
|
-
|
|
163
|
+
|
|
164
|
+
// the old Tag* aliases are re-served for the family's consumers.
|
|
165
|
+
export { tag } from "./actions.js";
|
|
166
|
+
export { parseWeightlessFacts as parseTagFacts } from "@melite/comfyui-card-kit";
|
|
167
|
+
// The Loader-row face: DSH loads plugin rows by bare specifier and
|
|
168
|
+
// unwraps `exports.default ?? exports` (vendor/cordis_plugins/loader
|
|
169
|
+
// unwrapExports) — the default export IS the row-loadable plugin. The
|
|
170
|
+
// named `family` stays the library face (engine loadFamilies).
|
|
171
|
+
export { family as default };
|
|
155
172
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melite/models-wd14",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5-pre-alpha",
|
|
4
4
|
"license": "SSPL-1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"./package.json": "./package.json"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@melite/comfyui-
|
|
15
|
-
"@melite/comfyui-card-kit": "0.1.4-alpha"
|
|
14
|
+
"@melite/comfyui-card-kit": "0.1.5-pre-alpha"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
17
|
"@types/node": "^22.20.0",
|