Nodes/ComfyUI-Apt_Preset/Amp_drive_value
ComfyUI Node

Amp_drive_value

Shape a raw amplitude curve into a number you can actually use

By cardenluo·Created 2 years ago·Updated 17 days ago· 309
Amp_drive_value
    • float
    • int
    • graph
    normalized_amp
    add_to0.00
    threshold_for_add0.00
    add_ceiling1.0
    scale1.0

    A raw normalized amplitude value (0 to 1) is rarely the number you actually want to drive something with. ControlNet strength, LoRA weight, motion amount - they all want their own range, and often you want quiet moments to stay near a resting baseline while only genuine peaks get a real kick. That's the job this node does: it takes normalized_amp and reshapes it into a float (and an int) that's actually usable downstream, with a built-in "only boost past a threshold" behavior and a ceiling so it doesn't run away.

    How the shaping works

    Four knobs control the curve. threshold_for_add (0-1, default 0) is the floor the signal has to clear before the boost kicks in at all - set this above 0 and quiet passages stay flat instead of jittering the output. add_to (0-4, default 0) is the size of that boost once the threshold is crossed. add_ceiling (0.1-4, default 1) caps how high the boosted value can go, so a sudden extreme spike doesn't blow your ControlNet strength or LoRA weight way past sane territory. And scale (0.1-10, default 1) is the overall multiplier applied to the whole result - the knob you reach for when the output range just needs to be bigger or smaller across the board. The exact internal formula isn't published in the node itself, but the shape of it is readable straight off these four names: gate, boost, clamp, scale.

    The inputs and outputs that matter

    Only normalized_amp is truly required to think about - everything else has a sane default (add_to at 0 means no boost at all unless you turn it up). Three outputs come out the other side: float (the shaped value, the one you'll wire into most things), int (the same value rounded/truncated, handy if a downstream node insists on an integer), and graph - an IMAGE output that plots the curve. That last one is worth using before you commit to a full render: preview the graph node, eyeball whether your threshold and ceiling are landing where you expect, and adjust before you burn GPU time on a batch that turns out to be clipped or flat the whole way through.

    Installing it

    Search "ComfyUI-Apt_Preset" in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
    

    Run install.bat on Windows (pip install -r requirements.txt elsewhere) and restart. Pure math node - no model weights involved.

    Where people get tripped up

    The graph output is easy to miss because it's the third one, tucked after float and int, and skipping it is how people end up debugging a weird render instead of a five-second image preview. If your driven value looks completely flat across a whole clip, check threshold_for_add first - it's the most common miscalibration, because the default of 0 means every nonzero amplitude gets boosted, while a value set too high can mean nothing in a quiet-to-moderate track ever crosses it. And remember add_ceiling is a hard cap, not a soft one: if your output is pinned at the same number during every loud section, you're not seeing the audio's dynamics, you're seeing the ceiling.

    CategoryApt_Preset/AD

    Inputs (5)

    NameTypeDefaultDescription
    normalized_ampFLOAT
    add_toFLOAT0.000–4
    threshold_for_addFLOAT0.000–1
    add_ceilingFLOAT1.00.1–4
    scaleFLOAT1.00.1–10

    Outputs (3)

    NameTypeDescription
    floatFLOAT
    intINT
    graphIMAGE