Integer
A whole-number source that also rounds floats to int
- INT
Holds a whole number and outputs it as an INT. This is the one you reach for constantly, because so many things in ComfyUI want integers: widths, heights, seeds, offsets, step counts, batch sizes. Set the number once, wire it into every node that needs it, and you've got a single dial to turn instead of five scattered widgets.
It's a "Variables" node from Derfuu_ComfyUI_ModdedNodes, the utility pack built around treating a workflow like a program with named values and math.
The quietly useful part
Here's the bit worth knowing: the Value widget is actually a FLOAT field, and the node outputs an INT. So it doubles as a float-to-integer converter. Type 2.7 and it emits a whole number - which is exactly what you want when a math chain produces a decimal but the target (an Empty Latent's width, say) demands an integer. The pack's README says as much: Integer is "used to set width/height and offsets mainly, also provides converting float values into integer."
That makes it the natural cap on a size calculation. Read an image's dimensions with Get image size, Multiply by a ratio, and the result is a float - pipe it through Integer to get a clean whole number your resize or latent node will accept.
The inputs and outputs
Value(FLOAT, default 1, step 1) - type or wire in the number.- Output
INT- the whole-number result.
One input, one output, no fuss.
Where it fits
Two roles. As a constant: one place to set a dimension or seed that several nodes share. As a converter: the last link in a math chain that turns a computed decimal into the integer a downstream node requires. In practice the second role is why people wire it into their graphs rather than just typing numbers.
Note that ComfyUI has core primitive nodes and other packs (rgthree, KJNodes) offering integer sources too - Derfuu was just one of the early ones. Any of them work; this one's fine and lightweight.
Common issues & troubleshooting
"Expected INT, got FLOAT" downstream - I thought this fixed that. Make sure the wire actually comes from the INT output of this node, not from an upstream float node you accidentally connected past it. The conversion happens through Integer, so it has to be in the path.
How does it round? It converts the float to an int - don't rely on a specific rounding rule for edge cases; if you need explicit ceil/floor behavior, the pack has dedicated Ceil and Floor converter nodes for that.
Node red / missing after an update. Derfuu has removed old node classes on reorg before instead of deprecating them, which can break saved graphs. Update via Manager and re-add.
ModuleNotFoundError: No module named 'custom_nodes.Derfuu_ComfyUI_ModdedNodes'. Old workflow pointing at a moved module path. Update, reload, replace the node.
Install: ComfyUI Manager → search "Derfuu" → install → restart, or cd ComfyUI/custom_nodes && git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes then restart. No models, no heavy dependencies.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| Value | FLOAT | 1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |