Nodes/VLM_nodes/PlayMusic Node
ComfyUI Node Runs on cloud

PlayMusic Node

Actually hear what your image-to-music node made

By gokayfem·Created 3 years ago·Updated 22 days ago· 589
PlayMusic Node
  • wave_form
  • *
mode
volume0.5
sample_rate

ComfyUI will happily generate you an audio waveform and then... show you nothing. PlayMusic is the missing piece: the output node that plays the generated music in your browser while you work. It's a dead-simple node with a very specific job - take the waveform from the pack's audio generators and make it audible.

What it is

PlayMusic sits at the end of the pack's audio chain, right after an audio-generating node like AudioLDM-2 (image to music) or the ChatMusician LLM (text to music). It's a passthrough/output node: it takes the waveform, sends it to the UI to be played, and passes it along so you can also save it. It's marked as an output node in ComfyUI, which is exactly what you want from a "let me hear it" node.

The inputs that matter

  • wave_form - the audio itself. This accepts the waveform output from the pack's audio generation nodes. Note the input name: it expects the waveform tensor, not a file path.
  • sample_rate - the sample rate of that waveform, an INT. Your audio node produces it; wire it through. Get it wrong and playback is pitched/slowed, so match the source.
  • mode - dropdown: always or on empty queue. always plays whenever the graph runs; on empty queue only plays once the queue drains, which is handy when you're queuing several generations and don't want music blasting over each one.
  • volume - 0 to 1, default 0.5. The obvious one.

The output is the same waveform, passed through as an ANY-typed list, so you can chain it into SaveAudioNode to actually write the file.

How it works

It's a no-op with UI: the node hands the waveform and sample rate to the ComfyUI frontend, which plays it, and returns the waveform for whatever comes next. The mode toggle just decides when playback happens. There's nothing clever under the hood, and that's the point - audio generation in this pack is fiddly enough without also fighting playback.

Install

Pack-level, nothing audio-specific:

cd ComfyUI/custom_nodes
git clone https://github.com/gokayfem/ComfyUI_VLM_nodes

Restart ComfyUI (or Manager → "VLM Nodes"). Python 3.9+. This node itself pulls in no heavy dependencies - the heavy stuff lives on the generator nodes upstream.

Gotchas

If nothing plays, check the obvious: is the waveform actually connected, and does your browser allow audio from the ComfyUI tab? If playback is distorted or wrong-pitched, your sample_rate doesn't match the source - that's the classic mistake. And remember it's playback only: nothing gets saved to disk until you add SaveAudioNode.

CategoryVLM Nodes/Audio

Inputs (4)

NameTypeDefaultDescription
modeCOMBO2 options: always, on empty queue
volumeFLOAT0.50–1
wave_form*
sample_rateINT

Outputs (1)

NameTypeDescription
**