InspireMusic Text-to-Music Generator
Write actual minutes of music on your GPU — Alibaba's InspireMusic, no API
- audio_prompt
- generated_audio
You're used to ComfyUI making pictures. This node makes the thing you'd put on top of those pictures: minutes of actual music, generated locally from a text prompt, no API key, no Suno subscription. It's a wrapper around Alibaba's InspireMusic model - the same "open weights from Alibaba" tradition that brought you Wan and Qwen - and the hook is long-form. Most local music models cough out a 10-second jingle; this one happily writes a 120-second track with actual structure, which is the difference between a draft and something you'd put under a video.
It's called InspireMusic Text-to-Music Generator, and it shows up under the audio/generation category in the node menu. Don't expect polish - this is a community wrapper, not an official ComfyUI node - but the model underneath is the real thing (Alibaba FunAudioLLM's InspireMusic, arXiv 2503.00084), and it's Apache-licensed open weights running entirely on your machine.
How it actually works
Under the hood the node does what the upstream InspireMusic CLI does: your text prompt goes through the model's flow-matching backbone, and a WavTokenizer/HiFiGAN stage turns the tokens into audio. On first generation it loads the model from ComfyUI/models/InspireMusic/, runs inference, then hands you a ComfyUI AUDIO tensor that you can wire straight into an audio preview, a VHS save, or a video's audio input. The pack keeps a model manager and audio utilities in modules/ so node state persists between runs - the first generate is slow (model load), subsequent ones are just inference.
The genuinely interesting input here is chorus_mode. Upstream InspireMusic treats structure as a first-class thing, and this node exposes it as a dropdown: intro, verse, chorus, outro, random, or default. Want a big-band outro? Set outro and describe it. That's the model's superpower - it knows song anatomy, not just "make music."
The inputs that matter
Beginners should touch exactly these and leave the rest alone:
text_prompt- your description, and it earns its keep. "Upbeat electronic dance music with heavy bass and energetic synthesizer melodies" gets you exactly that. The upstream project supports a structured format -<|30.0|><|verse|><|...description...|><|60.0|>- if you want to place a section at a specific timestamp; the node passes the raw string through, so it works here too.duration- 5 to 120 seconds, default 30. This is the biggest lever on both output and VRAM.model_name- defaults toInspireMusic-1.5B-Long. The-24kHzvariants are mono and noticeably cheaper on memory; use them if the 48kHz models OOM.fast_mode- the README's answer to slow or OOM runs. It trades quality for speed, and it's the first thing to flip when a 1.5B model won't fit.chorus_modeandfade_out- structure and clean endings, respectively.trim_silencecleans up dead air at the start and end (off by default; some generations start soft, so try it on).
The output is a single AUDIO tensor named generated_audio. Wire it to any audio preview/save node, or straight into a video workflow's audio input.
Installing it
ComfyUI Manager can find it if you search "ComfyUI InspireMusic Plugin"; otherwise the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/vanche1212/ComfyUI-InspireMusic
cd ComfyUI-InspireMusic
pip install matcha-tts
Then grab a model (the README recommends ModelScope, HuggingFace also works):
git clone https://huggingface.co/FunAudioLLM/InspireMusic-1.5B-Long.git ComfyUI/models/InspireMusic/InspireMusic-1.5B-Long
Restart ComfyUI and the node appears under "InspireMusic".
Where people get burned
Do not pip install -r requirements.txt. It pins transformers==4.46.3, flash-attn==2.7.4.post1, and peft==0.13.2 alongside the rest of a kitchen-sink list - that's a recipe for clobbering your ComfyUI environment, which the ecosystem already struggles with. The README's own advice is the sane one: install matcha-tts (it fixes a Matcha-TTS import error that's the classic first-run crash), then add missing packages one at a time as Python complains. Use a venv if you can.
Second trap: the node fails silently. Look at the source - if generation hits a memory error, it doesn't throw; it returns five seconds of empty audio. A successful-looking silent run with no waveform means you OOM'd. Fix: fast_mode, a 24kHz model, shorter duration, or fewer GPU hogs in parallel.
Third: the model files must land in ComfyUI/models/InspireMusic/<model_name> with the exact name from the dropdown, or the manager won't find it. And in continuation task mode, an audio_prompt is mandatory - the node errors out if you forget it.
It's fiddly, and a 1.5B music model wants a real GPU with 16GB+ to run comfortable. But for "I need a minute of mood-appropriate music under this video, now," it's the rare thing that actually delivers - locally, in your existing ComfyUI graph.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| text_prompt | STRING | A captivating classical piano performance with dynamic and intense atmosphere. | — |
| model_name | COMBO | InspireMusic-1.5B-Long | 5 options: InspireMusic-1.5B-Long, InspireMusic-1.5B, InspireMusic-Base, InspireMusic-1.5B-24kHz, InspireMusic-Base-24kHz |
| task_type | COMBO | text-to-music | 2 options: text-to-music, continuation |
| duration | FLOAT | 305–120 | — |
| output_sample_rate | COMBO | 48000 | 2 options: 24000, 48000 |
| chorus_mode | COMBO | default | 6 options: default, random, verse, chorus, intro, outro |
| fast_mode | BOOLEAN | false | — |
| fade_out | BOOLEAN | true | — |
| fade_out_duration | FLOAT | 1.00.1–5 | — |
| trim_silence | BOOLEAN | false | — |
| audio_promptopt | AUDIO | — | |
| seedopt | INT | -1-1–2147483647 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| generated_audio | AUDIO | — |