Nodes/ComfyUI Smart Model Loader/Text Encode MiniMax Music 3
ComfyUI Node

Text Encode MiniMax Music 3

MiniMax Music 3 Text Encode

By r-vage·Created 2 months ago·Updated 15 days ago· 5
Text Encode MiniMax Music 3
  • clip
  • CONDITIONING
  • seconds
◄song_json—►
◄seed0►
◄max_duration120.00►
◄cfg_scale1.5►
◄top_k50►

Music generation in ComfyUI used to mean ACE-Step and a shrug - still the one to reach for if you want instrumentals on a 4GB card. MiniMax Music 3 is the newer arrival, and ComfyUI now ships native support for it: an encoder, an empty latent, a diffusion model that lands as audio. What core doesn't give you is a tidy way to hand the model the one thing it wants - a structured caption and a lyric sheet, kept apart.

That's this node. Text Encode MiniMax Music 3 [Smart Model Loader] takes one multiline JSON string, {"caption": "...", "lyrics": "..."}, validates it, and passes it to the native encoder. The alternative is two boxes where the caption has a required internal shape that nothing checks until the model quietly produces mush.

What it actually does

The class is thin on purpose: it parses your JSON, then calls ComfyUI's own MiniMaxMusic3TextEncode with the split values. The import is lazy, which matters below.

The Music 3 text encoder isn't a CLIP-style tower. It loads through a CLIP loader with type minimax, and what it produces is an auto-regressive acoustic conditioning sequence. Your caption and lyrics get assembled into a token prompt with special markers, and seed, cfg_scale and top_k ride along as sampling controls for that sequence generator. So cfg_scale here is not your KSampler CFG - it's guidance for generating audio codes, default 1.5, and top_k is the same story.

Then the length contract: the conditioning has a token count, that count maps to audio frames at 25 per second, and that's how the node derives its second output, seconds.

The inputs and outputs that matter

  • clip - the Music 3 text encoder, from a CLIP loader with the minimax type. Nothing encodes without it.
  • song_json - multiline JSON with exactly two string fields, caption and lyrics. Duplicates and extra fields are rejected. The caption must open with Global Metadata: and then carry Vocal Details: and Arrangement: on their own lines, in that order. Lyrics hold sung text and [section] tags; an empty lyrics string asks for an instrumental. A JSON code fence around it is tolerated, so chat-model pastes usually work.
  • max_duration - default 120 seconds, ceiling 360. Per the author's tooltip it's a maximum: "the model can end the song earlier." Don't read it as "give me three minutes."

seed has a control_after_generate widget, so you can fix or randomize takes the usual way. cfg_scale and top_k are marked advanced; leave them until you have a reason.

Out the other side: CONDITIONING to the positive input of your KSampler, and seconds into Empty MiniMax Music3 Latent Audio - do that instead of typing a duration, since the latent and conditioning have to agree and the node hands you the right number. Then KSampler → VAE Decode Audio (Music 3 audio VAE) → Save Audio.

Installing it

The pack is ComfyUI_SmartModelLoader by r-vage - sixteen pipe-first nodes where one PIPE wire carries model, CLIP, VAE, latent and sampler settings. This one doesn't touch the pipe; it's a small utility in the same box. Search ComfyUI Smart Model Loader in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_SmartModelLoader.git
cd ComfyUI_SmartModelLoader
python -m pip install -r requirements.txt

That requirements file is heavier than this node deserves: torch, safetensors (pinned <0.9), huggingface_hub (<2), gguf, aiohttp, tqdm, einops - all for the pack's loaders and Download Manager. Nunchaku and GGUF want their own packages; neither touches this node.

What this node does need is a ComfyUI recent enough to include native MiniMax Music 3 support, since the pack wraps the built-in encoder rather than bundling one. You also need the Music 3 text encoder, diffusion model and audio VAE on disk; none ship with the pack.

Where people get burned

"MiniMax Music 3 encoding requires ComfyUI with MiniMaxMusic3TextEncode support. Update ComfyUI." That's the pack's error and it means what it says. Node registration still works without it, so the pack looks fine right up until you hit Queue.

A validation error that says nothing about your text. By design - the parser won't echo your caption or lyrics back, because errors end up in logs and screenshots. Usual causes, in order: headings missing or out of order, more or fewer than caption and lyrics, a field that isn't a string, a duplicate key, or a blank caption. Headings must start the line literally too, so # Global Metadata: is a failure, not a heading - and the native cleaner strips markdown downstream anyway.

Losing a good take. The seed drives the acoustic sequence generator, not diffusion noise, so set control_after_generate to fixed before you regenerate a take you want to keep. The usual ComfyUI seed trap, one node further upstream than expected.

And if you'd rather skip the pack for this job, the native encoder takes caption and lyrics as separate boxes - the pack's value is the single validated string.

Category🌒 Smart Model Loader/ Conditioning

Inputs (6)

NameTypeDefaultDescription
clipCLIP—
song_jsonSTRING—
seedINT00–18446744073709550000—
max_durationFLOAT120.000.04–360Maximum duration in seconds; the model can end the song earlier.
cfg_scaleFLOAT1.50–100—
top_kINT501–16384—

Outputs (2)

NameTypeDescription
CONDITIONINGCONDITIONING—
secondsFLOAT—