_.remove
The Remove Node That's Missing Its Predicate
- obj
- *
_.remove is supposed to be the "delete the matching elements" node: walk a list, remove everything your predicate says to remove, and hand back the removed elements. It sounds useful. It is not, as shipped - because the node generates no way to give it a predicate at all.
The problem
The method underneath requires a function argument - the truth test that decides what gets removed. But the auto-generated node only exposes the primary input (obj), with no predicate socket and no widget to type one. I checked the generated input schema and then ran the underlying call with no predicate: it dies with TypeError: 'NoneType' object is not callable, because it dutifully tries to call None as a function.
So the interface is a single slot:
obj- the list (or a_.CHAIN)
And in practice, every run of the node as shipped hits that call error. It's not something you're doing wrong - the wiring is just incomplete, in the same spirit as the family's pluckAsObject stub.
What it was meant to do
For the record, the intended semantics are lodash-style remove: elements where the predicate is truthy get pulled out of the array, and the node returns the removed ones. The predicate takes (value, index, array) - three arguments. In a correct port, that's a "pluck the matched items out and also shrink the list" behavior. That's a real, occasionally useful pattern - but you can't reach it through this node.
What to use instead
You've got better options right in the family:
_.reject- returns the list without the matching elements (inverse of remove). This is the one you actually want for "drop the bad ones."_.partition- returns both the matched and unmatched groups in one shot, so you keep the removed set and the survivors.
Both accept the same truth-test shorthand, and both actually work. There's no scenario where the current _.remove does something those two don't cover more cleanly.
When to check back
This is an auto-generated node, so a fix in the bundled underscore.js port's remove method (or a fix to the generation rules that skip its predicate input) would flow through on update. Worth re-testing after a pack bump - until then, treat it as broken and route around it.
Installing
Part of comfy-ovum. ComfyUI Manager → search comfy-ovum → Install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart ComfyUI. No models, no extra pip packages for the underscore nodes - the port is bundled in the repo.
The bottom line
A node with a good name and no working input. Don't fight it - _.reject and _.partition do the same job, and they work today.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| objopt | * | Primary input object. Also accepts _.CHAIN to continue chaining. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |