_.result
Read a property, or call it if it's a function
- obj
- property
- args
- *
_.result answers a surprisingly common question when you're poking around nested data in a graph: "is this value of obj['name'] a plain value, or a function I should call?" Real Underscore's _.result handles exactly that - if the named property holds a function, invoke it and hand back the return value; otherwise return the property as-is.
This is one of the more niche wrappers in the comfy-ovum underscore family. If you're building dict- or object-shaped data in your workflow (via something like the pack's New Multi-type Dictionary node) and you want to read a field without knowing whether it's callable, this is the node. In practice, most Comfy values - strings, ints, lists - are never callable, so you'll usually just get the property back. But when you're dealing with values that originated as Python objects or function-typed outputs, the conditional-call behavior saves you a branch.
The honest caveat
The whole ovum/underscore family carries the author's own label: work in progress, "not recommended for use in workflows." These nodes are auto-generated from underscore3 (a Python port of Underscore.js bundled inside the pack), and the generator does its best to map JS-style signatures onto Comfy inputs. _.result is a function-manipulation-adjacent method, so it's further from the well-trodden list-utility path - the least likely of these nodes to behave exactly as you'd hope on exotic inputs. Use it for quick inspection and prototypes, not for the backbone of a production graph.
Inputs and outputs
- obj (
*) - the object you're reading from. Dicts work; so does anything with attributes. - property (
*) - the key or attribute to look up. The tooltip notes JSON is accepted for arrays/objects, so you can pass something like["a","b"]for a nested path if the underlying implementation resolves it. - args (
*) - optional arguments passed along if the property turns out to be a function and gets invoked. For multiple args, provide a JSON array, e.g.[1,2,3].
Output is a single * - either the raw property value or the function's return. It's typed * because the wrapper can't know at graph-edit time which it'll be, so anything downstream should be tolerant.
Install
# via ComfyUI Manager: search "comfy-ovum"
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
# restart ComfyUI
Pure Python, no model downloads; the pack's dependencies (aiohttp, pillow, numpy, requests, etc.) are auto-installed by Manager, and underscore3 is bundled in the repo.
Where people get tripped up: if the property doesn't exist at all, _.result returns undefined/None, which then flows downstream as None and can silently break a node that expected a value. If you're reading from a dict you built dynamically, it's worth guarding upstream or checking with _.has first.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| objopt | * | Primary input object. Also accepts _.CHAIN to continue chaining. | |
| propertyopt | * | property: JSON allowed for arrays/objects where applicable. | |
| argsopt | * | args: JSON allowed for arrays/objects where applicable. For multiple values, provide a JSON array (e.g., [1,2,3]). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |