Nodes/comfy-ovum/_.getmanyattr
ComfyUI Node

_.getmanyattr

_.getmanyattr

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

_.get pulls one field. _.getmanyattr pulls several in one call and hands you the values as a list. The docs put it as getmanyattr(object, name1, name2, ..., default) - so getmanyattr(x, 'y', 'z', None) is equivalent to [x.y, x.z], with a fallback for anything that doesn't exist. One round trip, one list out, fewer nodes in your graph.

It's part of the _.* family in sfinktah/comfy-ovum, the author's grab-bag pack, wrapping underscore3 (a Python port of Underscore.js). Display name _.getmanyattr, class UnderscoreGetmanyattr.

The inputs that matter

  • obj - the object to read from (loose *; also accepts a _.CHAIN).
  • args - the attribute names, as a loose * input that takes JSON where applicable. The tooltip is the key detail: "For multiple values, provide a JSON array (e.g., [1,2,3])" - so type your field names as a JSON list like ["seed", "steps", "cfg"].

Output is a loose * - in practice a list of the values in the order you asked, with the default standing in for anything missing.

Why you'd reach for it

When you're harvesting a handful of known fields from a dict or object and don't want a web of _.get nodes. Think of a metadata map where you want ["model", "sampler", "seed"] all at once to feed a string formatter or a label builder. It's tidy for exactly that shape - a fixed set of keys, one list downstream.

Install

ComfyUI Manager, search "comfy-ovum", or:

cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum

Restart, under ovum/underscore. No models, no downloads.

Honest warnings

Family disclaimer: work in progress, "an absolute disaster to use in production." Same single-key philosophy as _.get - this fetches named attributes/keys, not deep paths, so don't hand it dotted paths and expect nesting. And remember args wants a JSON array; a bare comma-separated string won't parse the way you'd hope. Chain rule: chain in, chain out, _.value to unwrap.

Categoryovum/underscore

Inputs (2)

NameTypeDefaultDescription
objopt*Primary input object. Also accepts _.CHAIN to continue chaining.
argsopt*args: JSON allowed for arrays/objects where applicable. For multiple values, provide a JSON array (e.g., [1,2,3]).

Outputs (1)

NameTypeDescription
**