Join any into string
Stitch mixed-type values into one string without cast nodes
- any1
- any2
- any3
- prefix+all-text+suffix
- prefix+any1+gap+suffix
- prefix+any2+gap+suffix
Building a dynamic filename or caption out of a few pieces - a prefix, a couple of values from earlier in the graph, a suffix - usually means chaining several "convert to string" and "concatenate" nodes together. This one collapses that into a single node: wire in up to three values of any type, set your separators, and get a joined string back, plus a couple of partial builds along the way.
Inputs and outputs
Every input on this node is optional, which is a little unusual for something that's fundamentally about combining values - you can run it with nothing wired and just get prefix + suffix (empty strings by default, so effectively nothing) back. The full set: prefix (STRING), any1 (wildcard), any1_any2_gap (the separator string placed between any1 and any2), any2 (wildcard), any2_any3_gap (the separator between any2 and any3), any3 (wildcard), and suffix (STRING).
Three outputs, and this is the detail worth reading the schema carefully for: prefix+all-text+suffix (everything joined together, the one you'll use most often), prefix+any1+gap+suffix (just any1, wrapped in its own prefix/suffix/gap), and prefix+any2+gap+suffix (the same, but for any2). Notice what's missing - there's no third output wrapping any3 on its own. Whether that's intentional or just how it shipped isn't explained anywhere, but it's exactly what the schema shows, so if you need any3 wrapped independently, you'll have to build that with a second KY_JoinToString (or your own prefix/suffix) rather than expecting a fourth output here.
Where this fits
Pairs naturally with anything that hands back a mix of typed values - a KY_BBoxToXYWH unpacking into ints, an LLM caption node's string output, a frame index from a loop - where you want them stitched into one readable string for a filename, a log line, or a caption file, without manually casting each one first.
Installing it
ComfyUI Manager: search ComfyUI-KYNode, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/yorkane/ComfyUI-KYNode
Restart ComfyUI. No external dependencies - pure string formatting.
Common issues
Since everything is optional, a typo'd or forgotten connection doesn't error - it just quietly contributes nothing to the joined string. If your output is missing a piece you expected, check the actual wire, not the node's logic; there's no required-input validation here to catch a dropped connection for you.
Remember any3 only shows up in the combined prefix+all-text+suffix output, not in a dedicated wrapped output of its own - if a downstream node is only reading prefix+any2+gap+suffix expecting it to also carry any3's value, that's the mismatch to check first.
Wildcard typing means this node will stringify essentially anything you hand it - a whole tensor, a dict, a list - without complaint, but the resulting string representation of a complex object (a raw Python repr()-style dump, most likely) probably isn't the human-readable text you actually want in a filename or caption. Keep any1/any2/any3 to genuinely string-friendly values - numbers, short strings, booleans - if the output needs to be readable.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| prefixopt | STRING | — | |
| any1opt | * | — | |
| any1_any2_gapopt | STRING | — | |
| any2opt | * | — | |
| any2_any3_gapopt | STRING | — | |
| any3opt | * | — | |
| suffixopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prefix+all-text+suffix | STRING | — |
| prefix+any1+gap+suffix | STRING | — |
| prefix+any2+gap+suffix | STRING | — |