Int Math
The two-number integer arithmetic node inside Cyclist
- INT
Int Math does one thing: take two integers, apply an operation, hand back an integer. It's the plainest node in Cyclist and it's there for a reason - a loop that counts needs to do arithmetic on the count, and this is what does it. The headline use is the world's most useful boring operation: add one.
Why a loop needs it
Cyclist turns ComfyUI's queue into a loop, and the standard counter pattern is Recall Int → Int Math → Memorize Int. Recall pulls last iteration's count, Int Math adds 1, Memorize stores the new value, and next run you're one higher. That's your iteration index - feed it into a Compare Anything node to stop after N passes, or into a seed, or into a step schedule that changes as the loop progresses. You can also use it the way the pack's docs mention: "adding zero" is a cheap trick to turn a value into a plain constant you can wire into an input that won't otherwise accept a Primitive.
The inputs that matter
operation(enum) - one of eight:addition,subtraction,multiplication,floor division,modulo,exponentiation,max,min. Note it's floor division (integer result, rounds down) and there's amodulofor wrap-around counters - handy if you want a count that cycles 0,1,2,0,1,2.int_1(INT, default 1) - the first operand, the "upper" value.int_2(INT, default 1) - the second operand.
Output is a single INT. Order matters for the non-commutative ops: int_1 - int_2, int_1 // int_2, int_1 % int_2, int_1 ** int_2.
Install
- ComfyUI Manager: search comfyui-cyclist, install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/Pos13/comfyui-cyclist, restart.
Pure Python, nothing to download.
Honest take
If you already run a math-and-utility pack - pythongosssss' Custom Scripts, WAS Node Suite, rgthree, or any of the dozen "number" nodes floating around - you don't strictly need Int Math; those cover the same ground and more. Its reason to exist is convenience inside a Cyclist loop, sitting right next to Recall/Memorize in the same menu so you're not hopping between packs to wire a counter. That's genuinely nice, but don't install Cyclist for this node - install it for the loop machinery and enjoy Int Math as a freebie.
Two practical notes: watch operand order on subtraction/division/modulo/power (it's int_1 op int_2), and mind floor division and modulo by zero, which will error like any division by zero. And the pack-wide caveat: Cyclist is archived and unmaintained - this node is trivial enough that it'll keep working, but there's no support behind it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| operation | COMBO | 8 options: addition, subtraction, multiplication, floor division, modulo, exponentiation, +2 | |
| int_1 | INT | 1-9223372036854776000–9223372036854776000 | — |
| int_2 | INT | 1-9223372036854776000–9223372036854776000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |