ComfyUI Node

DA_PlaySound

A 'your render is done' chime, built into ComfyUI

By DemonAlone·Created about a month ago·Updated a day ago· 1
DA_PlaySound
  • any_input
  • output
volume0.50
play_only_when_queue_emptyfalse
audio_filedefault.mp3
duration0.0

You know the feeling: you've queued a 20-minute render, you've alt-tabbed away, and now you're refreshing the browser every ninety seconds to see if it's done. DA_PlaySound is the fix. Drop it at the end of your workflow and it plays an audio file in your browser the moment that step executes - a chime, a beep, or whatever .mp3 you want to shove in the pack's folder. It's a utility node from DemonAlone-JS_Addon-ComfyUI, the JS companion pack to the author's main DemonAlone-nodes repo, and it's a direct descendant of PlaySound 🐍 from pythongosssss's ComfyUI-Custom-Scripts - that pack is the origin of about half the "play a sound when done" nodes floating around.

How it works

The mechanism is pure browser: the Python node builds a small message with the audio file, volume, and duration and returns it as UI data. The JS (web/play_sound.js) catches it in onExecuted and calls new Audio(url).play() in your browser tab. It caches the audio in memory so a loop running this node 40 times isn't hammering the network - it just resets currentTime and replays.

Because it's browser-side, the sound plays on whatever machine the browser is open on, not the server. That's usually exactly what you want when the GPU box is across the room.

The inputs that matter

Four settings, all visible up top:

  • volume - 0.0 to 1.0, default 0.5.
  • audio_file - a dropdown of every audio file in the pack's web folder, with a default.mp3 already shipped. Drop your own files into ComfyUI/custom_nodes/DemonAlone-JS_Addon-ComfyUI/web/ - .mp3, .wav, .ogg, .flac all work.
  • duration - caps playback in seconds, 0.0 = let it play out. Handy for a short notification instead of a 30-second song.
  • play_only_when_queue_empty - the one that earns its keep. When on, it pings ComfyUI's job queue and only makes noise if your render is the last thing in line. That turns it from "plays 14 times per batch" into "plays once, when the batch is done."

There's also an optional any_input passthrough with an output of the same type, so you can chain it into your image wire and it'll fire exactly when that image passes through - otherwise it just sits at the end as an output node with no connections, which is the normal way to use it.

Installing it

Nothing unusual:

cd ComfyUI/custom_nodes
git clone https://github.com/DemonAlone/DemonAlone-JS_Addon-ComfyUI

Restart, or install "DemonAlone-JS_Addon-ComfyUI" from ComfyUI Manager. No models, no extra pip packages. To add custom sounds, drop files in the web folder and restart ComfyUI - the dropdown is built once at startup.

Where people get burned

Two things trip people up. First, browser autoplay policies: Chromium refuses to play audio with sound until you've clicked somewhere on the page at least once. If you get silence on the very first run, click once in the ComfyUI window, then re-queue. It's the browser, not the node.

Second, the dropdown is populated at launch, so "I added a file and it's not in the list" is a restart problem, not a bug. And if you set duration to 0.0 expecting "very short," you've got it backwards - 0 means unlimited, so a looping workflow with a long file can overlap into itself. Set a real cap and it stops cleanly.

It's a tiny node, but it's one of those quality-of-life additions that quietly changes how you work. Twenty minutes deep in a batch queue with the chime going off at the end beats F5-refreshing, and the queue-empty flag makes it genuinely smart about when.

Categoryutils

Inputs (5)

NameTypeDefaultDescription
volumeFLOAT0.500–1
play_only_when_queue_emptyBOOLEANfalse
audio_fileCOMBOdefault.mp3Place your .mp3/.wav/.ogg/.flac files in custom_nodes/demonalone-js_addon-comfyui/web folder
durationFLOAT0.00–10Max playback duration in seconds. 0.0 = unlimited
any_inputopt*

Outputs (1)

NameTypeDescription
output*