Nodes/Akatz-Loop-Nodes/Get Float From List | akatz-loops
ComfyUI Node

Get Float From List | akatz-loops

Grab one float from a list by index

By akatz-ai·Created about a year ago·Updated 8 months ago· 23
Get Float From List | akatz-loops
    • FLOAT
    list
    index0

    GetFloatFromList | akatz-loops does exactly what it says: given a list of floats and an index, it returns the float at that index. No blending, no conversion, no cleverness - list[index], in and out. It exists because in ComfyUI you often generate a list of values and then want one of them as a plain number to feed a sampler or a control widget, and most built-in nodes expect a single float, not a list.

    How it works

    Two inputs, one output:

    • list - a FLOAT-typed input that accepts a list of floats. Wire in anything that emits a float list: this pack's Integer List Generator or Make List (via a float socket), another pack's list/range nodes, or an Accumulation To List after you've accumulated floats.
    • index - INT, default 0, max 100,000. Which element to pull. Zero-based, naturally.
    • output - a single FLOAT.

    The pack's companion, GetIntFromList, is the same node for integers - pick whichever matches your data.

    When you'd reach for it

    The honest use case is parameter farming inside a loop: generate a list of denoise strengths or CFG values, then each loop iteration pulls list[i] (with the index driven by the loop's remaining/counter) and feeds a single number into a KSampler or latent node. It's also handy for turning a small hand-built list into one specific value without cluttering the canvas with a dozen primitives.

    Installing it

    From the Akatz-Loop-Nodes pack (repo ComfyUI-Execution-Inversion):

    cd ComfyUI/custom_nodes
    git clone https://github.com/akatz-ai/ComfyUI-Execution-Inversion
    # restart ComfyUI
    

    Or ComfyUI Manager → "Akatz-Loop-Nodes". opencv-python is the only pip dependency; no model files.

    Gotchas

    Out-of-range index is a hard IndexError - no wrapping. The index is also static; if you want it driven by a loop counter you have to wire it, and a counter that starts at 1 will blow up the moment it tries to read element past the end of the list. Keep the index within len(list) - 1, and if your list can be empty, guard it before this node rather than after. The FLOAT socket is specific too: it won't accept an INT list silently, so convert or use the int sibling.

    CategoryAkatz Loop Nodes/Lists

    Inputs (2)

    NameTypeDefaultDescription
    listFLOAT
    indexINT00–100000

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT