Nodes/Akatz Custom Nodes/Rescale Float List | Akatz
ComfyUI Node

Rescale Float List | Akatz

Remap any float list into the range your workflow needs — it finds the bounds itself

By akatz-ai·Created 2 years ago·Updated 9 months ago· 32
Rescale Float List | Akatz
    • output_list
    float_list
    new_min0.000
    new_max1.000

    Most float lists that show up in animation and audio-reactive workflows arrive with an unknown range. Audio amplitudes might live in -0.3..0.9, a keyframe interpolation in 0..100, a brightness curve somewhere in between. Before you can feed any of that into a parameter that expects 0..1 (or -1..1, or 0..360), you have to rescale. AK_RescaleFloatList does that with one convenient twist: you never tell it the original range. It reads the min and max straight off the input list, so you only set the target range.

    Why you'd reach for it

    This is the workhorse of the pack's float-list utilities. Normalize a schedule for a mask-dilation node, remap audio levels into a CFG or denoise curve, squash a brightness list into a usable band - anywhere a raw measurement needs to become a well-behaved parameter. It's also the natural cleanup partner for the pack's AK_ListToNumpyFloatArray and AK_ShrinkNumSequence, all of which speak the same "float list through a FLOAT socket" language.

    How it works

    It converts the list to a NumPy array, computes orig_min and orig_max from the data, and applies the standard linear map:

    new_min + (value - orig_min) * (new_max - new_min) / (orig_max - orig_min)

    That's classic min-max scaling. One guardrail: if every value in the list is identical (orig_max == orig_min), it raises a ValueError rather than dividing by zero - a constant list can't be rescaled meaningfully, and the node tells you so.

    Inputs and outputs

    • float_list (FLOAT) - the list to rescale. A list, not a scalar.
    • new_min (FLOAT, default 0) - low end of the target range.
    • new_max (FLOAT, default 1) - high end of the target range. Set this pair to whatever your downstream node wants.
    • output_list (FLOAT) - the rescaled list, returned as a plain Python list.

    That's the whole surface. Note the docstring mentions orig_min/orig_max inputs, but they don't actually exist in the schema - the node derives them from your data, which is the feature, not a bug.

    Installing the pack

    Part of Akatz Custom Nodes (akatz-ai/ComfyUI-AKatz-Nodes). ComfyUI Manager: search "Akatz" and install, or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/akatz-ai/ComfyUI-AKatz-Nodes
    

    Restart ComfyUI; it lives under 💜Akatz Nodes. Only numpy and torch are needed here (both already in ComfyUI); the pack's requirements.txt also lists opencv-python and pydub, which serve its image/audio nodes and install alongside but aren't required for this one. No models. The README is a stub that points at the author's Notion docs and a custom GPT.

    Gotchas

    • Set new_min and new_max in the order you want them - the node won't sort them, so a reversed pair flips your list upside down.
    • A constant list is an error by design. If you're normalizing something that can legitimately be all-equal, guard it upstream.
    • Same list-convention warning as the rest of the pack: feed it a genuine list output (from AK_BrightnessToFloatList, AK_KeyframeScheduler-style sources via AK_ConvertListToFloatList, etc.), not a bare scalar.
    Category💜Akatz Nodes/Utils

    Inputs (3)

    NameTypeDefaultDescription
    float_listFLOAT
    new_minFLOAT0.000-10000000000–10000000000
    new_maxFLOAT1.000-10000000000–10000000000

    Outputs (1)

    NameTypeDescription
    output_listFLOAT