Nodes/comfyui-obvpm/Optional Audio (obvpm)
ComfyUI Node

Optional Audio (obvpm)

Make the soundtrack a maybe instead of a must

By chanon·Created about a month ago·Updated a day ago· 42
Optional Audio (obvpm)
  • input
  • audio
  • present
on_emptymute

Audio in ComfyUI is a two-paradigm world. Either the model invents the sound along with the picture (LTX-2 and its video-plus-audio pass), or you bring your own track and the model consumes it as a driving signal - InfiniteTalk, MultiTalk and the rest of the avatar stack. Both paradigms put an AUDIO socket in the middle of a workflow, and in both, that socket is frequently empty: you're testing a silent render, or the TTS step hasn't run yet, or you only add the voice for the final pass.

Optional Audio (obvpm) is the node that makes that socket honest. Plug audio in, it passes through untouched. Leave it unwired, and the gate decides what the rest of the graph sees instead of you deleting and re-wiring a whole branch every time you change your mind.

What it does, mechanically

The node has one toggle and one socket. on_empty picks between two behaviours when nothing is connected:

  • mute (the default) emits an ExecutionBlocker, and every node downstream of the audio output is skipped silently. It's a kill switch: the audio branch disappears from the run entirely, and nothing downstream can object or recover.
  • bypass forwards None, so a downstream node with an optional AUDIO input treats it as unconnected and handles the absence itself.

The output side is audio plus a present BOOLEAN. present is true when the input is connected, and - this is the part worth remembering - it stays live even in mute mode, because the blocker only sits on the audio socket. So a muted audio path can still tell a switch "I have nothing to say", without that message being killed along with the data.

That's the pattern you actually want for an avatar workflow: gate the audio, feed present into a Lazy Switch's boolean, and the unselected side stops executing. Gate alone downstream; laziness upstream. Only the second one saves you the compute of whatever generated the audio.

Why you'd reach for it here

Two concrete shapes, both common in the audio-driven video stack:

  1. Optional dubbing. One graph, two modes: no audio connected and you get a silent video pass; audio connected and the same graph lip-syncs to your TTS output. You're not maintaining two workflows.
  2. Fan-in for a track that comes from three places. Chatterbox TTS for one job, a song file for another, nothing for a test render - all three feed the gate, and the gate feeds the lip-sync node.

For the second shape, pair it with First Float / First Int or, better, a Lazy Switch, so the fan-in collapses into one guaranteed value instead of three live paths competing.

Inputs and outputs

  • input - optional AUDIO. The thing to pass through. May be left unconnected.
  • on_empty - mute or bypass; default mute.
  • audio - the input passed through, or blocked / None when empty.
  • present - BOOLEAN, true when an input is connected, live even in mute mode.

Install

ComfyUI Manager → search comfyui-obvpm, or from a terminal:

cd ComfyUI/custom_nodes
git clone https://github.com/chanon/comfyui-obvpm

Restart, and it's there under obvpm/gates. The pack pulls in no extra Python dependencies at all - audio model loading happens in whichever audio pack you're already using, not here. Since 0.2.0 every node's class id ends in (obvpm), so the node menu search for obvpm lists the whole pack, and workflows saved with the pre-0.2.0 bare ids are migrated when opened.

Where people get burned

The trap with any mute-mode gate is that "silently skipped" reads exactly like "ran and did nothing". If your render comes out silent and the log shows no audio-related errors, check whether you muted a branch two nodes upstream and forgot. If the render errors instead, you probably chose bypass and fed None into a required AUDIO input - bypass only works when the consumer declares the socket optional. It's the same gate logic as the image and latent versions, just aimed at the part of the pipeline that most workflows treat as an afterthought.

Categoryobvpm/gates

Inputs (2)

NameTypeDefaultDescription
on_emptyCOMBOmuteWhat downstream sees when no input is connected: mute skips every downstream node, bypass outputs None.
inputoptAUDIOThe value to pass through. May be left unconnected.

Outputs (2)

NameTypeDescription
audioAUDIOThe input passed through. When the input is empty: blocked (mute) or None (bypass).
presentBOOLEANTrue when an input is connected. Stays live even in mute mode.