Nodes/comfy-ovum/Return TRUE if a list is not empty
ComfyUI Node

Return TRUE if a list is not empty

Return TRUE if a list is not empty — the tiny gate your loop was missing

By sfinktah·Created about a year ago·Updated 10 months ago· 7
Return TRUE if a list is not empty
  • array
  • not_empty

It does exactly what the display name says: shove a list in, get a BOOLEAN back telling you whether it has anything in it. One input, one output, no configuration. The kind of node you don't think about until you're three hours into building a loop and realize you have no clean way to ask "did the previous step actually produce any items?"

It lives in the ovum/loop category because that's where it earns its keep. In a Foreach or Map-style iteration, or when you're feeding a batch loader into a processing chain, you often need to short-circuit an empty result before it poisons a downstream node - a model loader choking on an empty list, a combiner producing nothing, a sampler running with zero frames. isListNotEmpty gives you a clean boolean to feed into the pack's IfElseOvum so you can pick a fallback branch instead of crashing.

The mechanism, such as it is

Under the hood it's the world's shortest Python function: len(array) > 0. That's the whole thing. Two details matter:

  • The input is typed array and expects a real Python list. Pass a non-list and the node raises ValueError rather than guessing.
  • It also prints the length to the ComfyUI console (notEmpty: 4 and so on). Harmless, occasionally useful for debugging, and worth knowing if you're wondering where those log lines come from.

The output socket is named not_empty and is a proper BOOLEAN, so it plugs straight into boolean inputs - IfElseOvum, comparison nodes, or any node with a true/false toggle - without an extra cast.

Where it fits in a real workflow

The most common pattern in this pack's ecosystem is a guard around a list-producing node: load a directory of images → isListNotEmpty → feed the boolean to an If/Else that routes to a "load defaults" branch when nothing was found. It also pairs with the batch-loading nodes in ovum/image, which expose their own exhausted flag - use that when you need to know whether a loader ran out of items mid-iteration, and use this when you just need the one question: empty or not.

One honest caveat: the node is a little too strict for its own good. Since it demands an actual list, feeding it a Comfy batch or a tuple will error out. If you're getting ValueErrors, convert the value to a proper list upstream (the pack has casting helpers for exactly this) rather than fighting it.

Install

Part of the comfy-ovum pack:

cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum

or search comfy-ovum in ComfyUI Manager and restart. No models, no keys - it's a pure utility node.

Categoryovum/loop

Inputs (1)

NameTypeDefaultDescription
array*

Outputs (1)

NameTypeDescription
not_emptyBOOLEAN