Merge Mustache Variable Sets
Put keys from two prompt branches into every render
- variable_sets_1
- variable_sets_2
- variable_sets
The mustache pipeline's MUSTACHE_VARIABLE_LIST is a list of concrete assignments - each entry is a dict like {"haircolor": "brown", "leglength": "short"}. This node merges two of those lists entry-by-entry, so every output entry contains the union of keys from both sides. One branch supplies camera_lens, the other supplies person_masc, and your downstream template gets to reference both in the same rendered prompt. That's the entire point, and it's the difference between this node and a plain list concatenation.
Why does that matter? ComfyUI list-mapping is per-item, not per-dict-merge. If you Concatenate Lists two variable lists, you get entries that each carry only one branch's keys - so a template referencing a key from the other branch errors out. Merging entry-by-entry fixes exactly that. It's the glue for composable prompt modules: build a "person" module and a "camera" module independently, merge, render.
The merge rules
variable_sets_1andvariable_sets_2- twoMUSTACHE_VARIABLE_LISTinputs. Keys from the second overwrite duplicate keys from the first.- If both inputs have the same length, they merge by index - entry 1 pairs with entry 1.
- If one side has exactly one entry, that singleton broadcasts across the other side. This is the common case and it's why the pattern "one fixed variable + a randomized batch" works so cleanly:
Mustache Variable Setproduces a one-entry list, and it merges against every entry of the big sampled list. - If both sides have different lengths greater than one, it raises an error rather than guessing.
Output: variable_sets, the merged list - feed it straight into Mustache Template.
Installing and using it
Part of Skoogeer-Noise. ComfyUI Manager → search "Skoogeer-Noise", or:
cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise
Restart ComfyUI. No models or keys; deps are torch, numpy, einops, pyyaml.
Don't confuse it with its sibling
Merge Mustache Variable Defs merges definitions (candidate pools, before sampling) and this merges concrete sets (after sampling). If you have two sampled lists that each need their keys present in the same render, this is the node - concatenation won't do it. And one genuinely useful tip: since a MUSTACHE_VARIABLE_LIST tolerates nested list wrappers from upstream list utilities, you can chain this with List Slice / Reorder List to pick a subset of one branch before merging it with another. The pack's templating tools are designed to compose, and this node is where the branches finally meet.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| variable_sets_1 | MUSTACHE_VARIABLE_LIST | First mustache variable-setting list to merge. | |
| variable_sets_2 | MUSTACHE_VARIABLE_LIST | Second mustache variable-setting list to merge into variable_sets_1. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| variable_sets | MUSTACHE_VARIABLE_LIST | — |