_.select
Filtering's confusing twin — know what you're getting
- obj
- *
_.select is supposed to return every element of a list that passes a truth test - it's the old ECMAScript-era alias for filter, and Underscore.js inherited it. In the comfy-ovum wrapper, though, this is where the family's "work in progress" label starts showing real teeth: the node as generated exposes only the primary obj input and no predicate, even though the whole point of select is the test you pass it.
Let me show you what that means in practice. The wrapper calls the underlying method with whatever inputs exist - here, just the collection. So instead of "elements that pass a test," you get the equivalent of calling select with no predicate at all, which collapses to keeping every element. If that's what you wanted, congratulations, you've found an expensive identity node. If you wanted actual filtering, you want _.filter, which does expose its predicate (as both an ANY input and a JSON widget).
The honest read
This node is the clearest example in the family of why the author wrote "absolute disaster to use in production" about the underscore nodes. The auto-generator wraps every method it can discover on underscore3 (the bundled Python port of Underscore.js) and derives inputs from function signatures; when the signature's parameters are obscured, the UI ends up missing the one input you actually need. _.select is that case. It works - it just doesn't do the thing its name promises.
My advice: don't build with _.select. Use _.filter from the same pack if you want the underscore semantics, or the pack's own UniqueList/ListSlice utilities, or ComfyUI-LogicUtils by aria1th (which this pack explicitly positions itself as complementary to) for anything you'll rely on.
Inputs and output
- obj (
*) - the list to pass through.
Output is a single * socket carrying the list. Because the return type is generic, Comfy won't enforce anything downstream.
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, underscore3 bundled in the repo, other deps (aiohttp, pillow, numpy, requests, etc.) installed by Manager. If a workflow you've loaded includes _.select and behaves oddly, this missing-predicate quirk is almost certainly the explanation - swap in _.filter and wire the predicate.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| objopt | * | Primary input object. Also accepts _.CHAIN to continue chaining. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |