Nodes/ComfyUI-Demucs-AudioSeparator/📂 Load Audio Directory ⚡
ComfyUI Node

📂 Load Audio Directory ⚡

Folder of songs in, ComfyUI AUDIO out — the batch loader that feeds the stem separator

By Meisoftcoltd·Created 7 months ago·Updated 2 months ago· 2
📂 Load Audio Directory ⚡
    • audio
    â—„directory_pathâ–º

    If you've ever wanted to process a whole album instead of one track, you've felt the gap this node fills. ComfyUI has no built-in "give me all the audio in this folder" loader, and the pack's other node, DemucsAudioSeparator, is hungry for AUDIO input. LoadAudioDirectory is the tiny bridge: point it at a directory and it turns every supported audio file inside into a ComfyUI AUDIO list, ready to flow downstream.

    It's a utility node, not a flashy one - but for batch stem separation or quickly auditioning a folder of reference tracks, it's the difference between wiring up thirty individual loaders and typing one path.

    How it works

    It's refreshingly simple under the hood. You give it one thing, directory_path - a full absolute path as a plain string widget, no file browser. The node lists the top level of that directory, keeps files ending in .wav, .mp3, .flac, .ogg, or .m4a, and loads each one into the standard ComfyUI AUDIO format: a {"waveform": ..., "sample_rate": ...} dict with a batch dimension and float32 precision.

    The interesting part is how it loads. It tries torchaudio with the soundfile backend first, and if that fails - which it does, because newer torchaudio builds default to the torchcodec backend and torchcodec is notoriously picky about MP3s - it silently falls back to librosa. That fallback is the reason this node exists in a functional form at all; audio loading is where ComfyUI's dependency pain concentrates, and this one ships its own safety net.

    The one gotcha that matters

    The output is a list of AUDIO. DemucsAudioSeparator takes a single AUDIO. ComfyUI won't automatically expand a list into a single-value input for you, so don't wire the list straight into the separator and expect a magic batch - the node will see a list where it wanted a dict and complain. If you want to process the whole folder in one graph, you need an iterate/loop node in between to feed each clip through the separator one at a time. Or just process one file per graph, which for most people is the honest answer.

    Two smaller notes: the scan is not recursive (one level deep, that's it), and if a file fails to load the node prints a warning and keeps going with the rest rather than aborting the batch. And it raises a clear error if the directory doesn't exist or contains no supported files - which is friendlier than most ComfyUI nodes manage.

    Install

    It ships in the same pack as the separator, so the install is identical - one pack, two nodes:

    • ComfyUI Manager: search ComfyUI-Demucs-AudioSeparator, Install, restart.
    • Manual:
      cd ComfyUI/custom_nodes
      git clone https://github.com/Meisoftcoltd/ComfyUI-Demucs-AudioSeparator
      pip install -r requirements.txt

    No models to download for this node - it's pure file loading. One caveat if you do the manual route: the pack's requirements.txt contains a typo (soundfile=== with an empty version) that makes pip reject the whole file on a fresh install. pip install soundfile librosa sidesteps it.

    Where it sits in a workflow

    The natural chain is LoadAudioDirectory → (iterate) → DemucsAudioSeparator → stems → SaveAudio. Feed it a folder of songs and the separator hands you per-track vocals, drums, and bass you can save out or drive audio-reactive video from. For that Yvann-style reactive look, the stems' amplitude becomes the signal that modulates ControlNet strength and keyframes downstream - the directory loader is just the quiet piece that makes it batchable.

    If you're on Windows, remember it's an absolute path with forward or double-backslashes that ComfyUI will actually find - and no quotes. Cheap node, mild quirks, genuinely useful for anyone doing more than a single song.

    Category🎵 Demucs-AudioSeparator ⚡

    Inputs (1)

    NameTypeDefaultDescription
    directory_pathSTRING—

    Outputs (1)

    NameTypeDescription
    audioAUDIO—