FloatToString-badger
Turn a number into text — for filenames, prompts, and anything else that wants words
- STRING
Numbers and words are different types in ComfyUI, and the graph does not let you fake your way across. FloatToString-badger is the bridge: FLOAT in, STRING out, nothing else happens. It's one of the two conversion nodes the pack author bothered to name in the two-line README, right next to its sibling FloatToInt-badger - clearly the tools they personally kept grabbing.
The practical use is boring and constant: building filenames. You've got a denoise value, a cfg that landed at 6.4, a timestamp-ish number - and you want it in the filename so you can tell at a glance what produced this output. File-saving nodes eat strings, not floats. So the pattern is: value → FloatToString → concatenate with your prefix/suffix (a text concat node, or the pack's IntToStringAdvanced-style helpers) → filename port. Boom, your PNG is called hero_denoise_0.64_cfg_6.4.png instead of output_0001.png.
You can also inject numbers into prompts - "a portrait of a 1.5x scale version" is silly, but dynamic prompt generation with computed values is a real use - or into any node with a string port that's being fed a number you want to keep as-is.
How it works
str(float), literally. 6.40 comes out as "6.4" - Python drops trailing zeros - and it preserves the full precision you gave it, so a value like 0.10000000149 will print exactly that unless it was already rounded upstream. If your filename needs a fixed decimal count, round the float first (FloatToInt won't help there - you want a value-rounding node) or the string will carry whatever digits the number has.
Inputs and outputs
- float - input FLOAT, default 1.0, min 0, max 10, with a very fine 0.00001 step. Note that max is 10, which is fine for cfg, denoise, and most multipliers, but you can't throw a 4-digit number at it - that's what the schema enforces.
One output: a STRING.
Installing it
In the ComfyUI_BadgerTools pack: ComfyUI Manager (search "BadgerTools") or
cd ComfyUI/custom_nodes
git clone https://github.com/AbyssYuan0/ComfyUI_BadgerTools
Restart afterwards. No model files. Standard pack caveat: heavy requirements import at startup even for this trivial node, so first boot after install is slow.
Gotchas
- 10 is the ceiling. Feed it a large float and the widget won't accept it - this is the node's least-obvious limit. For bigger numbers you'd want an expression node, not this.
- Trailing zeros vanish. If you need "6.40" you won't get it from
str(); format it elsewhere. - It converts, it doesn't format. No decimal padding, no scientific-notation handling. Plain text of a plain number.
There's no community wiki on a node this small - it's a personal-pack utility, and the honest review is "it converts floats to strings." When that's exactly the gap in your filename pipeline, a two-input utility node is the cheapest fix in the ecosystem.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| float | FLOAT | 1.00000–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |