_.some
'does anything in this list pass the test?' — with a short circuit
- list_or_dict
- predicate
- BOOLEAN
_.some runs a truth test over a list and tells you whether any element passed. [1, 2, 3] with "is it even?" → true, because 2 exists. [1, 3, 5] with the same test → false. The implementation short-circuits: the moment one element passes, it stops walking the list and returns true, so it's fast even on long collections. This is the "is there at least one?" sibling of _.every and _.same.
In a workflow, that's a conditional's best friend. Did any of my loaded images come back blank? Is there at least one LoRA in this stack that matches a tag? Did any prompt variant fail to expand? _.some turns "scan the whole list" into a boolean you can feed straight into an IfElse or a branch router.
It's part of the ovum/underscore family in comfy-ovum - auto-generated wrappers around underscore3, the Python port of Underscore.js bundled in the pack. Family disclaimer applies (author says WIP, not for production), but this is one of the more complete members because it's a proper iteratee method and got the full predicate treatment.
The inputs that matter
- list_or_dict (
*) - the collection to scan. - predicate (
*) - the test. This is anANYinput socket (forced input), so you can wire a function or key selector in from another node. - predicate_json (STRING, multiline) - the widget-only fallback: JSON or a key selector used when
predicateisn't connected. This is how you do most real setups without writing Python. Want "is there a value equal to 42"? Feed JSON. Want "does any element have a truthynamekey"? Pass a property-name string and the iteratee machinery resolves it.
One of the iteratee shorthand behaviors worth knowing: like real Underscore, a string predicate is treated as a property name and an object predicate as a matcher (does the element contain these key/value pairs). That's the "shorthand syntaxes" the node's description mentions.
Output
A single BOOLEAN - properly typed, which is nice, because it plugs into boolean-typed conditionals without a cast.
The family chain behavior applies: feed a _.CHAIN as the primary input and the node continues the chain, returning a chain instead of a bare boolean; unwrap with _.value.
Install
# via ComfyUI Manager: search "comfy-ovum"
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
# restart ComfyUI
No model downloads; pure Python, deps (aiohttp, pillow, numpy, requests, etc.) auto-installed by Manager, underscore3 bundled in the repo. If your predicate JSON does nothing, check it's valid JSON - the wrapper silently falls back to no predicate when it can't parse, which makes _.some default to "does anything exist," true for any non-empty list.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| list_or_dictopt | * | Primary input object (expected collection). You can still pass any JSON-serializable value. Also accepts _.CHAIN to continue chaining. | |
| predicateopt | * | predicate: ANY input to override widget. Accepts function, key string, or object shorthand. | |
| predicate_jsonopt | STRING | predicate_json: JSON or key selector. Used when 'predicate' input is not connected. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |