ComfyUI Node

any

Any — the OR gate you apply to a whole list at once

By StableLlama·Created about a year ago·Updated about 15 hours ago· 48
any
  • list
  • BOOLEAN

any is the batch OR gate: it takes a LIST and returns True if at least one element is truthy. Where its sibling all is "everything passed," this one is "anything tripped." You reach for it whenever a workflow should take an action if any of several conditions are met.

How it works

It's a direct wrapper around Python's built-in any():

return (any(list),)

Truthiness is Python truthiness: non-zero numbers, non-empty strings, and True are truthy; 0, "", None, False, and empty collections are falsy. If even one element is truthy, the output is True.

Note the empty-list behavior, because it's the mirror image of all and people mix them up constantly: an empty list returns False. With no elements, there's nothing that could be true, so any says no. Meanwhile all on an empty list returns True. If you swap the two, every empty-list edge case in your workflow silently inverts.

Where you'd use it

  • Alert or bail logic. Build a LIST of "did this step fail" booleans; if any is True, route to an error path or skip the rest of the graph.
  • Conditional OR. Instead of chaining a row of boolean or nodes, collect the conditions into a create LIST from BOOLEANs and let any collapse them. Far fewer wires, far easier to read.
  • Batch filtering checks. "Is any frame in this video above the safe threshold?" - one node, one answer.

Pair it with the pack's if/else or disable flow and you've got real control flow in the graph. The output is a single BOOLEAN, which also inspects cleanly through a to STRING node if you're debugging.

Installing

It ships in the "Basic data handling" pack by StableLlama. ComfyUI Manager: search "Basic data handling", install, restart. Or manually:

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

Restart ComfyUI. No dependencies, no models - this whole pack is pure Python wrappers around built-ins, so there's no pip step and nothing heavy to download.

Gotchas worth knowing

  • Empty list → False. If that's not what you want, guard with a ListLength check.
  • It operates on a LIST (the pack's single Python-list type), not a native ComfyUI data list. Convert a data list to LIST first if that's what you're holding.
  • Watch your truthiness: the string "False" is truthy because it's a non-empty string. Only actual False/0/None/"" count as false.
CategoryBasic/LIST

Inputs (1)

NameTypeDefaultDescription
listLIST

Outputs (1)

NameTypeDescription
BOOLEANBOOLEAN