_.property
A Factory That Makes a Property-Getter Function
- py_dict
- *
_.property doesn't return a value - it returns a function that fetches a value. Give it a property name, and you get back a getter you can feed to other nodes: hand that getter to a map-style or iteratee node, and it'll pull the named field out of whatever it's called on. It's the underscore-family version of "make me a pluck for a property I'll reuse everywhere."
How it works
The mechanism is straightforward: the node wraps the property name (or key) into a callable that does obj[key] or getattr(obj, key) - whichever fits - on whatever object is thrown at it. So _.property with name "a" produces a function where fn({"a": 5}) returns 5. I verified exactly that.
The inputs are where this node gets confusing:
py_dict- this is where the property name goes, despite the labelpath- a string widget that, as shipped, doesn't actually reach the method
The path widget looks like the obvious control, but the method reads its key from the primary input. So don't type the property name into path and wonder why nothing works - the primary input is the one that matters. Output is a single ANY slot carrying the getter function.
The deep-path catch
The description promises deep property fetching with an array of keys or indexes. It doesn't. I tested passing a list path like ["x", "y"] and the port throws TypeError: unhashable type: 'list' - the underlying helper only handles a single, hashable key. So keep it to simple property names and don't expect nested paths to work in this version.
When you'd use it
This is a build-a-helper node, not a do-a-thing node. Its natural home is feeding a reusable getter into an iteratee-driven node - _.map, _.filter, _.sortBy - so you can say "sort by this field" without re-typing the field everywhere. It's also the kind of thing you reach for when you're assembling a custom function pipeline and want a named accessor rather than a lambda.
Honest caveat: if you're not already comfortable passing callables around your graph, this node will feel academic. The family's _.pluck gives you the same extraction power in a more direct, beginner-friendly form. Come back to _.property once you're building function pipelines.
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 getter factory for iteratee pipelines. Remember: the property name goes in the primary input, and deep paths are a no-go. If that feels like too much ceremony, _.pluck does the extraction more simply.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| py_dictopt | * | Primary input object (expected object). You can still pass any JSON-serializable value. Also accepts _.CHAIN to continue chaining. | |
| pathopt | STRING | path (string) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |