Boyo Math Int
Integer Math for When Your Loop Math Stops Being Mental
- INT
The moment your ComfyUI graph stops being a straight line and starts being a loop, you need arithmetic that runs inside the graph - and that's where BoyoMathInt earns its keep. It's a tiny node: two integers in, one integer out, with a dropdown choosing the operation. Nothing about it is glamorous. What it saves you is the misery of hand-computing frame offsets every time you change a chunk size in a video loop.
What it does
Feed it a and b plus one of six operations:
add/subtract/multiply- the obvious onesdivide- integer (floor) division, not floatmodulo- remainder, great for wrap-around logicpower-araised tob
Output is a single INT. Because it's just a number, you can chain it, or drive it from a loop counter to compute things like frames_processed = counter * chunk_size + offset - the same calculation the pack's Boyo Frame Counter exists for, except this one is general.
The trap that will bite you
divide is floor division (a // b in Python), so 5 / 2 returns 2, not 2.5. That's almost always what you want for frame math - you can't have half a frame - but if you're porting a formula from a calculator, it'll quietly round down. And division by zero will throw and kill the queue, so clamp your inputs if they can plausibly be zero.
Where it fits
BoyoMathInt lives in the pack's loop toolkit, alongside BoyoPromptLoop, BoyoOverlapSwitch and the while/for loop nodes. Typical wiring: a loop counter feeds a, your chunk size feeds b, and the result feeds a video combine or a latent switch that needs a frame offset. You can also use it standalone for any integer computation you'd rather not do in your head - e.g. modulo to cycle a seed, or power for a quick resolution multiplier.
Installing it
It's part of Boyonodes, so install the pack once:
cd ComfyUI/custom_nodes
git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
Restart ComfyUI (or use ComfyUI Manager, search "Boyonodes"). This node has zero extra dependencies - pure integer arithmetic. If ComfyUI Manager tries to install the pack's full, heavy requirements.txt (which exists for the TTS and voice nodes), you can safely ignore failures there; Math Int runs regardless.
Bottom line
Is it a node you'll blog about? No. Is it the difference between guessing a frame count and computing it? Yes. If you're building looped video workflows, throw it in next to your counter and never reach for a calculator again.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | INT | 0 | — |
| b | INT | 0 | — |
| operation | COMBO | 6 options: add, subtract, multiply, divide, modulo, power |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |