_.isIntString
The safe 'string is a plain integer' check before you convert
- obj
- *
Here's a workflow bug everyone hits eventually: a text field is supposed to contain a number, someone (or some node) puts garbage in it, and your int-conversion node throws at the worst possible moment. _.isIntString from the sfinktah/comfy-ovum pack is the guard for that exact failure - it checks whether a string is made of nothing but digits, before you ever call int() on it.
It's part of the ovum/underscore family, the auto-generated wrappers around underscore3, a Python port of Underscore.js. The family's README warns it's work in progress and "not recommended for use in workflows" - the standard caveat for this auto-generated zoo. This node's logic is short and worth reading, because its definition of "int string" is narrower than you might assume.
What it does
The implementation iterates the string's characters and returns False the moment it finds any character outside 0–9. If every character is a digit, it returns True. That gives you a very specific definition:
"42"→True.""→False(the loop never sees a digit, so it never flips to true)." 42"→False(space isn't a digit)."-5"→False(minus sign isn't a digit)."12.5"→False(decimal point isn't a digit)."123abc"→False.
So it accepts unsigned, non-negative integers with no whitespace and no sign. No leading +, no -, no spaces, no decimals. If your inputs can legitimately be negative or have surrounding whitespace, this node will say False and you'll need to trim or handle signs yourself.
Like the rest of the family, it takes a plain value and returns the boolean, or takes a _.CHAIN from _.chain and keeps the chain going.
Inputs and outputs
obj- the only input, type*, optional. It's meant for a string, but the socket is generic.- Output - a single
*socket holding a Python bool (the family's generic-typed output quirk).
Where it fits
The classic pattern is a guard in front of conversion: wire a user-typed string (or a value scraped out of a filename or prompt) into _.isIntString, feed the boolean to a branch, and only run the int() conversion on the path where it's True. Otherwise route to a default. It also pairs naturally with the pack's string utilities - check the string, then format or convert it confidently. If you're building filenames with zero-padded counters from untrusted text, this is your insurance.
Installing it
Install the pack via ComfyUI Manager - search comfy-ovum - or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart ComfyUI. underscore3 is bundled in the repo, so no extra pip install for this node; Manager handles the pack's requirements.txt for everything else.
Gotchas
- It's digits-only: no signs, no decimals, no whitespace, no empty strings. A negative number or a padded string reads as
False. - The value passed must actually be a string for the digit loop to make sense - feed it a number and the
for c in self.objiteration behaves oddly (iterating an int raises). - Output wire is
*, notBOOLEAN. The bool is real; the socket label is generic.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| objopt | * | Primary input object. Also accepts _.CHAIN to continue chaining. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |