🔱 Artha Math F2I
Convert a float to an integer (and get the text for free)
- integer
- number
Artha Math F2I is the 🔱 Artha pack's float→integer converter. You feed it a FLOAT, it hands back an INT (the truncation of the value) plus a STRING version of that integer. It's a two-line utility node, and like most of the pack's Math family, its real value is in keeping types honest inside a graph where everything wants to be a slightly different type.
The pattern is everywhere in ComfyUI: a sampler outputs a float, a latent node wants an int, a text widget wants a string. F2I is the bridge for the "I have 1.8 and I need 1" case - and the second output means you don't need a separate number-to-text node just to display or stringify the result.
How it works
The node takes the float and applies Python's int() conversion - which truncates toward zero, not rounds. 3.9 becomes 3, -2.7 becomes -2. If rounding is what you actually want, do it upstream (or check the pack's Math Operation node, which has a round op). The outputs are integer (INT) and number (STRING, the same value as text).
Inputs that matter
- float - the input FLOAT. It's force-input, so it's designed to be wired from another node rather than hand-set.
Outputs: integer (INT) and number (STRING).
Installing it
One-pack install, same as all Artha nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/Cyrostar/ComfyUI-Artha-Nodes
pip install -r ComfyUI/custom_nodes/ComfyUI-Artha-Nodes/requirements.txt
restart ComfyUI, or install "ComfyUI-Artha-Nodes" through ComfyUI Manager. No API key, no models - pure Python casting.
Common issues
- "I expected 4, I got 3":
int()truncates, it doesn't round. That's the documented behavior here, not a bug. - Negative values surprise: truncation toward zero means
-0.9becomes0, not-1. If you need floor behavior, that's a different operation. - Wiring the STRING where a number is expected: the two outputs are typed differently for a reason - use
integerfor numeric inputs andnumberwhen a string/text widget is downstream.
The verdict: it's boring, and that's the compliment. When your float outputs won't fit an INT input, this is the two-second fix, and the bonus string output saves you a node later.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| float | FLOAT | 0.00 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| integer | INT | — |
| number | STRING | — |