ComfyUI Node

String Str

The node that turns anything into text

By kale4eat·Created 2 years ago·Updated 2 years ago· 7
String Str
  • object
  • string

String Str is the pack's universal translator: feed it anything, and it hands you back the string version of that thing. Most nodes in ComfyUI have a fixed input type, which is exactly why this one is handy - when a text field is demanding a STRING and the only value you have is a number, a boolean, or some node output, String Str is the adapter.

What it is

It runs Python's str() on its input. The object input is a wildcard (*), so it accepts whatever you wire in:

  • a number becomes "42" (or "42.0" for a float)
  • a boolean becomes "True" or "False"
  • a seed, a width, a step count - all become plain text you can drop into a filename or a format string

This is the classic "number into text" bridge. Combine it with the pack's String Format or String Concat to build filenames like "seed_42.png", or just to get a numeric value visible in a display/text node for debugging.

The inputs and outputs

  • object (wildcard, optional) - the value to convert. Leave it unconnected and you get the string "None", which is Python's str(None) - useful to know if your output suddenly says "None".
  • string (STRING) - the textual form of whatever came in.

One input, one output, no options. That's the entire node.

How to install it

Same tiny dependency-free pack as all its siblings:

cd ComfyUI/custom_nodes
git clone https://github.com/kale4eat/ComfyUI-string-util

or ComfyUI Manager → "ComfyUI-string-util" → restart. You'll find it under the string-util category.

Common issues

The two surprises are the output's shape. First, str() of a list gives you Python's repr - something like "['a', 'b']" with brackets and quotes - which is almost never what you want for a filename. If you're converting a list, use String Join with a separator instead. Second, floats stringify with their decimal: 42.0, not 42. If you're building a filename from a float seed, you may want to round or convert to int first. Small quirks, but they explain weird-looking output text in a hurry.

Categorystring-util

Inputs (1)

NameTypeDefaultDescription
objectopt*

Outputs (1)

NameTypeDescription
stringSTRING