Range
The numeric sweep primitive, straight from Python's range()
- sequence
If you want to sweep over a run of evenly-spaced integers - seeds, step counts, batch indices, anything countable - Range is the node that builds that sequence for you. It's the most predictable node in the whole pack, because it's not doing anything the name doesn't already tell you.
How it works
It's a direct wrapper around Python's built-in range(start, stop, step). That means the usual range() rules apply exactly: stop is exclusive (a range from 0 to 10 gives you 0 through 9, not 10), and the object stays lazy - it doesn't materialize a list in memory, it just knows how to produce the next value - until something downstream actually consumes it.
The inputs and outputs that matter
start(INT, default 0) - where the sequence begins.stop(INT, default 10) - where it ends, exclusive. All three inputs accept a wide range, roughly ±9,999,999.step(INT, default 1) - the gap between values. Negative steps count downward, same as Python.
Output is a single sequence, ready for MakeJob, CombineJobs, Reorder, Slice, or Combinations further down the graph.
The most common thing this feeds is a seed sweep: Range(1000, 1010, 1) gives you ten sequential seeds, wire that straight into a MakeJob node named seed, and you've got a job that tests the same prompt across ten seeds without typing any of them out by hand. It's also the natural source for CFG-as-step-index or sampler-step counts, anywhere the thing you're sweeping is naturally a run of whole numbers.
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 - pure Python standard library underneath.
Common issues & troubleshooting
Integers only. There's no float step, so you can't sweep CFG scale through something like 4.5, 5.0, 5.5 directly with this node. Use Literal with an explicit list ([4.5, 5.0, 5.5]) for anything that needs fractional steps.
An empty sequence with no error. If your start/stop/step combination produces zero values - say start=10, stop=0, step=1 (counting up from a point that's already past the stop) - Range doesn't complain, it just hands back an empty sequence. If your downstream job runs zero times and nothing seems to happen, this is almost always why. Double-check the direction of step matches the direction from start to stop.
stop is exclusive, which trips people up going the other way too. Range(0, 5, 1) gives you five values (0, 1, 2, 3, 4), not five-through-one. If you specifically need to include the endpoint, set stop one past it (stop=6 to actually reach 5).
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| start | INT | 0-9999999–9999999 | — |
| stop | INT | 10-9999999–9999999 | — |
| step | INT | 1-9999999–9999999 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| sequence | SEQUENCE | — |