ComfyUI Node

Number Range

A Python range() for your graph

By DebugPadawan·Created about a year ago·Updated 5 months ago· 2
Number Range
    • range_list
    • count
    start0
    end10
    step1

    You want a list of numbers: 0, 1, 2, 3... or 0, 2, 4, 6... or 10, 9, 8, 7... Number Range generates that list for you. If you've ever written Python, you already know range() - this is that, as a node. It's the seed source for batch runs, the driver for iteration, and the simplest way to produce a bunch of values to feed into a loop or a batch process.

    It's part of DebugPadawan's ComfyUI Essentials, a pure-Python utility pack from the "DebugPadawan" author. No models, no GPU - just a list(range(...)) in a box.

    How it works

    Three required inputs, all INTs:

    • start - the first value (default 0)
    • end - the stopping value, exclusive (default 10). The list stops before this number; it's never included.
    • step - how much to jump each time (default 1)

    Two outputs:

    • range_list - the LIST of integers
    • count - how many numbers are in the list

    The "end is exclusive" detail is the one that bites people. start=0, end=10, step=2 gives [0, 2, 4, 6, 8] - five numbers, not five plus ten. You set end to one past your last desired value, exactly like Python.

    You can also count down: a negative step (e.g. start=10, end=0, step=-2 gives [10, 8, 6, 4, 2]). The one hard rule is step can't be zero - the node raises a ValueError if you try, so no infinite loops from a zero-step.

    Where you'll use it

    • Seed sweeps. The classic use: generate a range of seeds and feed them into a batch or loop to test the same prompt across many seeds - the ComfyUI equivalent of a grid search.
    • Driving Number Lerp. Feed range values into a lerp's t to step through a transition smoothly.
    • Batch iteration. Pair the list with a list-consuming node (the pack's Get List Item or any list processor) to process each value in sequence.

    The count output is handy for loop logic - you know exactly how many iterations you'll get without counting the list yourself.

    Installing it

    The pack installs once and brings all its nodes with it. ComfyUI Manager, searching for "DebugPadawans-ComfyUI-Essentials," or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DebugPadawan/DebugPadawans-ComfyUI-Essentials
    

    Then restart ComfyUI. The requirements.txt (numpy, torch, opencv-python) is already satisfied by stock ComfyUI, and there are no model downloads. One caution when searching: this is DebugPadawan's ComfyUI Essentials - not cubiq's "ComfyUI Essentials," which is a different, much larger pack now in maintenance mode.

    Gotchas

    • Exclusive end. The single most common mistake. If you want 1 through 10, set end to 11.
    • INT only. Inputs are integers and so is the output. If you need a float range, generate ints and convert, or use a Number Lerp/Remap to get fractional values.
    • If step is positive but start > end (or the reverse), you get an empty list and count 0 - no error, just nothing. That's normal Python behavior, but it's easy to misread as a bug.
    CategoryDebugPadawan/Number

    Inputs (3)

    NameTypeDefaultDescription
    startINT0
    endINT10
    stepINT1

    Outputs (2)

    NameTypeDescription
    range_listLIST
    countINT