Ino Math Int
Integer math inside the graph, with divide-by-zero that won't kill your batch
- int
- float
Sometimes you need to compute a number mid-workflow: steps divided by some factor, a batch size that scales with an input, a seed offset. Ino Math Int is a pocket calculator for the graph - two integers in, one of six operations, and the result out. Nothing fancy, and that's the point; it's the kind of node that quietly keeps an automation pipeline running instead of making you hardcode values that change.
The six operations are add, subtract, multiply, divide, modulo, and power. You pick with a dropdown, and you get the result twice - once as an int, once as a float. That dual output is the subtle bit: it exists because integer division and true division are different things, and the node doesn't want to force you to choose at the wrong end of the graph.
How it works
Straightforward arithmetic. The one behavior worth knowing before you hit it: divide and modulo return 0 when the divisor is zero rather than raising an error. That's a deliberate choice - in a long-running batch, a division by zero that halts the whole graph at frame 400 is a disaster; a 0 that you can detect and route around is a nuisance. If you need to know whether it actually divided, check your inputs, because a 0 result is ambiguous between "genuine zero" and "guarded zero."
For power, it's int_a ** int_b - which means a negative exponent or a large one can produce results that overflow the INT output's expectations, though the float output will usually tell the story.
Inputs and outputs
- int_a, int_b - the two operands, both default 0.
- operation - dropdown: add, subtract, multiply, divide, modulo, power.
Outputs: int (the result, truncated to an integer - division rounds down, not to nearest) and float (the same result as a float, which for division is the true quotient).
Installing it
Ships in ComfyUI-InoNodes (Inoland). ComfyUI Manager → search "ComfyUI Ino Nodes" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/nobandegani/comfyui_ino_nodes
cd comfyui_ino_nodes
pip install -r requirements.txt
Restart after. Requires inopyutils (auto-installed) and a recent ComfyUI; no keys or models.
Common issues
The int output truncates, it doesn't round - so 9 / 2 gives you 4 on the int port and 4.5 on the float port. If a downstream node silently eats the fraction, that's the cause. And keep the divide-by-zero guard in mind: it's a feature for resilience but a silent failure for correctness, so if a computed value unexpectedly lands on 0, suspect a zero divisor before anything else.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| int_a | INT | 0 | — |
| int_b | INT | 0 | — |
| operation | COMBO | 6 options: add, subtract, multiply, divide, modulo, power |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| int | INT | — |
| float | FLOAT | — |