Multiply Int
Integer math without the type mess
- value
Every workflow eventually needs a little arithmetic, and it's usually multiplication: width × batch count, base resolution × scale factor, steps × repeats. Multiply Int is the version that keeps the result an integer, so the output plugs straight into the next INT socket without a cast in between. Two INTs in (a, b), one INT out (value). That's the whole contract.
The "Int" in the name is doing real work. The generic Multiply node in the same pack resolves types automatically - INT × INT gives you INT, INT × FLOAT gives you FLOAT - which is usually what you want. This one forces the integer path: it multiplies and then explicitly casts the result back with int(). That makes it the safer pick when you're computing a dimension, a batch size, or a count, and the wrong type would break a downstream socket or silently truncate later.
Inputs and outputs
a(INT),b(INT) →value(INT).
Both inputs are plain wires; either can come from an Int constant node, another math node, or any integer-valued source.
How it works
Straightforward: a * b, then an int() cast on the result. Where people get tripped up isn't the math - it's expecting the integer guarantee from a generic multiply node and getting a float back. If you want the guarantee up front, this is the node.
Where it fits
The classic use: compute a target resolution from a base size. Base 512 × an upscale factor of 2 → 1024, wired directly into an Empty Latent Image or resize node's width socket. Or take a per-batch count and multiply it up for a loop. Pair it with FairLab's Int constant nodes at the top of the graph and you get a "settings row" whose numbers all flow as clean INTs.
Install
One pack, standard install:
cd ComfyUI/custom_nodes
git clone https://github.com/yanhuifair/ComfyUI-FairLab.git
cd ComfyUI-FairLab
pip install -r requirements.txt
or via ComfyUI Manager (search ComfyUI-FairLab), then restart. This node runs with no pack-specific dependencies - the requirements list only matters for FairLab's image, video, and translation nodes. Look under Fair/logic.
Gotchas
- It truncates rather than rounds, because it's an integer cast. 7 × 3 gives 21, and 7 × 3.4 isn't even possible here (both inputs must be INT) - so there's no rounding surprise in normal use.
- If you multiply two integers and know you'll need a float later, you're better off keeping them as floats from the start or running the result through FairLab's
Int To Floatwhen you actually need it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| a | INT | — | |
| b | INT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | INT | — |