Nodes/comfy-ovum/_.isTuple
ComfyUI Node

_.isTuple

Tuple or list? This is how you tell them apart without guessing.

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

A surprising amount of stuff in Comfy arrives as tuples. Dimension pairs come back as (1024, 576). Some VAE and video helpers hand you (flag, list) combos. Tuple and list behave identically for indexing, but differently for mutation, and plenty of strict nodes insist on one or the other. _.isTuple is the two-second check that settles which one you're holding.

What it is

It's part of the ovum/underscore family inside sfinktah/comfy-ovum, the pack's graph wrappers around underscore3, a Python port of Underscore.js. This node wraps the isTuple method, which is just type(obj) is tuple - a strict test, no inheritance tricks. If you hand it a list, you get false, even though a list and a tuple look almost identical on screen.

How it works

One optional input, obj (type *), accepts anything. One output, typed * (ANY) - a runtime Python bool, though the generator didn't stamp BOOLEAN on this method name, so a strict boolean socket might want a cast from one of the pack's cast nodes. Feed it a plain value and you get true/false out. Feed it a _.CHAIN from _.chain and you get a chain back instead, with the result pulled out later by _.value.

Where it earns its keep

Pair it with a conditional to normalize a value before it hits something picky. Classic pattern: if _.isTuple says true, convert to a list (the same pack has list-conversion and casting helpers); if it's already a list, pass it through. That kind of "accept either shape" glue is exactly what keeps a shared workflow from exploding when one contributor wires a tuple and another wires a list into the same input.

It's also a decent debugging tool. A *-typed socket can hide what it's actually carrying, and a quick _.isTuple check tells you whether the thing refusing to connect is a tuple-shaped problem.

Installing comfy-ovum

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

Restart and you're done. No model downloads, no CUDA - it's a pure-Python utility pack with a few small dependencies. One footnote: the README itself labels the underscore family a work in progress and not recommended for production, so treat this as a handy helper rather than a pillar of a workflow you'll share widely.

Categoryovum/underscore

Inputs (1)

NameTypeDefaultDescription
objopt*Primary input object. Also accepts _.CHAIN to continue chaining.

Outputs (1)

NameTypeDescription
**