Float to String
Getting a float into your strings, decimals and all
- string
Denoise strength. CFG scale. Guidance. A lot of the numbers you care about are floats, and a lot of the places you want to write them - filenames, metadata, debug labels - are strings. ZeugFloatToStr is the converter that turns 0.7 into "0.7" so you can glue it onto the rest of your text.
What it is
ZeugFloatToStr lives in the zeug → Convert menu. One input, value, a FLOAT (default 0). One output, string. Feed it a float, get its textual form. The implementation is a plain str(value), which matters more than it sounds like it should.
When you'd reach for it
- Metadata and workflow notes - writing your denoise or CFG into saved metadata so a run is reproducible from the PNG.
- Filenames -
"denoise_0.7.png"needs that float rendered as text. - Debugging - turning a live float value into text so a print or display node can show it alongside other labels.
If you've ever stared at a filename template that output denoise_0 and wondered where the .7 went, this is the fix: an INT-to-string converter would have quietly dropped the fraction, but this node keeps the decimal. Use ZeugIntToStr when the number is whole, ZeugFloatToStr when it isn't - and honestly, most people keep both in their toolkit because you never know which one a value will be.
How it works
Straight str(value), no formatting options. That has two honest implications:
0.7becomes"0.7",7.0becomes"7.0"- the.0is preserved, which may or may not be what your filename wants.- There's no precision control here. Want
"0.700"or a rounded"0.71"? Not this node's job. You'd have to round the float upstream with a math node first, because the converter faithfully renders whatever float it's handed.
The one thing it shares with its sibling converters: it doesn't second-guess types. Float in, string out, no silent truncation.
How to install it
Part of comfyui-zeug (German for "gear" or "stuff"), a small GPL-3.0 collection by Adrian Schubek:
- ComfyUI Manager: search
zeugin the Custom Nodes Manager, install ComfyUI-Zeug. - Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/adrianschubek/comfyui-zeug
Restart ComfyUI. The pack declares no dependencies and downloads no models - it only uses torch and ComfyUI's own modules, both already installed. Painless.
Common issues
Two predictable snags:
- The
.0surprise. A whole-valued float like2.0stringifies as"2.0", so filenames get an unexpected decimal. If that bugs you, round to an int upstream when you know the value is whole - or just accept it; it's harmless in metadata. - Feeding it an int. ComfyUI may refuse the wire if your source is an INT node. The converter is strictly float-in; for whole numbers use ZeugIntToStr. If your value could be either, decide the type at the source and pick the matching converter.
That's it. For getting decimals into text without drama, this is the node.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | FLOAT | 0.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| string | STRING | — |