CombineJobs
Zip or cross-product multiple sweeps into one job
- a
- b
- c
- d
- e
- job
- count
ComfyUI doesn't ship a native way to sweep two parameters at once - no built-in "run every seed against every prompt" button. People end up asking for exactly this on r/comfyui under names like "prompt matrix," and comfyui-job-iterator is usually the answer someone points them to. CombineJobs is the node that actually does the combining: hand it two or more JOBs (each already built from a sequence via a MakeJob node) and it decides how they pair up.
How it works
The choice is one dropdown: zip or product. zip walks all the input jobs in lockstep - step 1 of job A pairs with step 1 of job B, step 2 with step 2, and so on - and stops at the length of whichever input job is shortest, silently dropping the leftovers from longer ones. product instead builds the full cartesian cross: every step of A paired with every step of B (and C, D, E if you've got them), so the result length is every input length multiplied together. Under the hood it's literally Python's itertools.zip or itertools.product, and each resulting pairing gets merged into one attributes dictionary per output step.
Use zip when your sequences are meant to move together (say, a list of seeds and a matching list of prompts you've hand-paired already). Use product when you want the full sweep - every combination, no exceptions.
The inputs and outputs that matter
a(JOB, required) plus up to four optional partners -b,c,d,e- all JOB type. Each one comes from a MakeJob node (or another CombineJobs, since you can chain them).method-ziporproduct.
Outputs are job (JOB, the merged result) and count (INT, how many steps came out the other end) - feed job into JobToList to actually run the loop, and wire count somewhere useful, like the denominator for a ProgressBar.
How to install it
Via ComfyUI Manager: search comfyui-job-iterator, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ali1234/comfyui-job-iterator
then restart. No dependencies beyond ComfyUI itself.
Common issues & troubleshooting
product grows faster than you expect. Four seeds times five CFG values times six samplers is 120 full graph executions from one click of "queue prompt." Check the count output - or just do the multiplication in your head - before you commit an expensive workflow to a sweep this size.
zip quietly drops data instead of erroring. If job A has 10 steps and job B has 4, zip gives you 4 combined steps and silently discards A's other 6 - no warning. If your sweep came out shorter than expected, check that all the jobs you fed in are actually the same length; that's almost always the cause.
Only one attribute per step when you expected several. CombineJobs merges dictionaries, so as long as each input job used a different attribute name in its MakeJob step, you'll get all of them per output step. If two input jobs used the same attribute name, the later one silently overwrites the earlier one - give each sequence its own name upstream.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| a | JOB | — | |
| method | COMBO | zip | 2 options: zip, product |
| bopt | JOB | — | |
| copt | JOB | — | |
| dopt | JOB | — | |
| eopt | JOB | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| job | JOB | — |
| count | INT | — |