RM Mask Gate (Guide)
Kill a guide conditioning when the mask is empty
- mask
- guide
- guide
RMMaskGate validates a mask and passes it through or outputs None. This is the same validity check, aimed at a different target: instead of gating the mask, it gates a GUIDE. If the mask is valid, the guide passes through untouched. If the mask is invalid - empty, zero-dimension, or all-black - the node outputs None for the guide, which completely disables the guide downstream.
How it works
Guide conditioning is the newer sibling of ControlNet-style conditioning used by the big video/flow models (Wan 2.x and friends): a secondary conditioning stream that steers generation, often derived from a mask or a depth/latent input. A guide computed from a failed or empty mask is worse than no guide - it injects garbage structure into the sampler. This node's job is to make "the mask came back empty" mean "turn the guide off," automatically, so your video workflow doesn't burn a generation on a guide that's guiding toward nothing.
It reuses the exact same validation logic as RMMaskGate - None, empty tensors, zero dimensions, and all-zero sums all count as invalid - and prints a console line for each rejection. Valid mask, guide passes. Invalid mask, guide becomes None and whatever consumes the guide gets the explicit "nothing here" signal instead of corrupted data. It's the same guardrail philosophy as the plain gate, applied to the conditioning stream rather than the mask.
Inputs and outputs that matter
- mask (MASK, optional) - the mask that decides the guide's fate.
- guide (GUIDE, optional) - the conditioning stream being gated.
- Output: guide (GUIDE) - the guide if the mask passed,
Noneotherwise.
How to install it
Part of the RMAutomation pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Moser9815/ComfyUI-RMAutomation
Restart ComfyUI; it's under RMAutomation/Mask. No dependencies.
Common issues
Same caveat as the plain gate, one level up: None guide output is a signal, and the downstream consumer has to be built to receive it - if your sampler node requires a guide input, wiring in a None may still error. Check the console when a guide seems to have vanished: the "Invalid/empty mask, disabling guide" line tells you the gate fired and the mask is the problem, not the guide. And don't expect this node to fix a mask - it's binary. If you need graded control (partially guide, partially not), remap or blur the mask upstream before it reaches the gate; the gate only answers "valid or not."
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| maskopt | MASK | — | |
| guideopt | GUIDE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| guide | GUIDE | — |