Nodes/RyanOnTheInside/Empty Mask From Audio βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Empty Mask From Audio βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

A blank mask sequence sized to your track

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Empty Mask From Audio βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • audio
  • empty_mask
  • frame_count
β—„frame_rate30.0β–Ί
β—„height512β–Ί
β—„width512β–Ί

Same job as its sibling Empty Image From Audio, just for masks: you hand it an audio clip, it hands back a blank MASK sequence that's the right length for that clip at your target frame rate. It's a small utility node, but if you're building an audio-reactive workflow with the RyanOnTheInside pack, it's the kind of thing you reach for constantly - you almost never have a mask sequence already sitting around that matches your song's exact frame count.

This pack (by Ryan, u/ryanontheinside, also known for ComfyStream and Daydream's real-time reactive video work) is built around the idea that audio, MIDI, motion, depth, and other signals should drive your workflow directly rather than you keyframing everything by hand. This particular node doesn't do any of that reactive analysis itself - it's the setup step. Think of it as clearing a blank canvas the exact size of your song before you start painting a reactive mask onto it.

How it works

The node reads the duration of the input audio and multiplies it against your chosen frame_rate to work out how many frames a video of that length would need. It then allocates a blank MASK tensor of that length at your chosen width and height. No models, no analysis, no GPU-heavy work - it's bookkeeping, and it exists so the rest of your reactive pipeline (which does care a lot about exact frame counts) has something consistent to build on.

Inputs and outputs that matter

  • audio (required) - the clip that sets the timing. Everything else follows from its length.
  • frame_rate (default 30, 0.1–120 fps) - use the same number you'll actually render at. This node has no way to check that for you.
  • width / height (default 512, 16–4096) - the pixel dimensions of the blank mask.

Two outputs: empty_mask, the blank mask sequence - wire it into a FlexMask node or any other mask-consuming node in the pack that you're about to drive reactively - and frame_count, the integer frame total. Route frame_count into any downstream node that needs to know how long the sequence is, and ideally into the same value you're feeding your Feature Extraction nodes reading the same audio, so nothing drifts.

Installing it

Via ComfyUI Manager: search RyanOnTheInside, install, restart. Manually:

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

This node itself is lightweight - no models, no heavy audio libraries required for what it does - but the pack ships as one dependency set, so pip install -r requirements.txt still pulls in the librosa-based audio analysis, MIDI parsing, and optical-flow libraries the rest of the pack needs, even if this specific node doesn't touch them.

Common issues

The README calls out that updating from an older v1 install to v2 has caused problems for some users, and the fix isn't a quiet git pull - it's uninstalling the pack completely and reinstalling fresh.

For this node specifically, the failure mode to watch for is a silent one: setting frame_rate here to something other than what you actually export at. The math the node does is correct for the number you gave it, so nothing throws an error - your mask sequence is just quietly the wrong length for your final video, and any effect keyed to specific frames in that sequence will land on the wrong beat. Pick one frame rate for the whole workflow and use it everywhere audio timing matters, this node included.

CategoryRyanOnTheInside/Audio/Utility

Inputs (4)

NameTypeDefaultDescription
audioAUDIOInput audio to determine frame count
frame_rateFLOAT30.00.1–120Frame rate of the output mask sequence (0.1 to 120 fps)
heightINT51216–4096Height of the output masks (16 to 4096 pixels)
widthINT51216–4096Width of the output masks (16 to 4096 pixels)

Outputs (2)

NameTypeDescription
empty_maskMASKβ€”
frame_countINTβ€”