Nodes/ComfyUI Impact Pack/SEGS isn't Empty
ComfyUI Node Runs on cloud

SEGS isn't Empty

Check whether a detector actually found anything

By ltdrdata·Created 3 years ago·Updated 4 months ago· 3,242
SEGS isn't Empty
  • segs
  • BOOLEAN

A one-job node: it takes a SEGS collection and tells you whether it's empty or not. That's it. But that one job matters more than it sounds like, because Impact Pack's detectors don't always find something - a face detector on a landscape shot, a hand detector on a portrait with hands out of frame - and a lot of workflows quietly assume they will.

Why you'd need this

ComfyUI's graph has no built-in if. Impact Pack fakes conditional logic with a small kit of nodes - booleans, comparisons, conditional branches - and this is the specific check for "did detection actually produce anything to work with." Wire a detector's SEGS output into this, and you get a BOOLEAN you can feed into an ImpactConditionalBranch to skip the detail pass entirely when nothing was found, instead of letting an empty SEGS fall through into a Detailer that has nothing to do (which, depending on your graph, can range from harmless no-op to a confusing dead end downstream).

This is especially relevant for batch runs: process fifty images through a face detector and it's a near-certainty a few of them have no face in frame. Gate on this node and those images pass through untouched instead of erroring or silently producing an unexpected output.

The input and output

  • segs (SEGS) - the collection to check.

Output is a single BOOLEAN - true if the SEGS has at least one element, false if it's empty. Feed it straight into ImpactConditionalBranch or ImpactLogicalOperators to combine it with other conditions.

What it doesn't tell you

This checks presence, not quality. A detector throwing out a single garbage low-confidence detection still counts as "not empty" - this node has no opinion on confidence, size, or label. If you need to filter out weak detections before deciding whether to proceed, that's a job for the SEGS filter nodes (label, range, or non-max-suppression filtering) before this check, not instead of it.

Installing it

Comes with the pack, no separate step. Via ComfyUI Manager: search ComfyUI Impact Pack, Install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack
cd ComfyUI-Impact-Pack
pip install -r requirements.txt

(portable: python_embeded\python.exe -m pip install -r requirements.txt), restart. No models, no heavy dependencies - this is a boolean check, not a detector.

Common issues

There isn't much to trip over with the node itself - the trap is upstream. If this keeps reporting "empty" when you expect detections, the problem is almost always your detector's threshold or model, not this node lying to you: check the detector's confidence threshold, make sure the right model is loaded (a face detector won't find hands, obviously, but it's an easy mismatch to make mid-refactor), and preview the SEGS with SEGSPreview to see what the detector is actually returning before assuming the logic node is broken. It never is - it's a straightforward length check.

CategoryImpactPack/Logic

Inputs (1)

NameTypeDefaultDescription
segsSEGS

Outputs (1)

NameTypeDescription
BOOLEANBOOLEAN