Nodes/KJNodes for ComfyUI/Create Audio Mask
ComfyUI Node Runs on cloud

Create Audio Mask

Deprecated, and the only audio-reactive mask node in the pack

By kijai·Created 3 years ago·Updated about 12 hours ago· 2,955
Create Audio Mask
    • IMAGE
    invertfalse
    frames16
    scale0.50
    audio_pathaudio.wav
    width256
    height256

    This node is filed under KJNodes/deprecated, so don't build new workflows around it - but it's worth understanding what it did, because nothing else currently in this pack replaces it exactly. It reads an audio file from disk and turns its waveform into an image sequence: louder moments become brighter (or darker, if inverted), one frame of output per frame of your target animation. Feed that into something that expects a mask-like signal and you get a crude audio-reactive effect - a pulse timed to volume, without any actual audio-analysis model involved.

    The inputs that matter

    • audio_path (STRING, default "audio.wav") - a literal file path on disk, not a socket. This is the trap: if you were expecting to connect an AUDIO output from a LoadAudio node into this, that's not how it works. It reads the file itself, by path.
    • frames (default 16) - how many frames of output to generate.
    • scale (default 0.5) - amplitude scaling, controlling how strongly loudness maps to brightness/intensity.
    • invert (default false) - flips the mapping.
    • width / height (default 256 each) - output canvas size.

    Output: IMAGE - not MASK, despite the node's name. If the next thing in your workflow expects a MASK socket, you'll need an image-to-mask conversion step in between; this node hands you a grayscale-ish image, not a ready mask type.

    How to install it

    Via ComfyUI Manager: search KJNodes for ComfyUI, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kijai/ComfyUI-KJNodes
    pip install -r ComfyUI-KJNodes/requirements.txt
    

    Then restart. No model downloads - it reads a raw audio file directly rather than running anything through an audio model.

    Common issues & troubleshooting

    Nothing happens, or it errors on load. Double-check audio_path - it's a plain text field, and it needs a real path ComfyUI's process can actually read from disk, not a connected wire from an audio-loading node elsewhere in your graph. A relative path like the default audio.wav only resolves if the file is sitting somewhere ComfyUI expects to find it, which is a common source of "file not found" confusion.

    You wired the output where a MASK was expected and got a type error. The output is IMAGE. Route it through an image-to-mask conversion node first.

    It's deprecated - what do I use instead? Nothing in the current, non-deprecated part of this pack replaces the specific "audio waveform drives a mask" use case. This pack's other animated-mask generators - CreateFluidMask, CreateVoronoiMask - are procedural, not audio-reactive; they don't read an audio file at all. If audio-reactive masking specifically is what you need, this deprecated node remains the only one in KJNodes that does it, which is a real gap worth knowing about rather than assuming a modern equivalent exists somewhere in the pack.

    CategoryKJNodes/deprecated

    Inputs (6)

    NameTypeDefaultDescription
    invertBOOLEANfalse
    framesINT161–255
    scaleFLOAT0.500–2
    audio_pathSTRINGaudio.wav
    widthINT25616–4096
    heightINT25616–4096

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE