Nodes/ComfyUI-xiaozhuguang/小珠光数据阻断
ComfyUI Node

小珠光数据阻断

Gate any wire with one boolean

By xiaozhuguang·Created 2 months ago·Updated a day ago· 56
小珠光数据阻断
  • 输入
  • 输出
传输数据true

ComfyUI gives you two ways to stop a branch running: bypass the node, or delete the wire. Both are clumsy when you want a switch - something you can flip at runtime without touching the graph. 小珠光数据阻断 (Xiaozhuguang Data Block) is that switch: data in, boolean in, and the data only passes when the boolean is true. When it's off, the output is None, which is exactly what a downstream optional input needs to see to skip.

This is the "null-output placeholder" pattern from the plumbing layer, packaged as a node. It's wildcard-typed on both ends, so it'll gate an IMAGE, a LATENT, a STRING, a model - anything. The classic use: a master "apply post-processing" switch that you flip to quietly disconnect an entire branch's data from the rest of the graph, without bypassing anything or rewiring.

How it works

The input is * (any type) with a 传输数据 (transmit data) boolean, default true. The execute function does exactly one thing: if the boolean is true, pass the input through; if false, return None. Because the node declares VALIDATE_INPUTS returning True, ComfyUI skips type-checking the wildcard socket, so any wire fits. The name of the game is that None - downstream nodes that accept an optional input read None as "not connected" and fall back to their defaults or their first-non-null path.

The inputs and output

  • 输入 (Input) - the wildcard data you want to gate.
  • 传输数据 (Transmit data) - the switch. On = pass, off = block.

Output: 输出 (Output) - the data when on, None when off. Wire it into the optional input of a downstream node for the skip to work cleanly.

A realistic use

Say a video pipeline has a slow "detail every frame" branch. Put a Data Block between the branch and the final combine, drive its 传输数据 from the pack's big boolean toggle node, and now you can A/B the whole thing from one visible switch: on for the final render, off while iterating. The downstream combine just sees nothing on that input and skips it.

Install

From ComfyUI-xiaozhuguang - Manager (search "ComfyUI-xiaozhuguang"), or:

cd ComfyUI/custom_nodes/
git clone https://github.com/xiaozhuguang/ComfyUI-xiaozhuguang.git

Restart. No dependencies beyond core.

Gotchas

Two things to know. First, "blocked" means None, not "no data" - if the downstream input is required (not optional), a None can error, so use it on optional inputs. Second, this gates the data but doesn't stop the upstream branch from computing - the frames still get generated, they just don't travel. If you want to skip the compute entirely, use a bypass or the pack's lazy-evaluating Number Switch instead. It's a valve, not a fuse.

Categoryxiaozhuguang

Inputs (2)

NameTypeDefaultDescription
输入*
传输数据BOOLEANtrue

Outputs (1)

NameTypeDescription
输出*