Nodes/ComfyUI-Path-Helper/Join Variables
ComfyUI Node

Join Variables

Feed multiple values into ComfyUI-Path-Helper's {} formatting

By Billius-AI·Created 2 years ago·Updated 2 years ago· 21
Join Variables
  • var_1
  • var_2
  • var_3
  • var_4
  • STRING

If you've used the Advanced nodes in ComfyUI-Path-Helper - Add Folder Advanced or Add File Name Prefix Advanced - you've probably hit the {} variable formatting feature and immediately wondered: what if I need more than one variable in there? Join Variables is the answer. It's a small, unglamorous node with exactly one job: take up to four separate values and comma-join them into a single string, ready to feed straight into input_variables on either Advanced node.

Why this needs its own node

The Advanced nodes' input_variables input expects a comma-separated string when you're filling more than one {} placeholder - that's how the pack's own multi-variable formatting is documented to work. You could build that comma-separated string by hand with a string-concatenation node, but that gets fiddly fast, especially once you're mixing types (a seed is an int, a date might be a string, a strength value might be a float). Join Variables handles the type coercion and comma placement for you, so you just wire in your raw values and get a clean joined string out.

The inputs and outputs that matter

  • var_1 - required. This is the only mandatory slot; you can use this node with just one variable if you want, though at that point you might as well feed the value directly into input_variables without going through Join Variables at all.
  • var_2, var_3, var_4 - optional. Fill in as many as you need, up to four total. All four inputs accept any type (*), same permissive approach as input_variables on the nodes downstream.
  • Output is a single STRING - the comma-joined result, ready to plug into input_variables.

The one thing worth internalizing here: order matters, and it's not sorted or labeled for you. Whatever order you wire var_1 through var_4 in is the order they'll fill your {} placeholders, left to right, in the downstream Advanced node. If your folder name template is "{}_{}_seed{}" and you want date, project, seed in that order, your var_1/var_2/var_3 need to match that order exactly - get it backwards and you'll get a folder name that's just wrong, not an error.

How to install it

ComfyUI Manager: search ComfyUI-Path-Helper, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Billius-AI/ComfyUI-Path-Helper

Restart ComfyUI. Standard-library Python underneath, nothing to configure, no models or extra pip packages.

Common issues & troubleshooting

My variables landed in the wrong {} slots. This is almost always an ordering mismatch between how you wired var_1var_4 here and the order the placeholders appear in the downstream folder_name or file_name_prefix string. Trace both side by side and match them up.

I fed it a value and formatting downstream broke. Because var_1var_4 accept literally any type, it's easy to accidentally wire in something that doesn't stringify sensibly - the pack's own documentation calls out types like LATENT as things that will break the formatting step. Keep the values you route through here to strings, ints, and floats; if you're unsure what something actually contains, check it with a Show String node first.

I only have one variable, do I even need this node? No - for a single value, wire it directly into input_variables on Add Folder Advanced or Add File Name Prefix Advanced and skip Join Variables entirely. This node earns its place once you're past one variable and need the comma-joining done for you.

Categorypath_helper

Inputs (4)

NameTypeDefaultDescription
var_1*
var_2opt*
var_3opt*
var_4opt*

Outputs (1)

NameTypeDescription
STRINGSTRING