Nodes/Nilor Nodes by Nilor Corp/๐Ÿ‘บ Inverse Map Float List
ComfyUI Node

๐Ÿ‘บ Inverse Map Float List

Mirror a float list around its own midpoint

By nilor-corpยทCreated 2 years agoยทUpdated 5 months agoยท 6
๐Ÿ‘บ Inverse Map Float List
    • floats
    โ—„list_of_floatsโ€”โ–บ

    If you have a list of float values - per-frame weights, strength curves, timing values - and you want the exact mirror image of it, Inverse Map Float List is the node. It takes list_of_floats and returns the same list flipped around its midpoint: min + max - x for every element. A value that was 0.2 in a list spanning 0โ€“1 becomes 0.8; the shape inverts, the span doesn't change. That's the whole node, and for animation and conditioning work it's genuinely handy.

    Why you'd want a mirror

    Consider a workflow that fades a parameter up over a batch: your float list starts low and ends high. The inverse is the fade out - starts high, ends low - and it's useful everywhere a curve has a complementary version. Crossfades between two sets of weights (list A up while inverse-A goes down), LoRA strength that peaks at the start versus the end, per-frame denoise that should be strongest where another pass is weakest. Instead of recomputing a second curve, you derive it from the first. That's the real value: complementary data for free, guaranteed consistent with the source.

    The implementation is trivial but worth understanding because it's not 1 - x. It's midpoint-based: it finds the min and max of your actual list and mirrors around the halfway point. So a list [0.1, 0.4, 0.9] becomes [0.9, 0.6, 0.1] - the min and max swap places, the middle stays put, and the full range is preserved. That's subtly different from the sibling ๐Ÿ‘บ One Minus Float List (which does 1 - x and assumes a 0โ€“1 scale). If your floats aren't normalized to 0โ€“1, this node is the safer mirror.

    The gotchas

    Empty input is a hard error. The code raises "The input list_of_floats cannot be empty" if you feed it nothing - fair, since there's no min/max to compute, but it means you can't pipe an unpopulated list through defensively.

    It reads the list's own min/max, not a target range. If you wanted to mirror into a different range (say, flip 0.2โ€“0.8 onto 0โ€“1), this isn't the node - that's a remap job, and the pack's ๐Ÿ‘บ Remap Float List (or Auto Input variant) handles range scaling instead. This node keeps your span identical; it only reverses direction.

    List order is preserved - it's a per-element transform, not a reversal. Don't confuse "inverse map" with "reverse the list." The shape inverts; the sequence stays in the same order.

    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 beyond stdlib.

    Bottom line

    A tiny, correct complement-generator. If your workflow already produces one smooth curve and you need its mirror, this is the node that stops you from building a second curve by hand. Just remember what it is - a midpoint flip, not a reversal, not a remap - and pair it with the pack's remap nodes when the range needs to change too.

    CategoryNilor Nodes ๐Ÿ‘บ/Generators

    Inputs (1)

    NameTypeDefaultDescription
    list_of_floatsFLOATโ€”

    Outputs (1)

    NameTypeDescription
    floatsFLOATโ€”