Mpi Has Audio
Know whether a video file actually has a soundtrack
- has_audio
Video workflows have a quiet landmine: a video file that looks like it has audio but doesn't. You wire the audio stream into a combine node, it crashes - or worse, silently encodes a clip with dead silence. MpiHasAudio is the guard: it checks a video file on disk and tells you, as a boolean, whether it actually contains an audio stream. Wire that into a gate, and video-only clips get handled without crashing the whole graph.
How it works
One input, video_path - the same string you'd feed a video loader: an absolute path, or a bare basename resolved against ComfyUI's input folder. The node runs ffmpeg -i <file> with no output target, which makes ffmpeg dump the file's stream layout to stderr - and an audio track shows up there as a Stream ... Audio: line. Present = true, absent = false.
The important design choice: it inspects the file, not an AUDIO object. That's deliberate. ComfyUI's lazy audio maps report "not None" even when there's no real audio track - a connected wire is not proof of sound. By probing the container directly, this node sidesteps those false positives. It also defaults to false if the file is missing, if ffmpeg can't be found, or if the probe errors - the philosophy being that producing a video-only result is safer than crashing on a phantom audio stream.
Output: a single has_audio BOOLEAN.
Where you'd actually use it
The canonical pattern is the one the node's own description names: gate an audio wire into a CreateVideo-style node. Many video assembly nodes take an optional audio input, and feeding them an audio stream that turns out to be empty or lazy causes stalls or silent clips. Route MpiHasAudio into an MpiIfElseInverted - true path carries the audio, false path routes around it - and the branch you don't need is blocked rather than executed. It's the same "decide before you pay" pattern as MpiH3Length for MiniMax H3 video, but for the audio side of the equation.
Where people get burned
video_path is a path string, not an AUDIO object and not a node output. If you wire an AUDIO wire into it, it'll sit there doing nothing useful - this node needs the path to the file. And remember the default-false behavior: on a missing ffmpeg or a probe error you get false, not an error. That's safe by design, but it means a broken ffmpeg install silently makes every file look audio-less. If you suddenly see every clip taking the no-audio path, check that ffmpeg is actually on PATH.
Install
From the MadPonyInteractive/ComfyUi-MpiNodes pack. ComfyUI Manager → search ComfyUi-MpiNodes (publisher mad-pony-interactive), install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
then restart. No extra Python packages - it shells out to ffmpeg, which ships with ComfyUI anyway. The pack is AGPL-3.0 (≤ 1.2.6 MIT) and is the node library behind the author's Cubric Vision app.
The verdict
It's a one-boolean utility, but it's the one-boolean utility that keeps a whole class of video workflows from randomly dying. If you assemble video with optional audio - which is most real video pipelines - this is the difference between "sometimes crashes for no reason" and a workflow that handles both cases cleanly.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| video_path | STRING | Path to the video file (same string fed to VHS_LoadVideoPath). Absolute path or a bare basename resolved against ComfyUI's input dir. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| has_audio | BOOLEAN | — |