_.every
“is this true for ALL of them?”
- list_or_dict
- predicate
- BOOLEAN
_.every is the all-of-them test. It checks whether every value in a collection passes a predicate, and returns a single BOOLEAN. The author's description: "Returns true if all of the values in the list pass the predicate truth test. Short-circuits and stops traversing the list if a false element is found."
That short-circuit matters for performance and semantics: the moment one element fails, it stops scanning and says false. It's the difference between "check everything, then judge" and "the first failure decides." In a Comfy graph this is the node behind gates like "only proceed if every seed is valid" or "all files exist, else bail."
How it works
Generated wrapper around underscore3, the bundled Python port of Underscore.js. The predicate is where the flexibility lives - the tooltip says it "accepts function, key string, or object shorthand," and predicate_json is the text-box fallback used when the socket isn't connected:
- Key string:
predicate = "ready"tests that every element'sreadyattribute is truthy. - Object shorthand: a JSON object like
{"status": "ok"}checks every element matches it. - Function: a Python callable via a
PY_FUNCinput, if you've exported one.
Note the collection input is list_or_dict - for dicts it iterates the values. And there's no chain short-circuit surprise to worry about: pass a _.CHAIN in and it continues the chain, with the boolean as the method's result.
Inputs and output
list_or_dict(any type) - the collection to test.predicate(any type) - optional socket override.predicate_json(STRING, multiline) - the widget you'll use most: a key name or JSON object.- Output:
BOOLEAN.
Installing it
Part of sfinktah/comfy-ovum ("comfy-ovum"):
- ComfyUI Manager: search "comfy-ovum", install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/sfinktah/comfy-ovum, restart.
No model downloads; light dependencies; underscore3 bundled in the repo.
Pairs well with
This node is the all-pass counterpart to _.some (any pass), _.contains (single value present), and _.filter (which values pass). The typical pattern: build a list of conditions, run _.every, feed the boolean into a conditional node, and gate a branch. The fiddly bit, as with _.countBy, is the iteratee: leave predicate_json empty with nothing connected and the test degenerates to "is every element truthy" - which is a fine check on its own, just know that's what you're getting. And the usual family caveat applies: the author flags the underscore suite as work-in-progress, so sanity-check the predicate on a small known list first.
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 | — |