_.isNumeric
So, is that widget value actually a number? Ask this node.
- obj
- *
ComfyUI hands you numbers from all sorts of untrustworthy places. A widget reader turns a steps value into a string. A metadata parser returns "30" with invisible whitespace. A wildcard processor spits out a number, maybe. Before you feed any of that into a KSampler or a math node, wouldn't it be nice to just ask is this actually a number? That's exactly what _.isNumeric does.
What it is
It's one node in the ovum/underscore family inside sfinktah/comfy-ovum. That whole family is graph wrappers around underscore3, a Python port of Underscore.js, and _.isNumeric wraps the isNumeric check. The nice part: its definition of "numeric" is friendlier than Python's type() dance. It returns true for ints, floats, and bools, and also for strings that look like numbers - "42", "3.14", "-2", "1e5" all count. "abc" doesn't.
So the classic use is a guard: parse a value from text, run it through _.isNumeric, and branch on the boolean before you let it anywhere near a math node. One cheap check saves you from a workflow that dies halfway through because int(" 30") decided to be uncooperative.
How it works
The node has a single optional input, obj (type *, so anything goes). Wire in any value and you get one output. Feed it a plain value and you get true/false back. Feed it a _.CHAIN - the output of _.chain or another underscore node - and it returns a chain instead, so you can keep the pipeline going and pull the real result out later with _.value.
One quirk worth knowing: the output is typed * (ANY), not BOOLEAN. The pack's code generator only stamps the proper BOOLEAN type on a fixed list of method names, and isNumeric isn't on it - even though at runtime it returns a genuine Python bool. That matters if a strict downstream node refuses to accept a * socket where it wants a BOOLEAN. A cast node or a boolean helper in the same pack fixes it in one hop.
Installing comfy-ovum
This node ships in sfinktah/comfy-ovum, so installing the pack gets you the whole underscore family plus the author's other utilities. Easiest path is ComfyUI Manager: search for comfy-ovum, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
pip install -r comfy-ovum/requirements.txt
Then restart ComfyUI. No model downloads, no CUDA, nothing GPU-specific - this is a pure-Python utility pack. Its real dependencies are eight small libraries (aiohttp, braceexpand, markdown-it-py, numpy, pillow, pymediainfo, requests, tomli-w), which Manager will pull for you.
Gotchas
Two things. First, remember True counts as numeric - bools are ints in Python, and this node inherits that. If you're testing user input, that's fine; if you're testing a flag, expect true back. Second, take the author's own warning about the underscore family seriously: the README calls it a work in progress and "an absolute disaster to use in production." For a one-node sanity check inside a workflow you control, it's fine. For workflows you'll hand to strangers, maybe hold off.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| objopt | * | Primary input object. Also accepts _.CHAIN to continue chaining. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |