EmAySee Float To Text
A float, dressed up as prompt text — strength values without the typing
- text
- float
Sometimes you want a number inside a text string - a strength, a weight, a scale - and ComfyUI's normal float widget can't reach inside a text box. This node converts a float to text, wraps it in a format you'd actually use in a prompt, and also passes the original float through untouched. It's a two-for-one: the text version for concatenation, the float version so you didn't lose the number on the way through.
How it works
The conversion is a single line: f"({prefix}:{value}{suffix})". Give it a float and it wraps it in parentheses with a prefix, a colon, the value, and a suffix. The shape is deliberately the prompt-weighting syntax - (masterpiece:1.2) - so with prefix = masterpiece and value 1.2 you get (masterpiece:1.2) as a ready-to-paste prompt fragment. value is formatted with Python's default float formatting, so 1.2 stays 1.2 and 1.25 stays 1.25. The second output returns the same value as a FLOAT, so you can branch the number into both a text consumer and a numeric consumer without a second node.
Inputs and outputs
value(FLOAT, default 0, -3 to 3, step 0.05) - the number to format.prefix(STRING, default empty) - what goes before the colon, e.g.masterpieceorstrength.suffix(STRING, default empty) - what goes after the value, e.g.endor nothing.
Outputs: text (STRING) and float (FLOAT, the passthrough). Wire text into a text combiner feeding your CLIP encode; wire float into a KSampler or math node.
Where it earns its place
The value is dynamic, not typed by hand - that's the point. Feed value from EmAySee_DynamicRangeSlider or a batch counter and your prompt fragment's weight sweeps across the run: (detail:0.8), (detail:1.0), (detail:1.2)... You get prompt variation that's numeric and reproducible, which is far nicer than hand-editing five prompt variants. It also pairs with the pack's text nodes for building prompts from state.
Install
Part of ComfyUI_EmAySee_CustomNodes. ComfyUI Manager → search "EmAySee" → install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
No dependencies, no models - pure string formatting. Restart and you'll see the pack's "SPECTRE v5.0" banner in the console.
Gotchas
Python float formatting means 1.0 prints as 1.0, not 1 - which looks slightly off in a prompt but is harmless. And the (prefix:value) wrapping only makes sense if you actually set prefix; with both prefix and suffix empty you just get (1.2), which is rarely what you want in a prompt. Also note the value range is capped at ±3 - fine for prompt weights, a limitation if you wanted to format an unbounded number. For the prompt-weight use case, though, it's exactly the right shape out of the box.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| value | FLOAT | 0.00-3–3 | — |
| prefix | STRING | — | |
| suffix | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| float | FLOAT | — |