Int Operation
Integer arithmetic with a division quirk you'll want to know about
- result
Where Float Operation handles the fractional stuff, Int Operation is its integer sibling - and INT is ComfyUI's language for things you count. Batch sizes, step counts, seeds, tile numbers. When a workflow needs "twice the batch" or "half the steps," that's integer math, and that's this node's whole job.
It works exactly like Float Operation: a Python match statement over a +, -, *, / dropdown, two numbers in, one number out. The interesting part is how division behaves. The code computes int(operand_a / operand_b) - it divides as floats, then truncates toward zero. So 7 / 2 gives 3, not 3.5. And -7 / 2 gives -3 - which is not floor division (that would give -4). Truncation, not flooring. If you're comparing step math across nodes or scripts, that distinction occasionally bites.
The inputs that matter:
operand_a,operand_b- the two INT values. Type them or wire them from an INT output (seed, batch size, step count).operator- the dropdown:+,-,*,/.
Output is a single result (INT). Wire it into any INT input - KSampler steps, batch_size, seed arithmetic, tile counts for an upscaling pass. Division is the one you'll actually reach for: "run at half the steps" is just steps / 2. Just remember you lose the remainder, so for finer control you want the pack's float node (or its Int-to-Float converter) and rounding later.
Installing it
Same as the rest of the pack - ComfyUI Manager, search "Mewins Node Pack", install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/efuentesamin/mewins_node_pack
No dependencies to pip and no model files to download - pyproject.toml lists zero runtime deps. The one requirement that can trip you: the pack declares Python >= 3.12, so a ComfyUI running on 3.10/3.11 may fail the version check at install.
Gotchas
- Division by zero is unguarded. Set
operand_bto0with/selected and the node raisesZeroDivisionError, killing the run. It's the classic "why did my graph die" culprit in this pack. - Truncation silently drops the remainder.
7 / 2 = 3. If you actually wanted3.5, you're in the wrong node. - One operator at a time. Chained math means stacking nodes or using core MathExpression.
Context worth having: this is a small, single-commit pack whose README is still boilerplate ("A list of features"). Don't expect an ecosystem staple - but for one visible integer operation, it does exactly what it says, with zero dependencies to fight and no model downloads lurking.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| operand_a | INT | — | |
| operand_b | INT | — | |
| operator | COMBO | 4 options: +, -, *, / |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | INT | — |