_.methods
List every callable on an object — the introspection node nobody knew they wanted.
- obj
- *
_.methods is the introspection node: give it an object and it returns a sorted list of the function names available on it. It's the node you reach for when you've got a mystery *-typed socket and you want to know what you can actually call on the thing inside - which, if you've spent any time with Comfy's ANY types, is a situation you've definitely been in.
What it is
Part of the ovum/underscore family in sfinktah/comfy-ovum, wrapping the methods method of underscore3, a Python port of Underscore.js. In the port it's an alias of functions: it walks the object's entries, keeps the ones whose values are callable, and returns them sorted. Give it a dict whose values are functions and you get the names back alphabetized. Give it a class-ish or module-ish object and you get its method inventory.
How it works
One optional input, obj (type *), accepts anything. One output, typed * (ANY) - at runtime it's a sorted list of strings, though the generator didn't stamp LIST on this method name. Chain mode works like the rest of the family: feed it a _.CHAIN from _.chain and you get a chain back, resolving the real list with _.value downstream.
Where it's actually useful
Debugging, mostly. Comfy's * type is famously permissive, and when a node rejects a connection or a preview shows something unexpected, you often can't tell what the object really is. _.methods tells you what's callable on it, which is a big clue. It pairs with _.keys (what names does it expose?) and _.isType (is this the class itself?) to triangulate the identity of whatever's flowing through your graph.
It can also be a real tool in meta-workflows: if you're assembling an object from the pack's dict utilities and plan to hand it to something that invokes methods on it, listing them first is a cheap sanity check.
The caveat
The output is a list of names - it doesn't call anything, and it doesn't tell you signatures or argument counts. For a genuinely useful method inventory you'll want to combine it with something that inspects further. And the family rule applies: like everything in this pack's underscore family, it's flagged as a work in progress, so use it as an aid, not as a foundation.
Installing comfy-ovum
ComfyUI Manager: search for comfy-ovum, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
pip install -r comfy-ovum/requirements.txt
Restart and you're set. No model downloads, no CUDA - pure-Python utilities with a few small dependencies. Niche, but the day you're staring at a mystery object, you'll be glad it's there.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| objopt | * | Primary input object. Also accepts _.CHAIN to continue chaining. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |