@melite/models-yue2 0.1.4-alpha → 0.2.0-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/LICENSE +561 -457
- package/README.md +42 -0
- package/lib/actions.js +28 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +32 -6
- package/package.json +5 -6
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: YuE2 music family — YuE2-3B style-plus-lyrics song generation with ABC planning, on the ComfyUI engine from the official Comfy-Org release.
|
|
3
|
+
kind: package-library
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @melite/models-yue2
|
|
7
|
+
|
|
8
|
+
`@melite/models-yue2` is the model family package for YuE2-3B music generation (`form_music`, genre audio, engine comfyui): a style caption plus lyrics go in, an ABC plan is drafted, and a song comes out as mp3. The DECL boards the official Comfy-Org release (`Comfy-Org/YuE2`, the `audio_yue2_text2music` template) and declares the `compose` action, one provision, and the required `prompt` relation. The estate boot mounts it as a Cordis plugin through `ctx.models.registerFamily` inside `ctx.effect`; the music card binds the action. The lane is this package's own `actions.ts`, pinned to committed goldens in `tests/golden/`.
|
|
9
|
+
|
|
10
|
+
## Declaration
|
|
11
|
+
|
|
12
|
+
One checkpoint carries model, clip, and VAE (`yue2_3b_int8_convrot.safetensors`, provisioned from Comfy-Org at ~3.96 GB, sha256-pinned; the INT8 ConvRot cell declares an ~8 GB VRAM peak). Variant recipes: `short_sting` stamps `duration` 5 (the schema floor) and `full_length` stamps 360 (the ceiling); `Default` stamps nothing. The `compose` action's params: `prompt` (required — every music lane states what the song is), `lyrics`, `mode` (`full` / `melody` / `off`), `duration` (bounds 5–360), `n_diffusion_steps` (1–200), and a seed-sentinel `seed`. The build plans ABC with `YuE2GenerateABC` (mode `off` composes no planner), sizes the latent from `YuE2GenerateMusic`'s seconds output, samples with KSampler dpm_2 / sgm_uniform at cfg 1, and saves mp3 V0 under `<run>/music`.
|
|
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
|
+
- **prompt** — required; the style caption.
|
|
26
|
+
- **lyrics** — the sung words (absent rides as empty).
|
|
27
|
+
- **mode** — the ABC-planning pick.
|
|
28
|
+
- **duration / n_diffusion_steps / seed** — length, sampler depth, and the minted seed.
|
|
29
|
+
|
|
30
|
+
#### Token effect
|
|
31
|
+
|
|
32
|
+
Zero-direct token effect — the fields ride the composed ComfyUI graph; the caption and lyrics are engine-side, never harness context.
|
|
33
|
+
|
|
34
|
+
#### KV Cache effect
|
|
35
|
+
|
|
36
|
+
Independent — each composition is its own engine request; no shared prefix.
|
|
37
|
+
|
|
38
|
+
## Known Limitations and Deferred Work
|
|
39
|
+
|
|
40
|
+
- **One quant boarded** — only the INT8 ConvRot cell exists; the bf16 cell and the SheetSage2 cover encoder stay unboarded until a cover lane exists (the DECL's own source note).
|
|
41
|
+
- **Guidance is fixed** — cfg rides at 1 by design (guidance lives on the AR side); there is no cfg knob.
|
|
42
|
+
- **Song quality** — musicality and lyric adherence are not verified against the running model.
|
package/lib/actions.js
CHANGED
|
@@ -31,6 +31,27 @@ export const compose = {
|
|
|
31
31
|
],
|
|
32
32
|
facts: parseYue2Facts,
|
|
33
33
|
build({ p, facts, g, runId }) {
|
|
34
|
+
|
|
35
|
+
// mode precedent, music3/actions.ts: the DECL surface drops the
|
|
36
|
+
// knob, the build refuses the legacy draft). guidance_scale +
|
|
37
|
+
// lm_cfg_scale are the MiniMax lane's vocabulary (KSampler cfg +
|
|
38
|
+
// MiniMaxMusic3TextEncode cfg_scale) — the yue2 DECL serves
|
|
39
|
+
// neither (index.ts params), YuE2GenerateABC/YuE2GenerateMusic
|
|
40
|
+
// declare no such input, and KSampler cfg is the lane's fixed 1.
|
|
41
|
+
|
|
42
|
+
// at compose — the SD-1 wedge (authored-on-music3, switched to
|
|
43
|
+
// yue2). Refuse loud in the knob's own voice; the schema
|
|
44
|
+
// default 1.7 rides (the stated default IS the unstated
|
|
45
|
+
// compose), and an absent knob (direct action callers) rides.
|
|
46
|
+
for (const [knob, lane] of [["guidance_scale", "KSampler cfg"], ["lm_cfg_scale", "the lyric-encoder guidance"]]) {
|
|
47
|
+
const v = p[knob];
|
|
48
|
+
if (v !== undefined && v !== 1.7) {
|
|
49
|
+
throw new Error(`yue2 compose: ${knob} '${String(v)}' fires nothing on this lane — ` +
|
|
50
|
+
`${knob} is the MiniMax lane's vocabulary (${lane}); ` +
|
|
51
|
+
"the YuE2 nodes read style+lyrics+mode only, KSampler cfg is the lane's fixed 1. " +
|
|
52
|
+
"Drop it, or switch lane (model=music3) to steer the MiniMax guidance");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
34
55
|
const seed = p.seed;
|
|
35
56
|
const ckpt = g.node("CheckpointLoaderSimple", { ckpt_name: facts.checkpoint });
|
|
36
57
|
const style = p.prompt;
|
|
@@ -40,6 +61,12 @@ export const compose = {
|
|
|
40
61
|
// GenerateMusic rides an empty abc (the engine's own off mode);
|
|
41
62
|
// full/melody ride YuE2GenerateABC with the same style + lyrics.
|
|
42
63
|
let abc = "";
|
|
64
|
+
// Off is CARD vocabulary the node enum cannot spell (full|melody)
|
|
65
|
+
// and mode is engine-REQUIRED — the off arm wires the engine's
|
|
66
|
+
// own default 'full' over the EMPTY abc (the off semantics live
|
|
67
|
+
// in the missing conditioning, never in a mode literal the enum
|
|
68
|
+
// refuses).
|
|
69
|
+
const nodeMode = mode === "off" ? "full" : mode;
|
|
43
70
|
if (mode !== "off") {
|
|
44
71
|
abc = g.node("YuE2GenerateABC", {
|
|
45
72
|
clip: ckpt.out(1), style, lyrics, seed, mode,
|
|
@@ -48,7 +75,7 @@ export const compose = {
|
|
|
48
75
|
}).out(0);
|
|
49
76
|
}
|
|
50
77
|
const music = g.node("YuE2GenerateMusic", {
|
|
51
|
-
clip: ckpt.out(1), style, lyrics, abc, seed, mode,
|
|
78
|
+
clip: ckpt.out(1), style, lyrics, abc, seed, mode: nodeMode,
|
|
52
79
|
max_duration: p.duration, temperature: 1.0, top_p: 0.95, top_k: 100,
|
|
53
80
|
repetition_penalty: 1.2,
|
|
54
81
|
});
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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
5
|
export { compose, parseYue2Facts, type Yue2Facts, type Yue2Params } from "./actions.js";
|
|
6
|
+
export { family as default };
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.js
CHANGED
|
@@ -11,6 +11,15 @@ export const DECL = {
|
|
|
11
11
|
"note": "The official Comfy-Org release (template audio_yue2_text2music); int8 convrot is the template's own quant pick. The bf16 cell and the SheetSage2 cover encoder stay unboarded until a cover lane exists."
|
|
12
12
|
},
|
|
13
13
|
"genre": "audio",
|
|
14
|
+
|
|
15
|
+
// user-provided seats (prompt, lyrics) — the compose caller
|
|
16
|
+
// provides them. No variant-class rows: this family's served
|
|
17
|
+
// face exposes no steps+cfg pair (the census's surface-derived
|
|
18
|
+
// carve).
|
|
19
|
+
"required_defaults": [
|
|
20
|
+
{ "name": "prompt", "class": "user" },
|
|
21
|
+
{ "name": "lyrics", "class": "user" }
|
|
22
|
+
],
|
|
14
23
|
"variants": [
|
|
15
24
|
{
|
|
16
25
|
"id": "standard",
|
|
@@ -19,10 +28,9 @@ export const DECL = {
|
|
|
19
28
|
"route": "yue2",
|
|
20
29
|
"cells": [
|
|
21
30
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"quant": "int8",
|
|
31
|
+
|
|
32
|
+
// Comfy-Org checkpoint the provisions row carries.
|
|
33
|
+
"quant": "int8_convrot",
|
|
26
34
|
"label": "INT8 ConvRot",
|
|
27
35
|
"route": "yue2",
|
|
28
36
|
"vram_peak_gb": 8,
|
|
@@ -30,7 +38,7 @@ export const DECL = {
|
|
|
30
38
|
]
|
|
31
39
|
},
|
|
32
40
|
{
|
|
33
|
-
"id": "
|
|
41
|
+
"id": "short-sting",
|
|
34
42
|
"label": "Short Sting",
|
|
35
43
|
"hint": "Duration 5s — the card schema's own floor (a sting or loop).",
|
|
36
44
|
"group": "Recipe",
|
|
@@ -38,7 +46,7 @@ export const DECL = {
|
|
|
38
46
|
"cells": [],
|
|
39
47
|
},
|
|
40
48
|
{
|
|
41
|
-
"id": "
|
|
49
|
+
"id": "full-length",
|
|
42
50
|
"label": "Full Length",
|
|
43
51
|
"hint": "Duration 360s — the card schema's own ceiling (full-song length).",
|
|
44
52
|
"group": "Recipe",
|
|
@@ -95,6 +103,19 @@ export const DECL = {
|
|
|
95
103
|
},
|
|
96
104
|
],
|
|
97
105
|
},
|
|
106
|
+
// THE LANE SURFACE (the z-image precedent): exactly the knobs the
|
|
107
|
+
// music card serves. guidance_scale + lm_cfg_scale are NOT served
|
|
108
|
+
|
|
109
|
+
// the MiniMax lane's vocabulary, unread on the YuE2 lane (KSampler
|
|
110
|
+
// cfg is the lane's fixed 1, neither YuE2 node takes the input).
|
|
111
|
+
// Dropping them from the surface makes the compose door refuse a
|
|
112
|
+
// legacy draft stating them (unknown-param refusal, layer 1);
|
|
113
|
+
// actions.ts refuses them at the card path (layer 2). The card
|
|
114
|
+
// schema keeps them (music3's seat) with visible_when music3.
|
|
115
|
+
"params": [
|
|
116
|
+
"prompt", "lyrics", "duration", "mode",
|
|
117
|
+
"n_diffusion_steps", "seed",
|
|
118
|
+
],
|
|
98
119
|
// THE DECLARED ACTIONS (the atom vocabulary, stroke 3):
|
|
99
120
|
// the compose action the music card binds (the YuE2-3B lane).
|
|
100
121
|
// The admission gate runs the facts parse at registration.
|
|
@@ -108,4 +129,9 @@ export const family = {
|
|
|
108
129
|
},
|
|
109
130
|
};
|
|
110
131
|
export { compose, parseYue2Facts } from "./actions.js";
|
|
132
|
+
// The Loader-row face: DSH loads plugin rows by bare specifier and
|
|
133
|
+
// unwraps `exports.default ?? exports` (vendor/cordis_plugins/loader
|
|
134
|
+
// unwrapExports) — the default export IS the row-loadable plugin. The
|
|
135
|
+
// named `family` stays the library face (engine loadFamilies).
|
|
136
|
+
export { family as default };
|
|
111
137
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melite/models-yue2",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"license": "
|
|
3
|
+
"version": "0.2.0-alpha",
|
|
4
|
+
"license": "AGPL-3.0-or-later",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -11,13 +11,12 @@
|
|
|
11
11
|
"./package.json": "./package.json"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@melite/comfyui-card-kit": "0.
|
|
15
|
-
"@melite/comfyui-cordis": "0.1.4-alpha"
|
|
14
|
+
"@melite/comfyui-card-kit": "0.2.0-alpha"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
17
|
"@types/node": "^22.20.0",
|
|
19
18
|
"typescript": "^5.9.3",
|
|
20
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
19
|
+
"@deepseek-ai/cordis": "^4.0.5"
|
|
21
20
|
},
|
|
22
21
|
"files": [
|
|
23
22
|
"lib/index.js",
|
|
@@ -25,7 +24,7 @@
|
|
|
25
24
|
"lib/**/*.d.ts"
|
|
26
25
|
],
|
|
27
26
|
"peerDependencies": {
|
|
28
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
27
|
+
"@deepseek-ai/cordis": "^4.0.5"
|
|
29
28
|
},
|
|
30
29
|
"scripts": {
|
|
31
30
|
"build": "tsc -p tsconfig.build.json",
|