Nodes/ComfyUI-SweepGrid/Define Parameter Sweep
ComfyUI Node

Define Parameter Sweep

Stop hand-queuing the same workflow five times

By embedding-shapes·Created about a month ago·Updated about a month ago· 3
Define Parameter Sweep
    • values
    type

    Define Parameter Sweep is the "make me a list of values" node that fronts the whole SweepGrid pipeline. The classic way to compare four different step counts is to change the number on the sampler, queue, note the result, repeat - and keep all four outcomes in your head. This node replaces that ritual with a wire that carries a list, and once a value becomes a list, ComfyUI's list execution runs your path once per item and hands you every result back in order. That's the entire trick the pack is built on.

    How it works

    The star input is type, and its tooltip says it plainly: "Automatically follows a supported downstream input." Wire this node's output into a KSampler's steps input (through a Build Sweep Combinations / Get Parameter pair) and the type snaps to integer; wire it into a float input and you get a float range; into a combo and you get a choice list. It even works over a direct connection. Until the path is fully connected the type won't infer, so pick it by hand first - the moment you complete the loop back to the target node, it adapts.

    The types, from the schema:

    • Integer - start, end, interval. Inclusive when the interval lands on the end: 5 to 10 by 1 gives 5..10, but 10 to 5 needs a negative interval.
    • Float - same shape, computed in high-precision Decimal arithmetic so you never get 0.30000000000000004.
    • Boolean - a false/true multiselect, both selected by default, so you get the full on/off matrix.
    • String - one value per non-empty line, whitespace within lines preserved.
    • Choice - multiselect populated from the downstream combo's current options. This is how you sweep blend modes or samplers.

    A sweep is capped at 10,000 values, and interval must be non-zero and pointing toward end - the node validates this before it ever queues. There's a Show values toggle that prints the exact sequence under the controls, which is worth switching on once before a long run, because the inclusive-end behavior surprises people the first time.

    The output

    One values output, typed * (any type) and marked as a list. That list-ness is the point: feed it into a normal widget and ComfyUI executes the downstream path once per value, in sweep order. From there it usually flows into Build Sweep Combinations so multiple swept parameters run as a full grid instead of just sequentially.

    Install and gotchas

    Install is the whole-pack story: ComfyUI Manager → search Node Pack for "ComfyUI-SweepGrid" → Install, then restart. Or git clone https://github.com/embedding-shapes/ComfyUI-SweepGrid.git into ComfyUI/custom_nodes. It needs ComfyUI 0.31.0+ (the pack is written against the newer comfy_api V3 schema) and pulls in no extra Python dependencies - everything it imports already ships with ComfyUI.

    Two things that bite: saved workflows retain the discovered type and choices, but if you author a workflow via the API you have to set type and values explicitly. And the sweep, combination, and extraction nodes refuse to be muted or bypassed - they have no valid pass-through, so don't reach for the bypass hotkey to "test just one value."

    CategorySweepGrid

    Inputs (1)

    NameTypeDefaultDescription
    typeCOMBOAutomatically follows a supported downstream input.

    Outputs (1)

    NameTypeDescription
    values*