Nodes/was-node-suite-comfyui/Number to String
ComfyUI Node Runs on cloud

Number to String

Turn a number into text you can save, print, or splice into a filename

By WASasquatch·Created 3 years ago·Updated a day ago· 1,840
Number to String
  • number
  • STRING

Plumbing, but the useful kind: Number to String takes a numeric value and converts it into a STRING, so it can go anywhere text is expected instead of a number. ComfyUI keeps numbers and text as genuinely separate socket types, and plenty of nodes - filename builders, text concatenation, save-with-metadata steps - only accept text. This is how a number crosses that boundary.

It sits in a small family of "Number to X" converters in the pack - Number to Text, Number to Float, Number to Int, Number to Seed all live nearby, each aimed at a slightly different destination type. String specifically is what you want feeding into WAS's text nodes: Text Concatenate, Save Text File, or the token system that builds filenames.

Where it actually gets used

Building a filename or caption that includes a value from your graph - a seed, a step count, an iteration index, a computed dimension - where the destination node wants a string, not a number. Feed a seed value through this and then into Text Concatenate alongside a fixed prefix, and you get something like a filename that embeds the seed that produced it, without typing it by hand.

How it works

It takes a numeric input - an INT or FLOAT - and outputs its text representation as a STRING. From there it behaves like any other text in the graph: concatenate it, save it, feed it into a token, whatever the rest of your workflow needs a string for.

How to install it

ComfyUI Manager: search "WAS Node Suite," install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui

then, from inside that folder, install requirements - path/to/ComfyUI/python_embeded/python.exe -s -m pip install -r requirements.txt on portable, pip install -r requirements.txt on system Python. Restart ComfyUI; it's under WAS Suite.

Common issues & troubleshooting

There's not much to go wrong with this node specifically - it's about as simple as WAS gets, no external dependency, no configuration. If you're getting more decimal places than you expected out of a float, that's the float's actual precision showing through the string conversion rather than a bug; round or format the number upstream if you need a cleaner string.

The risk that does apply is the pack as a whole: WAS Node Suite has had no active development since the author marked it retired in December 2023, and the recurring complaint since then is the entire suite failing to import after a ComfyUI update - not this node breaking on its own, but the whole module going down together because of a shared-dependency version clash (the author's own example was a ComfyUI update quietly downgrading BLIP support). If you hit "Import Failed" for the suite, reinstall the requirements using your embedded Python interpreter specifically - path/to/ComfyUI/python_embeded/python.exe -s -m pip install -r requirements.txt - rather than whatever system Python you have on PATH; that's the fix that's actually worked for people stuck on it.

CategoryWAS Suite/Number/Operations

Inputs (1)

NameTypeDefaultDescription
numberNUMBER,INT,FLOATThe value to write out. Put a Number to Int in front of it to lose a trailing '.0'.

Outputs (1)

NameTypeDescription
STRINGSTRINGThe number written out in full, with no padding, thousands separators or currency signs: 8, 8.0, -1.25.