Nodes/Nilor Nodes by Nilor Corp/๐Ÿ‘บ List of Ints
ComfyUI Node

๐Ÿ‘บ List of Ints

A sequential (or shuffled) range of integers, always as a list

By nilor-corpยทCreated 2 years agoยทUpdated 5 months agoยท 6
๐Ÿ‘บ List of Ints
    • ints
    โ—„min0โ–บ
    โ—„max9โ–บ
    โ—„shufflefalseโ–บ

    Batch workflows run on indexes. If you're generating a series of variations, iterating frames, or driving a loop, you almost always want a list of integers to walk through - and you want it as a proper list socket, not a comma-separated string you have to parse. Nilor List of Ints gives you that: a sequential range from min to max, with an optional shuffle, always delivered as a real INT list.

    What it does

    Three inputs:

    • min - start of the range, default 0.
    • max - end of the range, default 9. Important: it's inclusive. min=0, max=9 gives you 10 integers, not 9.
    • shuffle - boolean, default off. When on, the range is randomized with Python's random.shuffle.

    Output is ints, a list. The README makes the design explicit: "Output is always a list, even for single values." That matters because ComfyUI treats list sockets and scalar sockets differently, and a node that can't guarantee a list shape will produce wiring chaos. This one guarantees it, and marks the output as OUTPUT_IS_LIST so downstream list-aware nodes behave.

    How it's used

    The obvious pattern: a loop or per-frame driver needs one index at a time. Generate the full range here, then pull individual values with a selector - this pack's ๐Ÿ‘บ Select Index From List is the natural partner, but any index-by-position node works. The shuffle mode is the interesting knob: with shuffle on, the same range comes back in a different order each run, which is a cheap way to randomize the order your batch is processed - handy for seed sweeps where you want to avoid "same seed, same neighbor" clustering. Note there's no seed input, so shuffled runs are not reproducible; if you need deterministic shuffle, this isn't the node.

    Honest notes

    Watch the inclusive max. The off-by-one here is the classic silent bug: max=9 means ten values. It matches how range-style thinking works, but it trips people who assume exclusive upper bounds.

    No step/count control. You get every integer between min and max, nothing else. If you need [0, 2, 4, ...] or an arbitrary sequence, you need a different tool - the pack's ๐Ÿ‘บ n Fractions of Int covers "split a total into N pieces" cases, but a stride isn't available in either.

    Shuffle is unseeded. Fine for "mix it up," wrong for anything you'll want to reproduce later. If reproducibility matters, shuffle with a node that exposes a seed.

    Install

    ComfyUI Manager (search "Nilor Nodes") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/nilor-corp/nilor-nodes
    cd nilor-nodes && pip install -r requirements.txt
    

    Restart ComfyUI; it's under Nilor Nodes ๐Ÿ‘บ โ†’ Generators. No dependencies.

    Bottom line

    The right tool for "I need a list of consecutive integers, as a list." Inclusive max is the one thing to remember, and the unseeded shuffle is the one limitation to respect. It's boring, predictable, and does exactly what the label promises - which in ComfyUI is more than half the battle.

    CategoryNilor Nodes ๐Ÿ‘บ/Generators

    Inputs (3)

    NameTypeDefaultDescription
    minINT0โ€”
    maxINT9โ€”
    shuffleBOOLEANfalseโ€”

    Outputs (1)

    NameTypeDescription
    intsINTโ€”