@melite/models-music3 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: MiniMax Music 3 text-to-music — caption and lyrics conditioning over INT8 ConvRot weights, mp3 output under the run directory.
3
- kind: package-library
4
- ---
5
-
6
1
  # music3
7
2
 
8
3
  music3 registers the MiniMax Music 3 family (form `form_music`, label "MiniMax Music 3", genre `audio`, engine `comfyui`): text-to-music with lyrics. Weights: three INT8 ConvRot provisions from Comfy-Org/MiniMax-Music-3 — the DiT (`minimax_music3_dit_int8_convrot.safetensors`, about 2.5 GB), the pruned text encoder (about 9.2 GB), and the DAV VAE (about 0.22 GB). The `lane_inputs` pin `clip_type: minimax` and the three file names.
package/lib/actions.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import { requireText } from "@melite/comfyui-card-kit/facts";
2
+ import { assertMusic3StepsInTier, music3StepTier } from "./tier.js";
3
+ import { TILED_DECODE_SEATS, deriveDecodeTier } from "./decode.js";
2
4
  /** The compose facts door: the resolved lane_inputs parsed into the
3
5
  * closed shape — a missing weight refuses field-named here, never
4
6
  * composes with an empty filename.
@@ -27,10 +29,43 @@ export const compose = {
27
29
  { name: "lm_cfg_scale", type: "number", bounds: [0.1, 10] },
28
30
  { name: "n_diffusion_steps", type: "number", bounds: [1, 200] },
29
31
  { name: "seed", type: "number", rule: "seed-sentinel" },
32
+ // THE DECODE TIER KNOB (audit 014 C3): NO default row — absence
33
+ // IS the derivation's seat. A stamped literal here would be the
34
+ // second default home the seed cure died killing; the derivation
35
+ // (decode.ts deriveDecodeTier) owns the unstated compose.
36
+ { name: "tiled_decode", type: "boolean" },
30
37
  ],
31
38
  facts: parseMusicFacts,
32
- build({ p, facts, g, runId }) {
39
+ build({ p, facts, model, g, runId }) {
40
+
41
+ // YuE2 ABC-planning vocabulary (card.ts mode tooltip; the YuE2
42
+ // nodes read it) — the MiniMax lane plans no symbolic score and
43
+ // MiniMaxMusic3TextEncode declares no mode input (the engine
44
+ // node's schema: clip, caption, lyrics, seed, max_duration,
45
+
46
+ // every gate and die unread at compose — the silent drop the
47
+ // value arms pre-registered. Refuse loud in the knob's own
48
+ // voice; "full" rides because the card schema's walk fills it as
49
+ // the stated default (the stated default IS the unstated
50
+ // compose), and an absent mode (direct action callers) rides.
51
+ const mode = p.mode;
52
+ if (mode !== undefined && mode !== "full") {
53
+ throw new Error(`music3 compose: mode '${String(mode)}' fires nothing on this lane — ` +
54
+ "mode is the YuE2 ABC-planning vocabulary (full/melody drive YuE2's symbolic score); " +
55
+ "the MiniMax lane's engine node reads caption+lyrics only, no mode input. " +
56
+ "Drop mode, or switch lane (model=yue2) to plan a score");
57
+ }
33
58
  const seed = p.seed;
59
+ // THE STEP↔CHECKPOINT TIER (audit 014 C4): the steps and the
60
+ // checkpoint share ONE derivation — the resolved unet derives the
61
+ // tier, a stated steps must sit inside its domain (outside
62
+ // refuses loud, naming the pairing), and an unstated steps rides
63
+ // the tier's own default. The card schema's served default is the
64
+ // full tier's default (one home, tier.ts).
65
+ const statedSteps = p.n_diffusion_steps;
66
+ const steps = typeof statedSteps === "number"
67
+ ? (assertMusic3StepsInTier(facts.unet, statedSteps), statedSteps)
68
+ : music3StepTier(facts.unet).default;
34
69
  const unet = g.node("UNETLoader", { unet_name: facts.unet, weight_dtype: "default" }).out();
35
70
  const clip = g.node("CLIPLoader", { clip_name: facts.text_encoder, model_options: "default", type: facts.clip_type }).out();
36
71
  const vae = g.node("VAELoader", { vae_name: facts.vae }).out();
@@ -44,10 +79,17 @@ export const compose = {
44
79
  top_k: 50,
45
80
  });
46
81
  const zeroed = g.node("ConditioningZeroOut", { conditioning: cond.out(0) });
47
- const latent = g.node("EmptyMiniMaxMusic3LatentAudio", { batch_size: 1, seconds: p.duration });
82
+ // The latent's length is DERIVED from the AR, never addressed twice: slot 1
83
+ // of MiniMaxMusic3TextEncode is the realized AR length in seconds, and the
84
+ // official template wires exactly this link. Stamping the duration literal
85
+ // here lets the seats diverge when the AR ends the song early — the DiT
86
+ // zero-pads the conditioning (dit.py:197-198) and the latent tail generates
87
+ // unconditioned noise (audit 014, D1). max_duration above is the user's
88
+ // only duration seat.
89
+ const latent = g.node("EmptyMiniMaxMusic3LatentAudio", { batch_size: 1, seconds: cond.out(1) });
48
90
  const sampled = g.node("KSampler", {
49
91
  seed,
50
- steps: p.n_diffusion_steps,
92
+ steps,
51
93
  cfg: p.guidance_scale,
52
94
  sampler_name: "euler",
53
95
  scheduler: "simple",
@@ -57,8 +99,48 @@ export const compose = {
57
99
  positive: cond.out(0),
58
100
  negative: zeroed.out(),
59
101
  });
60
- const audio = g.node("VAEDecodeAudio", { samples: sampled.out(), vae });
102
+ // THE VRAM-AWARE DECODE TIER (audit 014 C3): the strategy derives
103
+ // from the lane's own signal — the resolved variant cell's
104
+ // DECL-declared vram_peak_gb (the resolver's coordinate law: the
105
+ // address's own cell claim, else the matrix's default cell) and
106
+ // the track's duration cap. A stated knob overrides; absent, the
107
+ // derivation decides. The tiled seats are the template's own
108
+ // (1536/64).
109
+ const decodeTier = p.tiled_decode === undefined
110
+ ? deriveDecodeTier(resolvedCellVramPeakGb(model), typeof p.duration === "number" ? p.duration : 0)
111
+ : p.tiled_decode
112
+ ? "tiled"
113
+ : "plain";
114
+ const audio = decodeTier === "tiled"
115
+ ? g.node("VAEDecodeAudioTiled", { samples: sampled.out(), vae, ...TILED_DECODE_SEATS })
116
+ : g.node("VAEDecodeAudio", { samples: sampled.out(), vae });
61
117
  return g.node("SaveAudioAdvanced", { audio: audio.out(), filename_prefix: `${runId}/music`, format: "mp3", "format.quality": "V0" }).out();
62
118
  },
63
119
  };
120
+ /** The resolved variant cell's DECL-declared VRAM peak — the mirror
121
+ * of the resolver's own coordinate law (resolveCellRow: the
122
+ * address's own cell claim wins, else the first offered cell of the
123
+ * first offered Variant row). Reads the facts row the action build
124
+ * receives; a matrix-less facts row (hand fixtures) reads null —
125
+ * unmeasured, never called low-VRAM.
126
+ * @param model the resolved model facts row (id, family, variants)
127
+ * @returns the resolved cell's declared peak, or null */
128
+ function resolvedCellVramPeakGb(model) {
129
+ const rows = model.variants ?? [];
130
+ const address = model.id;
131
+ for (const v of rows) {
132
+ for (const c of v.cells ?? []) {
133
+ if (c.route === address)
134
+ return c.vram_peak_gb;
135
+ }
136
+ }
137
+ for (const v of rows) {
138
+ if (v.group !== "Variant" || v.hide_from_dropdown === true)
139
+ continue;
140
+ const cell = (v.cells ?? []).find((c) => c.hide_from_dropdown !== true);
141
+ if (cell !== undefined)
142
+ return cell.vram_peak_gb;
143
+ }
144
+ return null;
145
+ }
64
146
  //# sourceMappingURL=actions.js.map
@@ -0,0 +1,28 @@
1
+ /** The VRAM floor under which a cell's declared peak tiles the
2
+ * decode. The audit's box cut: a lane whose DECL-declared peak sits
3
+ * at or above the floor decodes plain. */
4
+ export declare const TILED_VRAM_FLOOR_GB = 16;
5
+ /** The track length past which the decode tiles regardless of the
6
+ * declared peak — VAE decode memory scales with the latent's
7
+ * length, and the AR's duration cap is the compose-time size
8
+ * signal (the realized length is the AR's own output, unknowable
9
+ * here). */
10
+ export declare const TILED_DURATION_CEIL_S = 90;
11
+ /** The closed decode vocabulary. */
12
+ export type DecodeTier = "plain" | "tiled";
13
+ /** Derive the decode tier from the lane's VRAM/size signal.
14
+ * @param vramPeakGb the resolved cell's DECL-declared peak (null =
15
+ * unmeasured — an unmeasured body is never called low-VRAM; the
16
+ * audition-gated peak class, ROADMAP)
17
+ * @param seconds the track's duration cap (the size signal)
18
+ * @returns "tiled" past the size ceiling or under the VRAM floor,
19
+ * "plain" otherwise */
20
+ export declare function deriveDecodeTier(vramPeakGb: number | null, seconds: number): DecodeTier;
21
+ /** The tiled decode's segment seats, verbatim from the official
22
+ * template's VAEDecodeAudioTiled (tile 1536, overlap 64 — inside
23
+ * the engine's declared [32, 8192]/[0, 1024] bounds). */
24
+ export declare const TILED_DECODE_SEATS: {
25
+ readonly tile_size: 1536;
26
+ readonly overlap: 64;
27
+ };
28
+ //# sourceMappingURL=decode.d.ts.map
package/lib/decode.js ADDED
@@ -0,0 +1,41 @@
1
+ // decode.ts — THE VRAM-AWARE DECODE TIER (audit 014 C3): the audio
2
+ // decode strategy derives from the lane's own VRAM/size signal, never
3
+ // a fixed literal. The official template composes tiled decode with
4
+ // a hardcoded true; its own model note seats int8_convrot as the
5
+ // low-VRAM body — the quality-correct choice on a roomy box is the
6
+ // plain decode, and the tier flips on the DECL's own numbers: a
7
+ // low-VRAM cell (its declared vram_peak_gb under the floor) or a
8
+ // long track (the AR's duration cap past the ceiling) tiles; a
9
+ // measured-roomy cell at a short track decodes plain. An explicitly
10
+ // stated knob overrides the derivation at the action (the flip needs
11
+ // no re-compose of the lane); absent, the derivation decides — the
12
+ // default lives HERE, once, never a second stamped literal.
13
+ /** The VRAM floor under which a cell's declared peak tiles the
14
+ * decode. The audit's box cut: a lane whose DECL-declared peak sits
15
+ * at or above the floor decodes plain. */
16
+ export const TILED_VRAM_FLOOR_GB = 16;
17
+ /** The track length past which the decode tiles regardless of the
18
+ * declared peak — VAE decode memory scales with the latent's
19
+ * length, and the AR's duration cap is the compose-time size
20
+ * signal (the realized length is the AR's own output, unknowable
21
+ * here). */
22
+ export const TILED_DURATION_CEIL_S = 90;
23
+ /** Derive the decode tier from the lane's VRAM/size signal.
24
+ * @param vramPeakGb the resolved cell's DECL-declared peak (null =
25
+ * unmeasured — an unmeasured body is never called low-VRAM; the
26
+ * audition-gated peak class, ROADMAP)
27
+ * @param seconds the track's duration cap (the size signal)
28
+ * @returns "tiled" past the size ceiling or under the VRAM floor,
29
+ * "plain" otherwise */
30
+ export function deriveDecodeTier(vramPeakGb, seconds) {
31
+ if (typeof seconds === "number" && seconds > TILED_DURATION_CEIL_S)
32
+ return "tiled";
33
+ if (typeof vramPeakGb === "number" && vramPeakGb < TILED_VRAM_FLOOR_GB)
34
+ return "tiled";
35
+ return "plain";
36
+ }
37
+ /** The tiled decode's segment seats, verbatim from the official
38
+ * template's VAEDecodeAudioTiled (tile 1536, overlap 64 — inside
39
+ * the engine's declared [32, 8192]/[0, 1024] bounds). */
40
+ export const TILED_DECODE_SEATS = { tile_size: 1536, overlap: 64 };
41
+ //# sourceMappingURL=decode.js.map
package/lib/index.d.ts CHANGED
@@ -3,5 +3,7 @@ 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, parseMusicFacts, type MusicFacts, type MusicParams } from "./actions.js";
6
+ export { MUSIC3_DISTILLED_STEPS, MUSIC3_FULL_STEPS, assertMusic3StepsInTier, music3StepTier, music3StepsEnvelope, type Music3StepTier, type Music3TierSteps, } from "./tier.js";
7
+ export { TILED_DURATION_CEIL_S, TILED_VRAM_FLOOR_GB, deriveDecodeTier, type DecodeTier } from "./decode.js";
6
8
  export { family as default };
7
9
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,4 +1,8 @@
1
1
  import { compose } from "./actions.js";
2
+ // THE STEP↔CHECKPOINT TIER (audit 014 C4): the row's sampler stamps
3
+ // derive from the SAME module the compose action judges — one tier
4
+ // derivation, never two homes.
5
+ import { MUSIC3_FULL_STEPS, music3StepsEnvelope } from "./tier.js";
2
6
  export const DECL = {
3
7
  "id": "music3",
4
8
  "form": "form_music",
@@ -11,26 +15,64 @@ export const DECL = {
11
15
  "note": ""
12
16
  },
13
17
  "genre": "audio",
18
+
19
+ // user-provided seats (prompt, lyrics) — the compose caller
20
+ // provides them. No variant-class rows: this family's served
21
+ // face exposes no steps+cfg pair (the census's surface-derived
22
+ // carve).
23
+ "required_defaults": [
24
+ { "name": "prompt", "class": "user" },
25
+ { "name": "lyrics", "class": "user" }
26
+ ],
14
27
  "variants": [
15
28
  {
16
29
  "id": "standard",
17
30
  "label": "Standard",
18
31
  "group": "Variant",
19
32
  "route": "music3",
33
+ // THE STEP↔CHECKPOINT TIER (audit 014 C4): the row's stamps ARE
34
+ // the tier derivation — the standard row's cells are full-
35
+ // schedule bodies, so the envelope and the resolver default
36
+ // spread from MUSIC3_FULL_STEPS. A distilled row lands its OWN
37
+ // tier stamps (MUSIC3_DISTILLED_STEPS) or the step-tier wall
38
+ // reds the divergent pairing.
39
+ "sampler_envelope": music3StepsEnvelope(MUSIC3_FULL_STEPS, [0.1, 10]),
40
+ // THE ACTION'S OWN SPELLING (the declared-plane door): this
41
+ // family's action param is n_diffusion_steps (the card schema's
42
+ // field) — the stamp seeds the compose body by this name.
43
+ "resolver_defaults": { "n_diffusion_steps": MUSIC3_FULL_STEPS.default },
20
44
  "cells": [
21
45
  {
22
-
23
- // Comfy-Org safetensors the provisions rows carry, never a
24
- // GGUF tree.
25
- "quant": "int8",
26
- "label": "INT8 ConvRot",
46
+ // THE QUANT-AXIS LAW (E2-4): the first declared cell is the
47
+ // variant default — the fp16 body the official template
48
+ // composes (audit 014 C5: int8 was the only row, and the
49
+ // template labels it "# For low VRAM"). The fp16 cell rides
50
+ // the family lane_inputs below — the atom IS this tier's
51
+ // load, so the cell carries no lane stamps of its own.
52
+ "quant": "fp16",
53
+ "label": "FP16",
27
54
  "route": "music3",
55
+ },
56
+ {
57
+ // The low-VRAM body (the template's own note): an explicit
58
+ // cell whose OWN route re-keys the address view so the
59
+ // cell-lane cascade folds this unet at read (comfyui-cordis
60
+ // service.ts getModel) — a stated int8 pick loads the int8
61
+ // file, never the atom's. Its vram_peak_gb is the DECL's own
62
+ // auditioned number and feeds the decode-tier derivation
63
+ // (actions.ts deriveDecodeTier).
64
+ "quant": "int8_convrot",
65
+ "label": "INT8 ConvRot",
66
+ "route": "music3-int8",
67
+ "lane_inputs": {
68
+ "unet": "minimax_music3_dit_int8_convrot.safetensors",
69
+ },
28
70
  "vram_peak_gb": 20,
29
71
  }
30
72
  ]
31
73
  },
32
74
  {
33
- "id": "short_sting",
75
+ "id": "short-sting",
34
76
  "label": "Short Sting",
35
77
  "hint": "Duration 5s — the card schema's own floor (a sting or loop).",
36
78
  "group": "Recipe",
@@ -38,7 +80,7 @@ export const DECL = {
38
80
  "cells": [],
39
81
  },
40
82
  {
41
- "id": "full_length",
83
+ "id": "full-length",
42
84
  "label": "Full Length",
43
85
  "hint": "Duration 360s — the card schema's own ceiling (full-song length).",
44
86
  "group": "Recipe",
@@ -70,16 +112,34 @@ export const DECL = {
70
112
  }
71
113
  ],
72
114
  "has_inference": true,
115
+ // THE LANE TRUTH (audit 014 C5): the atom's unet is the fp16 body
116
+ // the official template composes — the family's default address
117
+ // serves the template's own weights. The int8_convrot file moved to
118
+ // its cell above (the low-VRAM pick owns its load); both bodies'
119
+ // downloads ride the provisions rows (the audio families' shape —
120
+ // no cell sources).
73
121
  "lane_inputs": {
74
122
  "clip_type": "minimax",
75
123
  "text_encoder": "minimax_music3_text_encoder_pruned_int8_convrot.safetensors",
76
- "unet": "minimax_music3_dit_int8_convrot.safetensors",
124
+ "unet": "minimax_music3_dit_fp16.safetensors",
77
125
  "vae": "minimax_music3_dav.safetensors"
78
126
  },
79
127
 
80
128
  // three weights, provisioned from Comfy-Org's official Music-3 repo.
81
129
  "provisions": [
82
130
  {
131
+ // THE TEMPLATE'S BODY (audit 014 C5): the fp16 DiT the official
132
+ // template composes by default; digests are upstream's own HF
133
+
134
+ "name": "minimax_music3_dit_fp16.safetensors",
135
+ "url": "https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/diffusion_models/minimax_music3_dit_fp16.safetensors",
136
+ "folder": "diffusion_models",
137
+ "sha256": "45494a2b6b69af115902ff28eaf54118d19067aa54da01000f3e3efce7ba0e34",
138
+ "size_bytes": 4914197682
139
+ },
140
+ {
141
+ // The template's low-VRAM body ("# For low VRAM", the note
142
+ // verbatim) — the int8 cell's load.
83
143
  "name": "minimax_music3_dit_int8_convrot.safetensors",
84
144
  "url": "https://huggingface.co/Comfy-Org/MiniMax-Music-3/resolve/main/diffusion_models/minimax_music3_dit_int8_convrot.safetensors",
85
145
  "folder": "diffusion_models",
@@ -118,11 +178,20 @@ export const DECL = {
118
178
  },
119
179
  ],
120
180
  },
121
- // THE LANE SURFACE (the z-image precedent): exactly the knobs the
122
- // music card serves.
181
+ // THE LANE SURFACE (the z-image precedent): exactly the knobs this
182
+
183
+ // cure): mode is the YuE2 ABC-planning vocabulary — this lane's
184
+ // engine node declares no mode input — so the DECL stops serving
185
+ // it and the write doors refuse a stated mode in the field's
186
+ // voice; the compose action refuses what a legacy draft still
187
+ // carries (actions.ts build).
123
188
  "params": [
124
- "prompt", "lyrics", "duration", "mode",
189
+ "prompt", "lyrics", "duration",
125
190
  "guidance_scale", "n_diffusion_steps", "lm_cfg_scale", "seed",
191
+ // THE DECODE TIER KNOB (audit 014 C3): stated, it overrides the
192
+ // VRAM/size derivation; absent, the derivation decides (the
193
+ // compose action owns the default — no second literal home).
194
+ "tiled_decode",
126
195
  ],
127
196
  // THE DECLARED ACTIONS (the atom vocabulary, stroke 3):
128
197
  // the compose action the music card binds (the MiniMax Music 3 lane).
@@ -137,6 +206,8 @@ export const family = {
137
206
  },
138
207
  };
139
208
  export { compose, parseMusicFacts } from "./actions.js";
209
+ export { MUSIC3_DISTILLED_STEPS, MUSIC3_FULL_STEPS, assertMusic3StepsInTier, music3StepTier, music3StepsEnvelope, } from "./tier.js";
210
+ export { TILED_DURATION_CEIL_S, TILED_VRAM_FLOOR_GB, deriveDecodeTier } from "./decode.js";
140
211
  // The Loader-row face: DSH loads plugin rows by bare specifier and
141
212
  // unwraps `exports.default ?? exports` (vendor/cordis_plugins/loader
142
213
  // unwrapExports) — the default export IS the row-loadable plugin. The
package/lib/tier.d.ts ADDED
@@ -0,0 +1,51 @@
1
+ /** The closed tier vocabulary: full-schedule vs distilled. */
2
+ export type Music3StepTier = "full" | "distilled";
3
+ /** The steps a tier's checkpoint samples: the closed domain and the
4
+ * default the derivation stamps when the caller states nothing. */
5
+ export interface Music3TierSteps {
6
+ readonly tier: Music3StepTier;
7
+ /** The domain's floor — a full body refuses below it. */
8
+ readonly min: number;
9
+ /** The domain's ceiling. */
10
+ readonly max: number;
11
+ /** The tier's default (the unstated compose). */
12
+ readonly default: number;
13
+ }
14
+ /** The full-schedule tier: the official template's marriage — 30
15
+ * steps on the fp16/int8_convrot bodies. The card schema's served
16
+ * default derives from here (one home; the shared face may not
17
+ * drift from the derivation). */
18
+ export declare const MUSIC3_FULL_STEPS: Music3TierSteps;
19
+ /** The distilled tier: the turbo/lightning window (the qwen-img-21
20
+ * turbo row's own [4, 8] and krea's distilled convention, widened
21
+ * to the music family's 8–12 the audit names). A distilled variant
22
+ * row is the only door below 30 — and it MUST stamp this tier (the
23
+ * step-tier wall derives the roster and judges the stamps). */
24
+ export declare const MUSIC3_DISTILLED_STEPS: Music3TierSteps;
25
+ /** Derive the steps tier from the checkpoint a lane loads.
26
+ * @param unet the resolved lane_inputs.unet (the diffusion body's
27
+ * filename — the tier IS the body)
28
+ * @returns the tier's closed steps domain + default */
29
+ export declare function music3StepTier(unet: string): Music3TierSteps;
30
+ /** The tier's sampler-envelope spelling (the DECL row's stamp shape
31
+ * — the closed bounds the door's marriage judge reads). The steps
32
+ * span IS the tier; the cfg span is the family's own guidance
33
+ * domain, passed beside the call (the envelope schema requires both
34
+ * seats — the guidance mode is the family's, not the tier's).
35
+ * @param tier the derived tier whose steps span stamps
36
+ * @param cfg the family's guidance domain (the DECL's card bounds)
37
+ * @returns the envelope row the DECL stamps */
38
+ export declare function music3StepsEnvelope(tier: Music3TierSteps, cfg: readonly [number, number]): {
39
+ steps: [number, number];
40
+ cfg: [number, number];
41
+ };
42
+ /** The compose-side pairing judge: a stated steps rides only inside
43
+ * its checkpoint's tier domain.
44
+ * @param unet the resolved lane_inputs.unet
45
+ * @param steps the stated steps (the caller's word)
46
+ * @returns the tier the pairing resolved to (the caller stamps
47
+ * nothing — the value rode verbatim)
48
+ * @throws naming the checkpoint, the tier, and the domain when the
49
+ * stated steps is outside it (the divergent-stamp refusal) */
50
+ export declare function assertMusic3StepsInTier(unet: string, steps: number): Music3TierSteps;
51
+ //# sourceMappingURL=tier.d.ts.map
package/lib/tier.js ADDED
@@ -0,0 +1,74 @@
1
+ // tier.ts — THE STEP↔CHECKPOINT TIER (audit 014 C4): the checkpoint
2
+ // a lane loads and the steps it samples share ONE derivation. The
3
+ // official Music-3 checkpoints are full-schedule bodies (fp16 is the
4
+ // template's default; int8_convrot is its "For low VRAM" twin) and
5
+ // sample the template's 30 steps; a distilled body (turbo / lightning
6
+ // / distill marks in the filename) is the ONLY tier allowed below —
7
+ // upstream's distilled convention is the 8–12 window. The DECL's
8
+ // variant stamps (sampler_envelope + resolver_defaults on
9
+ // index.ts's standard row) spread FROM this module, and the compose
10
+ // action refuses a stated steps outside the resolved checkpoint's
11
+ // domain — a divergent hand stamp (or a distilled row landing
12
+ // without its bound) reds the wall, never composes.
13
+ /** The full-schedule tier: the official template's marriage — 30
14
+ * steps on the fp16/int8_convrot bodies. The card schema's served
15
+ * default derives from here (one home; the shared face may not
16
+ * drift from the derivation). */
17
+ export const MUSIC3_FULL_STEPS = {
18
+ tier: "full",
19
+ min: 30,
20
+ max: 200,
21
+ default: 30,
22
+ };
23
+ /** The distilled tier: the turbo/lightning window (the qwen-img-21
24
+ * turbo row's own [4, 8] and krea's distilled convention, widened
25
+ * to the music family's 8–12 the audit names). A distilled variant
26
+ * row is the only door below 30 — and it MUST stamp this tier (the
27
+ * step-tier wall derives the roster and judges the stamps). */
28
+ export const MUSIC3_DISTILLED_STEPS = {
29
+ tier: "distilled",
30
+ min: 8,
31
+ max: 12,
32
+ default: 10,
33
+ };
34
+ /** The distilled filename marks, spelling-agnostic: the same
35
+ * grammar quant-encoding-truth's impliedQuant uses (separators
36
+ * stripped, case-folded). */
37
+ const DISTILLED_MARK = /turbo|lightning|distill/i;
38
+ /** Derive the steps tier from the checkpoint a lane loads.
39
+ * @param unet the resolved lane_inputs.unet (the diffusion body's
40
+ * filename — the tier IS the body)
41
+ * @returns the tier's closed steps domain + default */
42
+ export function music3StepTier(unet) {
43
+ return DISTILLED_MARK.test(unet) ? MUSIC3_DISTILLED_STEPS : MUSIC3_FULL_STEPS;
44
+ }
45
+ /** The tier's sampler-envelope spelling (the DECL row's stamp shape
46
+ * — the closed bounds the door's marriage judge reads). The steps
47
+ * span IS the tier; the cfg span is the family's own guidance
48
+ * domain, passed beside the call (the envelope schema requires both
49
+ * seats — the guidance mode is the family's, not the tier's).
50
+ * @param tier the derived tier whose steps span stamps
51
+ * @param cfg the family's guidance domain (the DECL's card bounds)
52
+ * @returns the envelope row the DECL stamps */
53
+ export function music3StepsEnvelope(tier, cfg) {
54
+ return { steps: [tier.min, tier.max], cfg: [cfg[0], cfg[1]] };
55
+ }
56
+ /** The compose-side pairing judge: a stated steps rides only inside
57
+ * its checkpoint's tier domain.
58
+ * @param unet the resolved lane_inputs.unet
59
+ * @param steps the stated steps (the caller's word)
60
+ * @returns the tier the pairing resolved to (the caller stamps
61
+ * nothing — the value rode verbatim)
62
+ * @throws naming the checkpoint, the tier, and the domain when the
63
+ * stated steps is outside it (the divergent-stamp refusal) */
64
+ export function assertMusic3StepsInTier(unet, steps) {
65
+ const tier = music3StepTier(unet);
66
+ if (typeof steps !== "number" || !Number.isInteger(steps) || steps < tier.min || steps > tier.max) {
67
+ throw new Error(`music3 compose: n_diffusion_steps ${String(steps)} is outside the ${tier.tier} tier's ` +
68
+ `[${String(tier.min)}, ${String(tier.max)}] window for checkpoint '${unet}' ` +
69
+ `(the step↔checkpoint pairing — a full-schedule body samples ${String(tier.default)} steps; ` +
70
+ "only a distilled checkpoint (turbo/lightning/distill) may sample below, and it must stamp its own tier)");
71
+ }
72
+ return tier;
73
+ }
74
+ //# sourceMappingURL=tier.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@melite/models-music3",
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": "MiniMax Music 3 text-to-music — caption and lyrics conditioning over INT8 ConvRot weights, mp3 output under the run directory.",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/JayDataEngineer/melite.git",
28
+ "directory": "packages/models/music3"
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
  }