Nodes/InitialB Util/๐Ÿ“Š Range Int
ComfyUI Node

๐Ÿ“Š Range Int

Python's range(), finally, as a ComfyUI node

By benjiyayaยทCreated 6 months agoยทUpdated 6 months agoยท 1
๐Ÿ“Š Range Int
    • values
    โ—„start0โ–บ
    โ—„stop10โ–บ
    โ—„step1โ–บ

    InitialBRangeInt is the range() builtin from Python, packaged as a node. You give it a start, a stop, and a step, and it hands you back a list of integers. That sounds trivial, and it mostly is - but in a workflow language that has no native loops or lists, a range generator is genuinely load-bearing. It's the kind of node that looks pointless until the moment you need it and there's nothing else.

    The three inputs (all required, all simple)

    • start - first value (default 0).
    • stop - where the sequence stops, exclusive (default 10). This trips up everyone once: range(0, 10) gives you 0 through 9, not 10.
    • step - the increment (default 1).

    The output is values: the full list, e.g. start=0, stop=10, step=2 โ†’ [0, 2, 4, 6, 8].

    One quirk worth knowing before you hit it: the schema calls the output INT, but what comes out is a Python list of ints, not a single scalar. Treat it as a list/sequence output and wire it into things that consume sequences - most commonly into the InitialB For Loop machinery or a list-aware node - not into something expecting one number.

    Why you'd reach for it

    The honest use cases in a real workflow:

    • Seeding a loop. Feed values into a For Loop Start or a per-item processing node and iterate over a sequence of seeds, strengths, or indices without hand-typing each one.
    • Generating a batch of parameter values. A step of 10 from 0 to 100 gives you 11 evenly spaced numbers to sweep a strength or a scale over.
    • Index math for lists. Combined with the pack's Math Int, it's the raw material for any "for each item N" pattern.

    The gotchas

    • stop is exclusive. If you want a range that includes 10, set stop to 11.
    • You can't count down. step has a minimum of 1, and range() with a positive step over a start > stop yields nothing. Need a descending sequence? Generate ascending and flip it, or do the math with a Math Int node.
    • No early output. The node produces the whole list at once; it's not lazy. For a start/stop/step combo that would produce tens of thousands of values, think about whether you actually want that list materialized.

    Install

    Pack: InitialB Util. ComfyUI Manager โ†’ search "InitialB Util" โ†’ Install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/benjiyaya/Comfyui_InitialB_Util
    cd Comfyui_InitialB_Util
    pip install -r requirements.txt
    

    Restart after. No model downloads - requirements are just torch/numpy/scipy/Pillow, all shipped with ComfyUI. (The README's clone URL is a yourusername placeholder; use the real repo above or Manager.) It sits in the InitialB/utility menu with the other data-type and math nodes.

    CategoryInitialB/utility

    Inputs (3)

    NameTypeDefaultDescription
    startINT0-99999โ€“99999โ€”
    stopINT10-99999โ€“99999โ€”
    stepINT11โ€“99999โ€”

    Outputs (1)

    NameTypeDescription
    valuesINTโ€”