Str Append
Glue a prefix and suffix onto anything to build a string
- input
- str
This is the smallest, least glamorous node in the whole ComfyUI-WJNodes pack, and that's fine - sometimes you just need to stick a prefix and a suffix onto a value before it goes into a filename or a save path, and writing that out with core ComfyUI nodes every time is annoying. Str_Append does the one job: takes anything, wraps text around it, hands back a string.
Worth knowing where the idea came from: the node's own description credits it as a callback to an old node of kijai's - "referring to Kijia's node a long time ago" (the spelling's the README's, not a typo I'm introducing). Kijai is one of the most prolific ComfyUI node authors around - the person behind the Wan video wrapper, several TeaCache implementations, and a long list of fixes that show up across the ecosystem's model-launch threads. WJNodes reimplemented the prefix/suffix idea here rather than making you pull in his whole KJNodes pack just for string concatenation.
How it works
input accepts anything - image, number, string, whatever's on the wire - and gets converted to a string. prefix and suffix are plain text you attach to the front and back of that stringified value. Feed it a seed number, a batch index, today's date, or a filename fragment; set prefix to "run_" and suffix to ".mp4", and out comes a ready-to-use string without a manual text-concatenation workaround. Wire str straight into a path field - Save_Image_To_Path or Save_Image_Out or SaveMP4 from this same pack, or the filename prefix on core ComfyUI's own save nodes.
The inputs and outputs that matter
input(any type, required) - the value to convert and wrap. This is the only required field; without it the node has nothing to work on.prefix(string, optional, default empty) - text added before.suffix(string, optional, default empty) - text added after.str- the output. One string, ready to plug into whatever downstream node wants a path or filename fragment.
How to install it
Through ComfyUI Manager: search "ComfyUI-WJNodes," install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes
then restart. No models, no heavy dependencies - this is pure Python string handling, nothing to download.
Common issues & troubleshooting
Because input accepts anything, it's easy to accidentally wire the wrong output into it on a busy graph - an IMAGE tensor or some other object instead of the number or string you meant to convert. If the resulting string looks like garbage rather than the value you expected, that's almost always a crossed wire, not a bug in the node - trace input back to its source before looking anywhere else.
Leave both prefix and suffix blank and the node just passes the stringified input straight through unchanged, which is a fine way to use it as a quick "convert anything to text" node when that's genuinely all you need.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| input | * | — | |
| prefixopt | STRING | — | |
| suffixopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| str | STRING | — |