_.isNone
Checking for nothing in ComfyUI
- obj
- *
_.isNone is the one member of the ovum/underscore family that earns its keep in a real workflow. It answers a question you actually hit all the time: is this thing nothing? In ComfyUI, that means None - the Python None, which is what an unconnected optional input arrives as, and what a lot of custom nodes hand you when they have nothing to return. Being able to test for that explicitly is surprisingly useful, because most of the time a disconnected input just silently poisons everything downstream.
This is part of sfinktah/comfy-ovum, a personal grab-bag of Comfy utility nodes by Christopher Anderson (GitHub: sfinktah). The README describes it as "some custom nodes for Comfy that I just couldn't live without." _.isNone lives in the ovum/underscore family - graph wrappers over underscore3, a Python port of the JavaScript Underscore.js library. Just keep in mind the author's own warning about this whole family: it's a work in progress and "not recommended for use in workflows." Use the useful parts, skip the rest.
What it does
Mechanically it's dead simple. The node takes whatever you feed it, wraps it in an underscore chain (a deep copy, so your original isn't touched), calls the library's isNone method - which is literally obj is None - and unwraps the result. You get back a real Python boolean.
Two ways to use it:
- Feed it a plain value and you get the raw boolean out.
- Feed it a
_.CHAINfrom the_.chainnode (or any underscore node) and it runs on the wrapped object, passing the chain onward so you can keep chaining. The tooltip on the input says as much: "Also accepts _.CHAIN to continue chaining."
Inputs and outputs
obj- the one input, type*, optional, defaults toNone. Just what you'd expect: wire anything (or nothing) in here.- Output - a single
*socket holding the boolean result.
The one wart: the output is typed *, not BOOLEAN. The value really is a Python bool, but the socket is generic, so if you're feeding a node that strictly wants a BOOLEAN input you may need to route through a compare/cast node to satisfy the type checker. It's cosmetic in most cases - * connects to anything - but worth knowing when a downstream node refuses the wire.
Where it fits
The classic pattern is gating. Say an optional input on your workflow is wired through a dynamic node that sometimes returns nothing. Plumb _.isNone off that value, feed the boolean into an IfElse or a switch node, and let the graph take one path when the value exists and another when it doesn't. You can also use it to detect "this node never produced output" before you spend time VAE-decoding a None.
One trap: empty is not none. An empty list, empty dict, or empty string all pass an is None check with False - the thing exists, it's just empty. If you need "did anything actually come out," that's _.isEmpty instead.
Installing it
Install the whole pack via ComfyUI Manager - search comfy-ovum - or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Then restart ComfyUI. The underscore3 library is vendored inside the repo, so this node pulls in no extra Python package; the pack's requirements.txt (pymediainfo, tomli-w, requests, braceexpand, pillow, numpy, markdown-it-py, aiohttp) covers everything else, and Manager handles that automatically.
Gotchas
- Output is
*, notBOOLEAN- the value is correct, the wire type is loose. - The node deep-copies its input, so don't point it at a multi-gigabyte tensor batch just to ask "is it None?" - check the
Nonecase upstream instead. - This is the useful one of the family. Don't let the README's blanket WIP warning scare you off;
_.isNoneis simple enough to be safe, and it's the node I'd actually reach for.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| objopt | * | Primary input object. Also accepts _.CHAIN to continue chaining. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |