MusicGen
Text-to-music that plays nice with your actual workflow
- audio
You type "melancholy synthwave, slow tempo, tape hiss" and out comes an actual music clip, generated locally, no API key, no cloud account. That's Meta's MusicGen, and this node is the cleanest way to run it inside ComfyUI. It's a fork of the MusicGen node from comfyui-sound-lab with one meaningful fix: it outputs ComfyUI's standard AUDIO format instead of a raw numpy array. That sounds like an implementation detail until you realize it's the difference between a dead end and a pipeline - the audio output plugs straight into core nodes like PreviewAudio, SaveAudio, and VAEDecodeAudio, so a generated score can drive an audio-conditioned video workflow instead of living in a sidecar file.
The name "MusicGen" covers six models behind one dropdown. The originals (small, medium, large) are the most battle-tested, then there's a stereo trio (stereo-small, stereo-medium, stereo-large) if you want spatial audio for video. small is 300M parameters, fast, and honestly fine for testing and backing tracks; large is 3.3B and clearly better but eats VRAM and time. The author's own tooltip is blunt about it: small is "most reliable," large is "highest quality."
How it works
The node loads the model through Hugging Face's transformers library (MusicgenForConditionalGeneration). First run downloads whatever model you picked into ComfyUI/models/musicgen/<model_name> - it checks the cache, copies from the HF cache if present, and falls back to a direct download (with an hf-mirror.com fallback for users in regions where the main endpoint is slow). Generation is straightforward: your prompt gets tokenized, the model samples audio tokens at roughly 50 tokens per second, and the requested seconds gets converted into a token budget. It seeds torch, numpy, and random so you can reproduce a take.
A few honest caveats before you commit: large at 30 seconds is roughly 12GB VRAM territory on a 3060-class card, so if you're on 8GB, treat large as a "let it swap" experiment. Also, the model moves to GPU for generation and back to CPU afterward - if you have multiple ComfyUI sessions running, they'll fight over the same weights.
The inputs that matter
- model - the six-way dropdown above. Start with
small. - prompt - plain English descriptions of genre, mood, tempo, instrumentation. "Epic orchestral trailer music" works shockingly well.
- seconds - 1 to 1000, default 5. Long generations are slow, not just big; keep it short while tuning.
- guidance_scale - 0–20, default 4. How tightly the output follows the prompt. Higher is more literal but can sound thin.
- seed - set it for reproducibility, or leave 0 and let it roll.
- device -
auto(GPU if available) orcpu. CPU runs, but don't expect real-time.
The only output is audio in the standard AUDIO format - wire it to PreviewAudio or SaveAudio and you're done.
Installing
The node ships in the drmbt/comfyui-dreambait-nodes pack, so install the pack, not this node alone. ComfyUI Manager is easiest: search comfyui-dreambait-nodes and install. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/drmbt/comfyui-dreambait-nodes
# restart ComfyUI
Restart, and the model download happens on first use. That first run will look frozen - a multi-GB download with no progress bar - so give it time.
Common issues
Model download fails or errors out. Delete the folder under ComfyUI/models/musicgen/<model_name> and rerun; the node re-downloads from scratch. The error message itself tells you to do exactly this.
Sounds like garbage on CPU. It works, it's just slow. Pick small if you're CPU-only.
"Failed to download model" with no internet. You can place model files manually in ComfyUI/models/musicgen/<model_name> from a machine that does have access.
One last note: the pack's README mentions melody-conditioned models, but the shipped node only exposes the six models in the dropdown - don't go hunting for a melody option that isn't there.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | small | Available models: Original models (most stable): - small: 300M parameters, fastest, reliable - medium: 1.5B parameters, balanced - large: 3.3B parameters, highest quality Stereo models: - stereo-small/medium/large: For spatial audio generation |
| prompt | STRING | — | |
| seconds | FLOAT | 5.01–1000 | — |
| guidance_scale | FLOAT | 4.000–20 | — |
| seed | INT | 00–2147483647 | — |
| device | COMBO | 2 options: auto, cpu |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |