Nodes/comfy-ovum/_.isSlice
ComfyUI Node

_.isSlice

Yes, it checks for Python slice objects. No, you probably never needed that.

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

Let me be straight with you: _.isSlice is the most niche node on this page. It checks whether the object on its input is a Python slice object - the thing behind [start:stop:step] syntax. In normal Comfy work, a bare slice object basically never appears on a wire. You'll see lists, dicts, tensors, strings, but an actual slice(0, 5)? Practically never.

Why it exists anyway

The ovum/underscore family in sfinktah/comfy-ovum is auto-generated: the pack's code walks every method on underscore3 (a Python port of Underscore.js) and mints a Comfy node for it. The port got thorough with its type guards - there's isSlice, isTraceback, isFrame, isModule, a whole museum of Python's internal types. So this node isn't there because someone needed it; it's there because the generator found a method. That's the price of auto-generation, and honestly it's harmless.

How it works

The check is type(obj) is type(slice) - strictly, is this a slice instance. One optional input, obj (type *), accepts anything. One output, typed * (ANY), which at runtime is a Python bool - the generator didn't stamp the BOOLEAN type on this one, so a strict boolean socket may want a cast. And like every node in the family, you can feed it a _.CHAIN from _.chain to keep chaining instead of getting the plain value out.

The one scenario where it could matter

Suppose you're building something meta - a workflow that receives a slice from a custom or LLM node to represent a frame range or an index span, and you want to verify the type before slicing a list with it. _.isSlice gives you that guard, and combined with a conditional you can fall back to a list input. It's a legitimate edge case, just a rare one.

Installing comfy-ovum

Via 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 ComfyUI and you're done. No model downloads, no CUDA - it's a pure-Python utility pack with a handful of small dependencies.

Honest verdict: if you're browsing the node menu and see _.isSlice, you can safely skip it. It's a curiosity, not a tool. If you ever do need a slice-type test, it's sitting right there. And if you find yourself reaching for it often, you're probably doing something far more interesting than the average Comfy user.

Categoryovum/underscore

Inputs (1)

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

Outputs (1)

NameTypeDescription
**