Nodes/FizzNodes/Lerp πŸ“…πŸ…•πŸ…
ComfyUI Node Runs on cloud

Lerp πŸ“…πŸ…•πŸ…

A linear ramp, not a lerp β€” fade a value from full strength to zero over N frames

By FizzleDorfΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 479
Lerp πŸ“…πŸ…•πŸ…
    • FLOAT
    • INT
    β—„num_Images1β–Ί
    β—„strength1.00β–Ί
    β—„current_frame1β–Ί

    Despite the name, FizzNodes' Lerp isn't a generic interpolation between two values. It's a one-way linear ramp: a value that starts at strength and ticks down to zero, one step per frame, over a span you control. It's the "fade something out cleanly" node - the kind of shape you want for a denoise that eases off, an effect that should stop mattering by the end of the shot, or a transition that hands over from one process to the next.

    The math is the whole node:

    step       = strength / num_Images
    output     = strength - (step * current_frame)
    

    So num_Images is really "number of frames to ramp across" - the name is a relic and mildly misleading, but the behavior is clear: set strength to the starting value, set num_Images to how many frames the fade should last, feed current_frame, and the output walks down linearly. Inputs are num_Images (FLOAT), strength (FLOAT), and current_frame (INT). Outputs are FLOAT and INT - the same value, with INT truncated. Single values per frame, so this is a point-sample node you'd drive with a frame counter.

    When to reach for it

    If your animation needs a steady, un-eased fade to zero - no curve, no easing, just a straight line from A to zero - Lerp is the simplest tool in the menu. If you want the fade to ease, a cosine or the schedule nodes will serve you better; Lerp is deliberately dumb. One trap worth knowing: because the output is strength - step * current_frame, it keeps going negative once current_frame passes num_Images. Most consumers clamp or ignore that, but if your downstream node chokes on negatives, gate the frame count or use the value schedule node instead.

    Install

    cd ComfyUI/custom_nodes && git clone https://github.com/FizzleDorf/ComfyUI_FizzNodes.git
    cd ComfyUI_FizzNodes && pip install -r requirements.txt
    

    Or install "FizzNodes" via ComfyUI Manager and restart. No models, nothing heavy - it's one subtraction per frame.

    CategoryFizzNodes πŸ“…πŸ…•πŸ…/WaveNodes

    Inputs (3)

    NameTypeDefaultDescription
    num_ImagesFLOAT10–9999β€”
    strengthFLOAT1.000–10β€”
    current_frameINT10–9999β€”

    Outputs (2)

    NameTypeDescription
    FLOATFLOATβ€”
    INTINTβ€”