String to Float
Text that claims to be a number — parsing it properly
- float
Somewhere in your workflow there's a string that's really a float - a "0.65" pulled from metadata, a denoise value read out of a filename, a number a user typed into a text box. ComfyUI won't let you feed that text to a node that wants a FLOAT. ZeugStrToFloat is the parser that makes it numeric again.
What it is
ZeugStrToFloat lives in the zeug → Convert menu. Input text is a STRING (default "0.0", single-line). Output is a float. Give it "0.65", get 0.65. The node strips surrounding whitespace before parsing, so " 0.65 " from a sloppy filename works too.
When you'd reach for it
- Reading a float back out of metadata or a filename so you can reuse it as a real setting.
- Turning user-entered text into a typed float for a node that refuses strings.
- Round-tripping: whatever you wrote with ZeugFloatToStr, this node reads back.
It's the float sibling of ZeugStrToInt, and the two sit together in the Convert menu. If you're parsing text that might contain a decimal, reach for this one - the int converter will reject "3.7" outright, and this node will parse it happily.
How it works
Same shape as the int converter:
result = float(text.strip())
Strip whitespace, parse as float. And the same honesty rule applies, in stronger form: if the text can't be parsed, the node raises ValueError: Cannot convert '<text>' to a float. and the whole workflow stops. There's no fallback, no coercion, no "close enough." "0.7x" fails. An empty string fails. "hello" fails with that exact message.
Also worth knowing: it's a float parse, so it accepts scientific notation and the like - "1e3" becomes 1000.0. That's rarely what you're doing, but it's harmless and it means the parser is a real one, not a toy.
How to install it
Ships in comfyui-zeug (German for "gear" or "stuff"), a small GPL-3.0 pack 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. Zero dependencies, no model downloads - the pack only touches torch and ComfyUI's own modules.
Common issues
The ValueError is the headline. When it fires, don't treat it as a mystery - inspect what string actually arrived. Usual culprits: an empty value from an unconnected source, a trailing non-numeric character, or a string that was silently set to something like "None" by a node upstream. Fix the text, not the converter.
Second, remember the type boundary: this node is strictly string-in, float-out. If your source is already a FLOAT and you're trying to feed it here, ComfyUI will refuse the wire - you don't need a converter for a float, you need it only for text. Use ZeugFloatToStr for the reverse direction.
For anything that genuinely is a decimal in text form, this node is the boring, reliable answer.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | 0.0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| float | FLOAT | — |