Nodes/Comfyui-XYZ-stitch/XYZ Grid Input (Batch)
ComfyUI Node

XYZ Grid Input (Batch)

The List-Friendly Version

By psdwizzard·Created 10 months ago·Updated 10 months ago· 3
XYZ Grid Input (Batch)
    • x_values_batch
    • y_values_batch
    • z_values_batch
    • total_combinations
    x_valuesred, blue, green
    y_values1, 2, 3
    z_values

    XYZ Grid Input (Batch) is the sibling of XYZ Grid Input, and the difference is one word: instead of handing you one combination per run, it dumps all of them at once as three lists. Same comma-separated input parsing, same itertools.product combination order, zero index-wrangling. If you've already built a workflow that loops over lists natively, this is the node that feeds it.

    When you'd actually use it

    The catch, and it's a real one: this node is only useful if the nodes downstream in your graph accept list inputs. Standard ComfyUI nodes mostly don't - a KSampler wants a single prompt string, not a list of them. But list-aware nodes (prompt-list iterators, batch string processors, or any of the newer nodes built on ComfyUI's list-output support) take x_values_batch and friends straight in. The README positions it for "workflows that support batch processing," which is honest: if your graph can consume a list, you get the whole sweep in one queue pass instead of nine.

    For the classic manual-index flow - XYZ Grid Input → Auto Collector → Stitch - you don't want this node. It has no index output to drive the collector, and the collector still needs one image per combination, which means whatever consumes the lists still has to run once per combo. It changes how the sweep is driven, not how many images get made.

    Inputs and outputs

    Three required inputs, all multiline comma-separated strings, and z_values is the only one you'll routinely leave empty to opt out of the third axis.

    The outputs are three lists plus a count:

    • x_values_batch, y_values_batch, z_values_batch - every combination value for each axis, in lockstep. Index N of all three together is combination N.
    • total_combinations - the product of your axis sizes, for anything downstream that wants to know how many items to expect.

    Note there are no *_index outputs here and no grid_info readout - it's a batch generator, not a per-run position tracker.

    Installing

    Same pack, same drill. ComfyUI Manager → search "XYZ Grid", or:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/psdwizzard/Comfyui-XYZ-stitch.git
    

    Restart, and it lands under "XYZ Grid" with no extra dependencies - no requirements.txt, nothing to download.

    A word of caution

    Because it emits lists on every execution, it's easy to accidentally feed those lists into a node that only accepts a single string - ComfyUI will either throw or do something surprising, and the error message rarely tells you the real story. If you see a "got list, expected string"-style failure, you've likely wired a batch output into a non-list input. When in doubt, reach for plain XYZ Grid Input; this variant exists for the specific case where your pipeline already thinks in lists.

    CategoryXYZ Grid

    Inputs (3)

    NameTypeDefaultDescription
    x_valuesSTRINGred, blue, greenComma-separated values for X axis
    y_valuesSTRING1, 2, 3Comma-separated values for Y axis
    z_valuesSTRINGComma-separated values for Z axis (leave empty to disable)

    Outputs (4)

    NameTypeDescription
    x_values_batchSTRING
    y_values_batchSTRING
    z_values_batchSTRING
    total_combinationsINT