Range(Step) - Int
Seed lists and CFG sweeps without hand-typing them
- range
- range_sizes
If you've ever hand-typed 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 into a seed input, this node is the version of you that already has a better day planned. Range(Step) - Int generates an integer list from start to stop, stepping by step, with control over whether the endpoint is included. It's the seed-list generator for grid workflows, and it's about as close to Python's own range() as a node gets.
The inputs are the ones you'd expect: start, stop, step (all INT), and end_mode with Inclusive (default) or Exclusive. The output is range, a list of integers, plus range_sizes, a list of integers describing the length of each contiguous run it built.
Two details decide whether this node behaves or bites you.
First, end_mode defaults to Inclusive. start=0, stop=5, step=1 gives you 0,1,2,3,4,5 - six values. Switch to Exclusive and you get 0,1,2,3,4 - five. If you've used Python's range() a lot, the Inclusive default will surprise you once, because Python is exclusive. Know which one your workflow's math assumes before you wire it into a sampler.
Second - and this one is the real trap - the default step is 0. If you forget to set it, the node throws Python's ValueError: range() arg 3 must not be zero. It's an easy thing to miss on first use because all the defaults are zero and only step actually cares. Set a nonzero step and you're fine.
The range_sizes output exists because this node is list-aware: you can feed lists into start, stop, and step, and it'll build multiple ranges and concatenate them. Say you want seeds 1–5 for prompt A and 20–25 for prompt B - feed two starts and two stops and you get one combined list. range_sizes then tells you each segment's length ([5, 6] in that example), which is exactly the number a grid assembler like XYImage needs to slice the results back apart.
Its natural home is the pack's XY workflow: Range nodes feed the numeric axis of XYAny, which fans the values out across your sampler, and then XYImage draws the grid. A seed sweep against three CFG values is a Range-Step-Int and a Range-Step-Float sitting side by side.
Install is shared with the whole pack - no dependencies beyond ComfyUI's own stack:
cd ComfyUI/custom_nodes
git clone https://github.com/M1kep/Comfy_KepListStuff
Restart, or install Comfy_KepListStuff via Manager, and find it under List Stuff. Set a nonzero step, pick your endpoint mode, and let the node do the typing.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| start | INT | 0-4096–4096 | — |
| stop | INT | 0-4096–4096 | — |
| step | INT | 0-4096–4096 | — |
| end_mode | COMBO | Inclusive | 2 options: Inclusive, Exclusive |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| range | INT | — |
| range_sizes | INT | — |