@melite/audio-music 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 +44 -0
- package/lib/card.d.ts +5 -3
- package/lib/card.js +17 -15
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -8
- package/lib/tool.js +1 -1
- package/package.json +12 -13
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Text-to-music card and agent tool over the MiniMax Music 3 and YuE2-3B stock ComfyUI nodes.
|
|
3
|
+
kind: package-library
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @melite/audio-music
|
|
7
|
+
|
|
8
|
+
`@melite/audio-music` is the music card plus the `music` agent tool. Two families board: `music3` (MiniMax Music 3) and `yue2` (YuE2-3B), both on the `compose` action. The lane is stock-only — the nodes live in upstream core (`comfy_extras.nodes_minimax_music`, `nodes_yue2`), so the card declares no `requires`. The cardPackages SSOT composes the card from `./card`; the tool registers through melite-tools' cardTools gate from `./tool`.
|
|
9
|
+
|
|
10
|
+
## Contract
|
|
11
|
+
|
|
12
|
+
- `./card` — the card definition (sidebar key `audio`). Schema: `prompt` (required — "Genre + Vocal Details + Arrangement"), `lyrics` (empty means instrumental), `duration` (5..360 s, default 30 — exact for music3, a ceiling for yue2), `mode` (`full` | `melody` | `off`, default `full` — the yue2 ABC planning rail), plus music3's `guidance_scale` (default 1.7), `n_diffusion_steps` (default 30), `lm_cfg_scale` (default 1.7), and `seed` (−1).
|
|
13
|
+
- `./tool` — `buildMusicTool`, the `music` tool face; preview field `prompt`, model enum from the boarded families.
|
|
14
|
+
- `.` — the row-mounted composition marker; it registers the card only when the `comfyui` seat exists, and never registers the tool.
|
|
15
|
+
- `./package.json` — the manifest.
|
|
16
|
+
|
|
17
|
+
## Gates
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm --filter @melite/audio-music exec vitest run
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Model Experience
|
|
24
|
+
|
|
25
|
+
### Request context and condition
|
|
26
|
+
|
|
27
|
+
The `music` tool fires an agent request when called; the card conditions a ComfyUI run when composed.
|
|
28
|
+
|
|
29
|
+
#### What the model sees
|
|
30
|
+
|
|
31
|
+
The music model receives the gated caption, lyrics, duration, mode, and guidance values as the composed graph's inputs; the agent sees the tool's parameter schema and the caller's values.
|
|
32
|
+
|
|
33
|
+
#### Token effect
|
|
34
|
+
|
|
35
|
+
conditional — the schema occupies context only in sessions that register the tool; values ride only tool-call turns.
|
|
36
|
+
|
|
37
|
+
#### KV Cache effect
|
|
38
|
+
|
|
39
|
+
append-only — tool-call turns append messages; earlier turns stay byte-identical.
|
|
40
|
+
|
|
41
|
+
## Known Limitations and Deferred Work
|
|
42
|
+
|
|
43
|
+
- **Duration semantics split by family** — music3 honors the number exactly; yue2 treats it as a maximum.
|
|
44
|
+
- **Stock nodes only** — capability changes ride upstream core updates; this package declares no extension packs.
|
package/lib/card.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Context } from '@
|
|
1
|
+
import type { Context } from '@melite/comfyui-card-kit/card-definition';
|
|
2
2
|
import z from '@deepseek-ai/schemastery';
|
|
3
3
|
import type { ModelFacts } from '@melite/comfyui-card-kit/facts';
|
|
4
4
|
import type { GraphBuilder } from '@melite/comfyui-card-kit/graph';
|
|
5
|
-
import
|
|
5
|
+
import { ComfyUIServiceFace } from '@melite/comfyui-card-kit/service-faces';
|
|
6
6
|
export declare const schema: z<Schemastery.ObjectS<NoInfer<{
|
|
7
7
|
prompt: z<string, string, "plain">;
|
|
8
8
|
lyrics: z<string, string, "plain">;
|
|
@@ -12,6 +12,7 @@ export declare const schema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
12
12
|
n_diffusion_steps: z<number, number, "defined">;
|
|
13
13
|
lm_cfg_scale: z<number, number, "defined">;
|
|
14
14
|
seed: z<number, number, "defined">;
|
|
15
|
+
tiled_decode: z<boolean, boolean, "plain">;
|
|
15
16
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
16
17
|
prompt: z<string, string, "plain">;
|
|
17
18
|
lyrics: z<string, string, "plain">;
|
|
@@ -21,6 +22,7 @@ export declare const schema: z<Schemastery.ObjectS<NoInfer<{
|
|
|
21
22
|
n_diffusion_steps: z<number, number, "defined">;
|
|
22
23
|
lm_cfg_scale: z<number, number, "defined">;
|
|
23
24
|
seed: z<number, number, "defined">;
|
|
25
|
+
tiled_decode: z<boolean, boolean, "plain">;
|
|
24
26
|
}>>, "plain">;
|
|
25
27
|
export declare const BOARDED: string[];
|
|
26
28
|
/** THE ACTION BINDINGS (the atom vocabulary, stroke 3): the owning
|
|
@@ -38,5 +40,5 @@ export declare const identity: {
|
|
|
38
40
|
genre: string;
|
|
39
41
|
icon: string;
|
|
40
42
|
};
|
|
41
|
-
export declare function registerCard(ctx: Context, comfy:
|
|
43
|
+
export declare function registerCard(ctx: Context, comfy: ComfyUIServiceFace): void;
|
|
42
44
|
//# sourceMappingURL=card.d.ts.map
|
package/lib/card.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import z from '@deepseek-ai/schemastery';
|
|
2
2
|
import { declaredAction, instantiateAction } from '@melite/comfyui-card-kit';
|
|
3
3
|
import { DECL as music3Decl } from '@melite/models-music3';
|
|
4
|
+
import { MUSIC3_FULL_STEPS } from '@melite/models-music3';
|
|
4
5
|
import { DECL as yue2Decl } from '@melite/models-yue2';
|
|
5
6
|
import { vocabulary } from '@melite/comfyui-card-kit/vocab';
|
|
6
7
|
import { bag } from '@melite/contracts/extraKeys';
|
|
7
|
-
import {
|
|
8
|
+
import { seedExtra } from '@melite/comfyui-card-kit/fields';
|
|
9
|
+
import { callableSchema, gatedResolve } from '@melite/comfyui-card-kit/admission';
|
|
8
10
|
export const schema = z.object({
|
|
9
|
-
prompt: z.string().description("Tags / Description").extra('extra', bag({ order: 0, group: "prompt", columns: 1, tooltip: "Structured caption:
|
|
10
|
-
lyrics: z.string().description("Lyrics").extra('extra', bag({ order: 1, group: "prompt", tooltip: "
|
|
11
|
-
duration: z.number().description("Duration (s)").min(5).max(360).step(1).default(30).extra('extra', bag({ order: 0, group: "generation", width: 1, tooltip: "
|
|
11
|
+
prompt: z.string().description("Tags / Description").extra('extra', bag({ order: 0, group: "prompt", columns: 1, tooltip: "Structured caption, three sections: Global Metadata (genre, mood, BPM) + Vocal Details (gender, timbre, range) + Arrangement (instruments, structure). Weak one-word captions end the song early — the tail turns to noise. E.g. 'A funk-pop soul track at 105 BPM; male baritone, warm rasp; clean guitar riff, brass stabs, tight pocket drums'.", required: true, wtype: 'textarea', })),
|
|
12
|
+
lyrics: z.string().description("Lyrics").extra('extra', bag({ order: 1, group: "prompt", tooltip: "The song's PLAN — length lives here, not in Duration. Sung words with structure tags ([verse], [chorus]) for a song. Instrumental: sequential section tags only, each on its own line — [intro] / [instrumental] / [solo] / [instrumental] / [outro] — the model grants ~20-40s per block; repeat blocks to reach target length. An EMPTY box (or a lone [instrumental]) plans one ~35s phrase and ends. Keep 'no vocals, no choir, no humming' in the caption so extended blocks stay instrumental.", wtype: 'textarea' })),
|
|
13
|
+
duration: z.number().description("Duration (s)").min(5).max(360).step(1).default(30).extra('extra', bag({ order: 0, group: "generation", width: 1, tooltip: "Audio length CEILING in seconds (5-360) — never a floor: the model ends the song when its plan ends, not when this number arrives. The plan lives in the LYRICS field — sung words for a song, sequential section tags ([intro] / [instrumental] / [solo] blocks, one per line, ~20-40s each) for an instrumental. An empty or single-tag lyrics box plans ONE phrase and wraps ~35s no matter how high this sits. Long track (>2min) + CUDA OOM: state tiled_decode.", wtype: 'slider' })),
|
|
12
14
|
mode: vocabulary(["full", "melody", "off"]).description("ABC Planning").default("full").extra('extra', bag({ order: 1, group: "generation", width: 1, tooltip: "YuE2 only: plan a symbolic score before generating. full = melody + chords; melody = melody only (cover-recommended); off = direct generation.", wtype: 'select', visible_when: 'model=yue2' })),
|
|
13
|
-
guidance_scale: z.number().description("CFG").min(0.1).max(10).step(0.1).default(1.7).extra('extra', bag({ order: 2, group: "generation", width: 1, tooltip: "Classifier-free guidance (KSampler cfg). 1.7 =
|
|
14
|
-
n_diffusion_steps: z.number().description("Diffusion Steps").min(1).max(200).step(1).default(
|
|
15
|
-
lm_cfg_scale: z.number().description("LM CFG").min(0.1).max(10).step(0.1).default(1.7).extra('extra', bag({ order: 4, group: "generation", width: 1, tooltip: "Lyric-encoder guidance (MiniMaxMusic3TextEncode cfg_scale). 1.7 =
|
|
16
|
-
seed: z.number().description("Seed").step(1).default(-1).extra('extra', bag({ order: 0, group:
|
|
15
|
+
guidance_scale: z.number().description("CFG").min(0.1).max(10).step(0.1).default(1.7).extra('extra', bag({ order: 2, group: "generation", width: 1, tooltip: "Classifier-free guidance (KSampler cfg). 1.7 = the default.", visible_when: 'model=music3' })),
|
|
16
|
+
n_diffusion_steps: z.number().description("Diffusion Steps").min(1).max(200).step(1).default(MUSIC3_FULL_STEPS.default).extra('extra', bag({ order: 3, group: "generation", width: 1, tooltip: "Denoising steps. 30 = the default (the full-schedule checkpoint tier's own default — the step↔checkpoint pairing). A distilled checkpoint states its own tier's window. Never 0.", wtype: 'number' })),
|
|
17
|
+
lm_cfg_scale: z.number().description("LM CFG").min(0.1).max(10).step(0.1).default(1.7).extra('extra', bag({ order: 4, group: "generation", width: 1, tooltip: "Lyric-encoder guidance (MiniMaxMusic3TextEncode cfg_scale). 1.7 = the default.", visible_when: 'model=music3' })),
|
|
18
|
+
seed: z.number().description("Seed").step(1).default(-1).extra('extra', bag(seedExtra({ order: 0, group: 'seed', width: 1 }))),
|
|
19
|
+
// THE DECODE TIER KNOB (audit 014 C3): NO .default() — absence is
|
|
20
|
+
// the derivation's seat (the action derives plain/tiled from the
|
|
21
|
+
// lane's own VRAM/size signal; a stamped literal here would be the
|
|
22
|
+
// second default home the cure forbids). Stated, it overrides.
|
|
23
|
+
tiled_decode: z.boolean().description("Tiled VAE Decode").extra('extra', bag({ order: 5, group: "generation", width: 1, tooltip: "Decode the audio latent in segments (lower VRAM, no quality loss at the template's 1536/64 seats). Absent = derived from the checkpoint's own numbers — a low-VRAM checkpoint or a track past 90s tiles; a roomy checkpoint at a short track decodes plain.", visible_when: 'model=music3' })),
|
|
17
24
|
});
|
|
18
|
-
|
|
19
|
-
* registration's schema carrier and the compose strict resolve's
|
|
20
|
-
* judge): schemastery schemas are callable (Schema.resolve) but
|
|
21
|
-
* carry a typed data parameter, while both card-seam consumers
|
|
22
|
-
* take unknown. */
|
|
23
|
-
const schemaFn = schema;
|
|
25
|
+
const schemaFn = callableSchema(schema);
|
|
24
26
|
// THE FAMILY IDS COME FROM THEIR DECLS (the closure gate's RULE 5):
|
|
25
27
|
// a retyped id breaks the card at RUNTIME — not-boarded — with every
|
|
26
28
|
// wall green. image-gen has done it this way all along.
|
|
@@ -94,7 +96,7 @@ export function registerCard(ctx, comfy) {
|
|
|
94
96
|
bound(doc, model, g, runId);
|
|
95
97
|
}
|
|
96
98
|
else {
|
|
97
|
-
throw new Error(`no declared action for family '${String(model.family ?? model.id)}' on the music card — every boarded family (music3, yue2) composes its own declared segment; this address owns none`);
|
|
99
|
+
throw new Error(`no declared action for family '${String(model.family ?? model.id)}' on the music card — every boarded family (music3, yue2) composes its own declared segment; this address owns none. State params.model (one of the boarded families) on the stage to compose it`);
|
|
98
100
|
}
|
|
99
101
|
},
|
|
100
102
|
}));
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EstateCall } from '@melite/estate-call';
|
|
2
|
-
import type { Context } from '@
|
|
2
|
+
import type { Context } from '@melite/comfyui-card-kit/card-definition';
|
|
3
3
|
import Schema from '@deepseek-ai/schemastery';
|
|
4
4
|
export declare const name = "@melite/audio/music";
|
|
5
5
|
export declare const inject: string[];
|
package/lib/index.js
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import Schema from '@deepseek-ai/schemastery';
|
|
2
2
|
import { registerCard } from "./card.js";
|
|
3
|
-
import { buildMusicTool } from "./tool.js";
|
|
4
3
|
export const name = '@melite/audio/music';
|
|
5
4
|
export const inject = [];
|
|
6
5
|
export const Config = Schema.object({
|
|
7
6
|
call: Schema.any(),
|
|
8
7
|
});
|
|
9
8
|
export function apply(ctx, config) {
|
|
9
|
+
void config;
|
|
10
10
|
const comfy = ctx.get('comfyui');
|
|
11
11
|
if (comfy !== undefined)
|
|
12
12
|
registerCard(ctx, comfy);
|
|
13
|
-
const tools = ctx.get('tools');
|
|
14
|
-
if (tools !== undefined) {
|
|
15
|
-
// BARE registration, the tool-bash shape: the entry owns the
|
|
16
|
-
// register call; tool.ts exports the definition builder. The
|
|
17
|
-
// service attaches its own disposer (tutorial ch.2).
|
|
18
|
-
tools.register(buildMusicTool(config.call));
|
|
19
|
-
}
|
|
20
13
|
}
|
|
21
14
|
//# sourceMappingURL=index.js.map
|
package/lib/tool.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCardTool } from '@melite/estate-call/cardTool';
|
|
2
|
-
import { emitParamsSpec } from '@melite/comfyui-
|
|
2
|
+
import { emitParamsSpec } from '@melite/comfyui-card-kit/params-emit';
|
|
3
3
|
import { schema, identity, BOARDED } from "./card.js";
|
|
4
4
|
export const TOOL_NAME = 'music';
|
|
5
5
|
export const buildMusicTool = (call) => defineCardTool(call, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"license": "
|
|
2
|
+
"version": "0.2.0-alpha",
|
|
3
|
+
"license": "AGPL-3.0-or-later",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -18,29 +18,28 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@deepseek-ai/dsh-tools": "0.2.
|
|
22
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
23
|
-
"@melite/comfyui-card-kit": "0.
|
|
24
|
-
"@melite/
|
|
25
|
-
"@melite/
|
|
26
|
-
"@melite/models-music3": "0.
|
|
27
|
-
"@melite/
|
|
28
|
-
"@melite/models-yue2": "0.1.4-alpha"
|
|
21
|
+
"@deepseek-ai/dsh-tools": "0.2.1-rc.2",
|
|
22
|
+
"@deepseek-ai/schemastery": "^3.18.5",
|
|
23
|
+
"@melite/comfyui-card-kit": "0.2.0-alpha",
|
|
24
|
+
"@melite/estate-call": "0.2.0-alpha",
|
|
25
|
+
"@melite/contracts": "0.2.0-alpha",
|
|
26
|
+
"@melite/models-music3": "0.2.0-alpha",
|
|
27
|
+
"@melite/models-yue2": "0.2.0-alpha"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
30
|
"@types/node": "^22.20.0",
|
|
32
31
|
"typescript": "^5.9.3",
|
|
33
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
32
|
+
"@deepseek-ai/cordis": "^4.0.5"
|
|
34
33
|
},
|
|
35
34
|
"name": "@melite/audio-music",
|
|
36
|
-
"description": "the music card (the audio lane) — one card one package: card.ts host face +
|
|
35
|
+
"description": "the music card (the audio lane) — one card one package: card.ts host face + tool.ts flow face + agents/ context (no ui/ — the view is constructed by @melite/card-base from the emission)",
|
|
37
36
|
"files": [
|
|
38
37
|
"lib/index.js",
|
|
39
38
|
"lib/**/*.js",
|
|
40
39
|
"lib/**/*.d.ts"
|
|
41
40
|
],
|
|
42
41
|
"peerDependencies": {
|
|
43
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
42
|
+
"@deepseek-ai/cordis": "^4.0.5"
|
|
44
43
|
},
|
|
45
44
|
"scripts": {
|
|
46
45
|
"build": "tsc -p tsconfig.build.json",
|