Nodes/RF Nodes/To string (ANY)
ComfyUI Node

To string (ANY)

Turn ANY primitive into text — the one converter that ends the type dance

By foxtrot-roger·Created 3 years ago·Updated 2 years ago· 2
To string (ANY)
  • value
  • STRING

ComfyUI is strict about types: an INT won't plug into a STRING input, and every node you wire a number into wants its own flavor. To string (ANY) (RF_ToString) is the blunt instrument that ends the argument - feed it an INT, BOOL, FLOAT, or NUMBER and it hands you the string representation. One node, four input types, no fuss.

It's the "ANY" of the RF Nodes ToString family. The pack also ships typed variants (RF_IntToString, RF_FloatToString, RF_BoolToString, RF_NumberToString), but this is the one you drop in when you don't want to think about which type you're holding. The only trade-off: you lose control over formatting, because it's literally str(value) under the hood.

How it works

Nothing to it - the value comes in and str() goes out. A FLOAT 0.5 becomes "0.5", an INT 42 becomes "42", a BOOL True becomes "True" (capital T, which matters if you're comparing strings later). The input type union INT,BOOL,FLOAT,NUMBER is what makes it "ANY" - any of those sockets will accept the wire.

The inputs that matter

  • value - the single input, forceInput, so it has to be wired from another node. Feed it any INT, BOOL, FLOAT, or NUMBER output.

Output: STRING - the text version of whatever came in.

When you'd use it

Strings are the glue of ComfyUI. Numbers become strings when you want to put a seed, a step count, or a CFG value into a filename, a watermark, a log line, or a text note in the graph. The classic pattern: wire a seed INT into this node, concatenate the result with a Timestamp string, and feed the whole thing to a Save Image filename prefix so every run's name records its seed. That kind of self-documenting filename is worth the three extra nodes.

If you want to format the number - fixed decimals, padded integers - you're better off with the typed nodes, though even those are plain str(). None of this pack formats; it converts.

Installing RF Nodes

Zero dependencies, no model downloads. Via ComfyUI Manager search "RF Nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/foxtrot-roger/comfyui-rf-nodes

Restart ComfyUI; look under RF in the node menu.

Common issues

  • "It's outputting 0.30000000000000004." - That's float arithmetic leaking through str(), not the node misbehaving. If clean decimals matter, use a node that rounds or formats first.
  • "There are four almost-identical ToString nodes." - Correct, and that's the pack's whole personality: one node per type, plus this union. If a workflow loads with a missing RF_ToString, the pack just wasn't installed - that's the single most common reason a downloaded workflow fails to load in this ecosystem.
CategoryRF

Inputs (1)

NameTypeDefaultDescription
valueINT,BOOL,FLOAT,NUMBER

Outputs (1)

NameTypeDescription
STRINGSTRING