Nodes/ComfyUI-XJNodes/Float Range List
ComfyUI Node

Float Range List

Generate a list of floats between two numbers, exactly like a range()

By alexjx·Created 10 months ago·Updated 4 months ago· 0
Float Range List
    • floats
    start0.000
    end1.000
    step0.100

    ComfyUI is full of nodes that take a single float - CFG, denoise, strength - and sometimes you want to sweep that value across a range to see how the output changes. XJFloatRangeList generates that sweep: give it a start, an end, and a step, and it hands back a list of floats covering the range, ready to drive a batch or a loop.

    It's a tiny utility from the ComfyUI-XJNodes pack, and its value is in how directly it maps to Python's range(). You already know exactly what range(0, 1, 0.1) means in code; this node is that same mental model expressed as three widgets, minus the integer-only restriction.

    How it works

    The implementation is one line of numpy: np.arange(start, end, step).tolist(). That gives you the familiar range semantics you have to remember anyway:

    • The list starts at start and increases by step each entry.
    • It stops before end - end itself is never included. start=0, end=1, step=0.3 yields [0.0, 0.3, 0.6, 0.9], not [0, 0.3, 0.6, 0.9, 1.0].
    • Stepping downward works if end < start and step is negative, matching numpy's behavior.

    The output is a list type (floats, list of FLOAT), which is what makes it useful for sweep-style workflows: feed it into a loop that iterates per value, or into anything that consumes a list of numbers. If you need integers, note this node stays on floats - but the same pack's loop system gives you integer-based iteration when you need it.

    The inputs

    All three are required and simple:

    • start (FLOAT, default 0) - first value.
    • end (FLOAT, default 1) - exclusive upper bound.
    • step (FLOAT, default 0.1) - increment between values.

    Output: floats (list of FLOAT).

    Installing it

    Part of ComfyUI-XJNodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alexjx/ComfyUI-XJNodes
    

    then restart ComfyUI (or ComfyUI Manager → ComfyUI-XJNodes). No models, no dependencies beyond stock numpy.

    Common issues

    The exclusive-end surprise is the one that trips people: expect [0, 0.1, 0.2, ...] up to but not including 1, and if you specifically need 1.0 in the list, set end just past it. Also, floating-point stepping can produce a stray entry at the tail (numpy's arange is not immune to 0.1 + 0.2-style artifacts), so if you're using the values as exact keys, snap them to a rounding. For a utility this small, that's the whole troubleshooting story.

    CategoryXJNodes/util

    Inputs (3)

    NameTypeDefaultDescription
    startFLOAT0.000
    endFLOAT1.000
    stepFLOAT0.100

    Outputs (1)

    NameTypeDescription
    floatsFLOAT