_.pluck
Pull One Field Out of Every Item in a List
- list_or_dict
- LIST
_.pluck is the workhorse of the underscore family. Give it a list of dicts and a field name, and it returns a list of just those field values. If you've got a list of metadata objects and you want every seed, every prompt, or every model_name, this is the one-liner that gets you there. It's the "extract a column" node, and it's probably the node from this pack you'll actually build a habit around.
How it works
It walks the collection and pulls the named property out of each element - working on dict keys and object attributes alike. A couple of nice extra behaviors:
- Numeric index: give it
1and it grabs column 1 from a list of tuples/lists - a quick transpose-style extraction - Two-element key list:
["k", "j"]returns a list of(k, j)pairs
The inputs:
list_or_dict- the collection (or a_.CHAIN)propertyName- a string widget for the field to pull
Output: a LIST of the extracted values.
Why you'll reach for it
Metadata handling is the classic case. Downstream nodes often want a flat list where upstream gives you a list of rich objects. One pluck converts a list of generation records into the list of seeds you wanted to compare, or into the list of prompts you wanted to format. It pairs beautifully with the pack's list utilities and with _.pairs for reorganizing data.
It also composes well: pluck a field out of a list, then feed that list to _.min, _.max, or any of the collection nodes, and you've turned "find the best object" into "find the min of a simple list."
The family mechanics
Like every underscore node here, the primary input accepts a _.CHAIN - feed it one and the pluck stays inside the chain, unwrapped later by _.value. Feed it a plain list and the node deep-copies your input, runs the extraction, and hands back the finished LIST, leaving your source untouched.
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
Extract a field from every item in a list, no loops, no fuss. It's the node in this pack that quietly does the heavy lifting in metadata workflows.
Inputs (2)
| 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. | |
| propertyNameopt | STRING | propertyName (string) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LIST | LIST | — |