ComfyUI Node

any

The 'at least one passed' check that keeps a batch alive

By StableLlama·Created about a year ago·Updated 4 days ago· 48
any
  • list
  • result

Sometimes you don't need everything to pass - you need something to pass. any collapses a data list of booleans into a single answer: True if at least one element is truthy, False if none are. It's the "did anything work?" check, and it's the lenient cousin of the pack's all node.

It's part of Basic data handling, StableLlama's zero-dependency utility pack. Like all, it's a straight port of the Python builtin, one input in and one boolean out.

How it works

Python's any() semantics, unchanged:

  • At least one truthy element → True.
  • Every element false, or an empty listFalse.

That last one is the mirror image of all, which returns True for an empty list. Here, an empty list means nothing passed, so the answer is False - which is honestly the more intuitive direction and rarely surprises anyone.

The input and output

  • list (*) - the data list of booleans (or truthy values) to check.
  • result (BOOLEAN) - True if any element is truthy.

A realistic use

Batch workflows are where this shines. Run a per-item detector or check that emits a boolean for each image, collect them into a data list, and feed any. If any image passed, route the whole batch down the "something to work with" path; if nothing passed, branch to a retry or a fallback prompt instead of wasting a cycle. Combined with all, you get the full decision ladder: all-passed → proceed, any-passed → salvage, none-passed → retry.

Installing it

ComfyUI Manager → search "Basic data handling", or:

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

Restart. No dependencies, no models.

Common issues

  • "It's True but I expected all of them to pass." Wrong node - any only needs one. You want all for the strict version.
  • "Empty list returned False." Correct behavior here (unlike all). If you want an empty batch to count as a pass, handle the length check yourself before feeding it in.
  • "I fed in values that aren't booleans." Truthiness rules apply: 0, "", None, empty collections are false; everything else is true. Cast to a boolean list first if you need strict semantics.
CategoryBasic/Data List

Inputs (1)

NameTypeDefaultDescription
list*

Outputs (1)

NameTypeDescription
resultBOOLEAN