Float
The Float that rounds on its way out
- float
IPT-Float solves the oldest problem in ComfyUI: you need the same number in five different places, and typing it into five different widgets means changing it in five different spots. This is the "one source, many consumers" pattern - a value node you drop on the canvas, set once, and fan out to every converted input that needs it. If you've used core PrimitiveFloat, you already know the shape. The thing this one adds is the second widget: decimals, which rounds the value before it leaves the node. Nothing else in the pipeline has to remember to round.
It ships in kinorax/ComfyUI-Info-Prompt-Toolkit (IPT), a big utility pack built around an image_info object that bundles your prompt, model, sampler and settings into one wire. This node is its smallest resident, and it's exactly the kind of plumbing the whole pack assumes you have around. As a standalone value source it works fine outside the pack's image-info workflow too - a float is a float.
How it works
value is the number, decimals is how many digits you want after the decimal point (0 to 10, default 2). The node formats and rounds to that precision and outputs a plain FLOAT. That's the entire job. The rounding is the part core's primitives won't do for you: Python floats accumulate noise fast (0.1 + 0.2 is famously not 0.3), and if you're feeding a value through several calculation nodes before it lands in a sampler, a round to two decimals on the way out kills a lot of that drift. The output is just a number - wire it into any FLOAT input.
The inputs that matter
- value - the number. Default 0, steps of 0.01.
- decimals - digits after the decimal point, 0–10, default 2.
One output: float. That's it. There's no model, no file, no state - if you convert a widget elsewhere to an input and connect this, that widget now follows this node's value everywhere.
Installing it
This is a node from the IPT pack, so install the pack once:
cd ComfyUI/custom_nodes
git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
cd comfyui-info-prompt-toolkit
pip install -r requirements.txt
Then restart ComfyUI. ComfyUI Manager can do all of that for you - search the pack title "ComfyUI-Info-Prompt-Toolkit" - and Manager's Install Missing Custom Nodes will pull it automatically when you load a workflow that uses it. The pack's requirements (cryptography, timm, ftfy, regex, iopath, typing_extensions) are nothing you need to think about for this node; they serve the pack's other features.
Where people get burned
Honestly, not much to burn you here. The one trap is treating decimals as a display setting when it actually rounds the data. Python's float formatting rounds halves to even, so with decimals set to 0, a value of 0.5 comes out 0.0 and 1.5 comes out 2.0 - the kind of surprise that makes people think the node is broken when it's just doing banker's rounding. If a downstream sampler suddenly sees integer-like steps, check whether you rounded a value that needed its precision. And remember the value node convention: type the number here, not in the consumers, or you're back to five widgets. For everything else, this is the boring, dependable node you drop in once and forget.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| value | FLOAT | 0.00 | Float value |
| decimals | INT | 20–10 | Number of digits after decimal point |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| float | FLOAT | — |