SP_XYGrid
Turn two values into a parameter sweep
- X
- Y
- X_LIST
- Y_LIST
XY comparison grids are an old idea in this space - Automatic1111 had an X/Y/Z plot script for it, and the community has been running "every combination of these two parameters, tiled into one image" comparisons since the SD 1.5 days. SP_XYGrid is SP-Nodes' plumbing for setting that up in ComfyUI's graph model.
What it does
Two required inputs, X and Y, both accepting any type, and two outputs, X_LIST and Y_LIST - both marked as list outputs. What this node is actually doing is leaning on a mechanism ComfyUI already has built in: when a node's output is marked as a list, everything wired to it downstream runs once per item in that list rather than once total. SP_XYGrid's job is to take your X and Y values and mark them for that list-execution behavior, so the section of your graph after it re-runs for every combination the two lists produce.
How you'd actually build a sweep with it
Feed X a list-producing node - SP_XYValues in this same pack is built for exactly this, parsing a block of text into a typed list of ints, floats, bools or strings. Do the same for Y with a second list. Wire X_LIST and Y_LIST from SP_XYGrid into whatever parameters you're sweeping - steps and CFG, two different samplers, two checkpoints, whatever your comparison needs. ComfyUI's list-execution model takes care of running the downstream chain once per X/Y combination; your job is just making sure the values land where they need to in the sampler or loader you're testing.
Why this over a manual sweep
The honest case for this node is the same case for XY plots in general: eyeballing "does cfg 6 or cfg 8 look better" one generation at a time is slow and your memory of the first image fades by the time you've generated the fifth. Running the actual sweep and looking at everything side by side is worth the setup cost once you're past two or three test values.
Installing it
Ships with the SP-Nodes pack:
- ComfyUI Manager: search "SP-Nodes", install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/bananasss00/ComfyUI-SP-Nodes, restart ComfyUI.
No models, no extra dependencies - this is pure graph-execution plumbing.
Troubleshooting
The main trap with any list-execution setup in ComfyUI: if you expected N × M combinations (every X against every Y) but only got N or M runs total, check exactly how your downstream nodes consume the two lists - depending on how ComfyUI's execution model pairs list inputs at a given node, two lists feeding the same downstream section can zip together item-by-item rather than produce a full cross product, and getting a true grid sometimes needs the lists structured or repeated to match. If your sweep runs fewer times than you expected, that's the first thing to check before assuming SP_XYGrid itself dropped combinations.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| X | * | — | |
| Y | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| X_LIST | * | — |
| Y_LIST | * | — |