Nodes/ComfyUI-SweepGrid/Build Sweep Combinations
ComfyUI Node

Build Sweep Combinations

The Cartesian product that makes parameter grids worth it

By embedding-shapes·Created about a month ago·Updated about a month ago· 3
Build Sweep Combinations
  • parameters
  • combinations
  • count
max_combinations100

A single Define Parameter Sweep gives you a list, and a list is just a sequence. The moment you want every combination of two swept parameters - say steps × LoRA strength - a sequence isn't enough; you need the Cartesian product, and that's exactly what Build Sweep Combinations is for. The pack's flagship MiniMax H3 demo runs 2–6 steps against 0.7–1.0 LoRA strength, and this node is what turns those two lists into the 20 videos that come out the other end.

How it works

The parameters input autogrows: connect the first sweep to parameter1, and the trailing empty input exposes parameter2, and so on up to ten. Each list is a sweep from Define Parameter Sweep. On execution the node computes itertools.product(*values) - every combination, with parameter1 changing slowest and the last connected parameter changing fastest. So steps (2, 4, 6) × strength (0.7, 1.0) runs 2/0.7, 2/1.0, 4/0.7, 4/1.0, 6/0.7, 6/1.0. That ordering matters when you later read the grid left-to-right.

Name each sweep after its target (steps, megapixels) - the title rides along onto the combination input and onto the matching Get Parameter From Combination selector, which keeps a multi-parameter graph readable.

The inputs and outputs that matter

Two inputs, one of them genuinely important: max_combinations defaults to 100, which is a guardrail that quietly rejects bigger products. Three values across three sweeps is 27 combos - fine. A 10×10×10 sweep is 1,000 and errors out until you raise it (up to 10,000). It's marked advanced; expect to meet it the first time you build a real grid.

Outputs: combinations (SWEEP_GRID_COMBINATION, a list) and count (an INT that's the exact product size). count is not decoration - wire it into a Sampling Timer's total combinations input and you get an aggregate progress bar across the whole sweep instead of per-item steps.

Where people get burned

The big one is zipping versus products. If you wire multiple lists directly into one downstream node, ComfyUI zips them by index - 2/0.7, 4/1.0, then done. If you expected all six combinations, that's the cause, and this node is the fix. Also: these three nodes (sweep, combinations, extraction) cannot be muted or bypassed - there's no valid pass-through behavior, so don't toggle bypass to "test one combo." And if you disconnect a parameter input, its selector downstream goes to Unassigned instead of silently grabbing another parameter - an honest failure, but it'll confuse you until you've seen it once.

Install

Same pack, same drill: ComfyUI Manager → "ComfyUI-SweepGrid" → Install, restart. Requires ComfyUI 0.31.0+. Zero extra pip dependencies - the only imports are Python stdlib plus what ComfyUI already ships.

CategorySweepGrid

Inputs (2)

NameTypeDefaultDescription
parametersCOMFY_AUTOGROW_V3
max_combinationsINT1001–10000

Outputs (2)

NameTypeDescription
combinationsSWEEP_GRID_COMBINATION
countINTNumber of generated combinations.