Create Fluid Mask
An animated mask from a tiny fluid sim
- IMAGE
- MASK
Most procedural mask generators give you clean geometry - a wipe, a fade, a hard-edged shape. This one gives you something that actually looks like it's flowing: a small fluid simulation with a handful of inflow sources emitting into a canvas, rendered out as an animated sequence. If a straight geometric wipe reads as too mechanical for a reveal or transition, this is the organic alternative in the same pack.
The inputs that matter
frames(default1) - total output length.width/height(default256each) - canvas size.inflow_count(default3) - how many separate fluid sources are placed on the canvas.inflow_velocity(default1) - how fast fluid emits from each source.inflow_radius(default8) - the size of each source.inflow_padding(default50) - margin from the frame edge sources are placed within.inflow_duration(default60) - how many frames each source keeps actively emitting before it stops.invert(defaultfalse) - flips the result.
Outputs: IMAGE and MASK, both at once - unlike this pack's older CreateAudioMask, which only produced an IMAGE and left you to convert it separately, this node hands you a ready-to-use mask directly alongside the viewable image.
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 models - this is a self-contained simulation, nothing to download.
Common issues & troubleshooting
The fluid stops moving partway through the clip. Check inflow_duration against frames - if inflow_duration is shorter than your total frame count, the sources stop emitting once it runs out, and what you see afterward is the existing fluid drifting under its own momentum rather than continuing to grow. Set inflow_duration close to or equal to frames if you want active churn for the entire clip.
The mask never covers enough of the frame by your target frame count. Raise inflow_count or inflow_radius before extending frames itself - both push toward a fuller mask faster than simply giving the same sources more time.
Generation is slower than you expected for a "simple" mask. This is an actual simulation, not a static pattern - run time scales with both frames and inflow_count. A long clip with several sources is meaningfully more work than a short one with a single source; budget accordingly if this feeds into a heavier downstream video sampler.
Sources are clipping right at the frame edge. That's what inflow_padding controls - raise it if sources are spawning too close to the border for your taste, since it sets the margin they're placed within, not just a visual buffer.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| invert | BOOLEAN | false | — |
| frames | INT | 11–4096 | — |
| width | INT | 25616–4096 | — |
| height | INT | 25616–4096 | — |
| inflow_count | INT | 30–255 | — |
| inflow_velocity | INT | 10–255 | — |
| inflow_radius | INT | 80–255 | — |
| inflow_padding | INT | 500–255 | — |
| inflow_duration | INT | 600–255 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |