Nodes/KJNodes for ComfyUI/Something To String
ComfyUI Node Runs on cloud

Something To String

Turn any value into text, no matter the type

By kijai·Created 3 years ago·Updated about 7 hours ago· 2,930
Something To String
  • input
  • STRING
prefix
suffix

Something To String accepts literally anything you can wire into it and converts it to a STRING. An INT, a FLOAT, a list, some custom type from another pack entirely - it doesn't care. That "accepts anything" behavior isn't a limitation you work around, it's the entire feature.

Why you'd want this

Two real uses come up constantly. First, debugging: ComfyUI graphs pass around a lot of custom types between community node packs, and it's not always obvious what's actually flowing through a wire - an unexpected shape, a None where you expected a value, a type you don't recognize. Wiring the mystery output into this node and then into a text-display node turns "I have no idea what this is" into "oh, that's the problem" in about ten seconds, without writing any Python or digging into another pack's source.

Second, building dynamic text from non-text values: you've got an INT seed, a FLOAT strength, or some other numeric or structured value, and you want it stitched into a filename, a caption, a log line, or a prompt. Rather than manually formatting each type differently, this node stringifies whatever you hand it so it can slot into a text-concatenation chain.

The inputs and outputs that matter

  • input - accepts anything (typed as a wildcard on this node, unlike most nodes which demand a specific type). This is the one required input; everything else is optional.
  • prefix (STRING, optional) and suffix (STRING, optional) - text to glue onto the front and back of the converted value, so you can produce something like seed: 12345 or strength_0.8 directly out of this one node instead of chaining a separate concatenation node afterward.
  • STRING out - the final result, ready to wire wherever a string is expected.

Installing it

Ships with the pack:

  • ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt, restart.

No dependencies of note - it's pure conversion logic.

Common issues & troubleshooting

Output looks like a raw Python repr instead of a clean value. Some types - lists, tuples, custom objects from other node packs - don't have a clean "just the number" string form, so what you get back reflects however Python represents that object internally. For simple scalar types (INT, FLOAT, plain STRING) you'll get exactly what you'd expect; for anything more structured, treat the output as a debug view rather than assuming it'll always be presentation-ready text.

Prefix/suffix aren't showing up. They're both optional inputs - if you left them unconnected or blank, nothing gets added, which is expected behavior, not a bug. Wire in (or type) actual text for them to take effect.

Want to go the other direction - string back to a number. This node is one-way, string-out only. For converting a STRING into an INT or FLOAT, you'll need a different, dedicated conversion node - this one isn't built to parse text back into typed values.

CategoryKJNodes/text

Inputs (3)

NameTypeDefaultDescription
input*
prefixoptSTRING
suffixoptSTRING

Outputs (1)

NameTypeDescription
STRINGSTRING