Nodes/ComfyUI-SBTools/Variable Combiner (SBTools)
ComfyUI Node

Variable Combiner (SBTools)

When your prompt has 7 variables, this is how you keep them organized

By Amatsukast·Created 5 months ago·Updated 21 days ago· 2
Variable Combiner (SBTools)
  • var_list1
  • var_list2
  • var_list3
  • var_list4
  • var_list5
  • var_list6
  • VAR_LIST

Variable Combiner is the plumbing of the SBTools variable system. It takes up to six var_list inputs and merges them into one var_list output. That's the whole node - no settings, no widgets, no clever options. It exists for one reason: once you have more than a handful of Variable Prompt nodes, your graph becomes a tangle, and this keeps it readable.

Think of it like the pipe-wrench in a toolbox. You don't reach for it because it's exciting; you reach for it because without it, seven Variable Prompts all plugged straight into a Variable Builder is a mess you'll regret debugging at 2am.

How it works

Each input is optional (var_list1 through var_list6), so you can plug in one variable or five. The output var_list carries everything downstream - wire it into a Variable Builder, or into another Combiner.

The chaining is the real feature. Six inputs per Combiner, but Combiner outputs can feed further Combiners, so there's no ceiling on total variables:

Character variables (3) → Combiner A ┐
Clothing variables (3)  → Combiner B ├→ Combiner C → Variable Builder
Scene variables (2)     → Combiner C ┘

It's the "organize by category" pattern from the README - group character/clothing/scene variables into their own combiners, then merge the group outputs. This is also where you'd mix in an image variable (from a Variable Image Loader) with your text variables, so the Builder gets one clean combined list.

The part that actually protects you: duplicate detection

This is the hidden value. The Combiner checks for duplicate variables as it merges:

  • Exact duplicates (same name, same values, same mode) - skipped automatically with an info message. If the same GENDER variable is used in two branches, the second copy is ignored rather than breaking the run.
  • Conflicting duplicates (same name, different values) - throws an error and stops execution. This is the failure mode that bites: two different definitions of "AGE" and the whole graph refuses to run until you rename one.
  • Auto-named variables (_VAR_*, from leaving tag_name empty on a Variable Prompt) - always exempt from the check, so you can reuse those freely.

That conflict error is by design, and it's the reason to leave tag_name empty when you don't need template replacement - it dodges the whole class of naming collisions.

Installing it

Standard pack install. ComfyUI Manager → search "ComfyUI-SBTools" → Install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Amatsukast/ComfyUI-SBTools.git
cd ComfyUI-SBTools
pip install -r requirements.txt

Restart ComfyUI. No dependencies worth mentioning - it's pure list logic.

Troubleshooting

  • "Duplicate variable" error - you have two variables with the same tag_name but different values. Rename one, or empty its tag_name for auto-naming.
  • Nothing reaches the Builder - a Combiner with no inputs connected passes an empty list; check your wires.
  • Order looks wrong in the output - the Combiner preserves connection order, so hook up inputs in the order you want values to appear in the generated prompt.

It won't do anything flashy, but the alternative to it is an unreadable graph and a prompt-ordering headache. For that reason alone, it earns its place in any workflow with more than a couple of variables.

CategorySBTools/Prompt

Inputs (6)

NameTypeDefaultDescription
var_list1optVARIABLE_LISTVariable list from Variable node or another Combiner
var_list2optVARIABLE_LISTVariable list from Variable node or another Combiner
var_list3optVARIABLE_LISTVariable list from Variable node or another Combiner
var_list4optVARIABLE_LISTVariable list from Variable node or another Combiner
var_list5optVARIABLE_LISTVariable list from Variable node or another Combiner
var_list6optVARIABLE_LISTVariable list from Variable node or another Combiner

Outputs (1)

NameTypeDescription
VAR_LISTVARIABLE_LIST