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

小珠光比较大小-数据阻断

The compare node that only lets things through when they're big enough

By xiaozhuguang·Created 2 months ago·Updated a day ago· 56
小珠光比较大小-数据阻断
  • 输入
  • 输出
输入整数0
比较方式大于
比较值0

The plain data block is a manual switch. 小珠光比较大小-数据阻断 (Xiaozhuguang Compare Data Block) is the automatic version: it compares a number against a threshold and only lets data through when the comparison succeeds. Greater than, equal to, or less than - pick one, set the threshold, and the node decides for you. Data in, number in, condition out as a pass/fail gate.

This is where ComfyUI starts feeling like a program. Feed it the frame count from the pack's BatchCount node, set it to "greater than 30", and you've got a branch that only activates when a video is long enough. Feed it a seed or a batch size, and downstream behavior changes with the data instead of with your mouse.

How it works

It takes a wildcard 输入 (Input) that you want to gate, plus an 输入整数 (input integer) to test, a 比较方式 (comparison mode) dropdown - 大于 (greater), 等于 (equal), 小于 (less) - and a 比较值 (comparison value) threshold. When the test passes, the input data passes through; when it fails, the output is None, the same skip-signal convention as the plain data block. Both numbers are coerced to integers with defensive try/excepts, so a bad value degrades to "blocked" rather than crashing. VALIDATE_INPUTS returns True for the wildcard socket, so any type can ride through.

The inputs that matter

  • 输入 (Input) - the data to pass or block. Wildcard, so anything.
  • 输入整数 (Input integer) - the value being tested. Marked as a forced input, so wire it from a count or compare source.
  • 比较方式 - 大于 / 等于 / 小于.
  • 比较值 - the threshold to test against.

Output: 输出 - the data when the condition holds, None when it doesn't.

A realistic chain

VideoLoader → BatchCount → CompareDataBlock.输入整数, with the video's frames wired to the block's 输入, threshold "大于 8". Now the downstream "merge video" branch only fires for clips longer than 8 frames - a batch of single images just falls through as None and gets skipped. It's the same conditional muscle as the data block, but driven by the data itself.

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.

Gotcha

Same caveat as the plain data block: "blocked" is None, so it belongs on optional downstream inputs. And remember the comparison is integers only - a float threshold gets truncated, so 0.5 becomes 0 and "greater than 0.5" quietly becomes "greater than 0". For anything fractional, compare in a different node.

Categoryxiaozhuguang

Inputs (4)

NameTypeDefaultDescription
输入*
输入整数INT0-999999–999999
比较方式COMBO大于3 options: 大于, 等于, 小于
比较值INT0-999999–999999

Outputs (1)

NameTypeDescription
输出*