Nodes/comfy-ovum/_.collect
ComfyUI Node

_.collect

The legacy name for “map each item”

By sfinktah·Created about a year ago·Updated 10 months ago· 7
_.collect
  • obj
  • *

_.collect is Underscore.js's old-school alias for _.map: "Return the results of applying the iterator to each element," as the author's description puts it. You hand it a collection, it runs a transform over every item, and you get the transformed collection back. If you've used map in Python or JS, you know the drill - this node exists mostly so that code and muscle memory from the underscore era keep working in the graph.

Here's the honest part, and it's worth saying up front: in this generated node, only the primary obj input is exposed on the socket. The iterator that does the transforming isn't wired up in this build of the node, which makes _.collect less immediately useful than it sounds. For actual map behavior, the _.map node (also in this pack) is the one with the full iteratee controls.

How it works

Generated wrapper around underscore3, the bundled Python port of Underscore.js. The method is the classic collection mapper - iterate the list, call the iteratee on each element, collect the results into a new list. The wrapper keeps the same signature, but when it builds the node's inputs, the collect alias isn't in the set of methods that get a dedicated iteratee socket, so you're left with the collection input alone.

That means in practice the node's output is the collection, transformed only if the port's internal default applies (which, with no iteratee supplied, amounts to a pass-through or near-pass-through of the values). If you just want the mapping semantics, _.map is the node to reach for.

Inputs and output

  • obj (any type) - the collection to iterate. Accepts a _.CHAIN to continue a chain.
  • Output: * (any type) - the mapped result.

Nothing else on the surface. No widgets.

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.

Should you use it?

Only if you're deliberately keeping a chain readable with the alias name, or you loaded a workflow that references it. Otherwise you want _.map. This is a good example of why the author's README warning about the underscore suite - "an absolute disaster to use in production," work-in-progress - exists: the generated wrappers don't all land with complete inputs. _.collect is a wrapper whose legacy naming won, but whose iteratee wiring didn't arrive. Treat it as a curiosity unless you specifically need the alias, and use _.map for real work.

Categoryovum/underscore

Inputs (1)

NameTypeDefaultDescription
objopt*Primary input object. Also accepts _.CHAIN to continue chaining.

Outputs (1)

NameTypeDescription
**