Convert any to INT and add 1
Turn anything into an INT and bump it by 1
- value
- INT
PlusOne's full name is "Convert any to INT and add 1," which is the whole spec in eight words. Feed it anything, it coaxes it into an integer and hands back that integer plus one. It's the kind of node you don't think you need until you're building a loop, a counter, or a seed stepper and you realize ComfyUI has no native "increment this" anywhere in sight.
When you'd reach for it
Anywhere you're counting. Loop over a list with an index that needs to advance each pass, step a seed across a batch of generations, tick a filename counter, or drive a "next iteration" value for a feedback pattern. The ovum/loop category it lives in is exactly that: small logic helpers the author of the comfy-ovum pack built because he couldn't live without them.
How it works
The interesting part is the coercion, because the input is a wildcard * and can be anything. Internally it:
- Resolves the incoming value - the node runs with
INPUT_IS_LIST, so it inspects what your upstream node actually declared and either keeps a batch or unwraps the single value. - Coerces to int via the pack's
coerce_any_to_inthelper. That helper handles:- bools -
Truebecomes 1 - floats - truncated toward zero, so
4.9becomes4 - ints - passed straight through
- strings - tries plain
int("7"), and if that fails, evaluates basic math expressions, so"3*4"becomes 12,"10-2"becomes 8
- bools -
- Returns
n + 1.
That "evaluates math in strings" bit is the hidden superpower. You can wire a text input saying "steps-1" and get a usable number out, which makes PlusOne genuinely flexible in dynamic workflows where values arrive as strings.
Inputs and outputs
- value (required,
*) - anything that can be coerced to an int. - INT (output) - the coerced value plus one.
That's it. One input, one output, no widgets to fiddle with. If you need the reverse, the pack ships a matching MinusOne ("Convert any to INT and subtract 1") with identical semantics.
Installing it
The node is part of the comfy-ovum pack:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Then restart ComfyUI. Or use ComfyUI Manager → search "comfy-ovum" → Install, which handles the pack's dependencies for you. There are no model files involved - this is pure logic.
Common gotchas
- Floats truncate, they don't round.
int(4.9) + 1 = 5, not 6. If you need rounding, round upstream. - Coercion failures don't crash ComfyUI, but they do return junk. A string it can't parse as a number or expression can throw; the pack's loop nodes generally expect clean input.
- Don't use it where the value is already an INT. It works fine, but you're adding a node that forces re-execution each run for zero benefit. Use it where types are genuinely messy - that's what it's for.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |