Nodes/ComfyUI-Apt_Preset/AD_sch_mask_weigh
ComfyUI Node

AD_sch_mask_weigh

Turn a keyframe curve into a fading mask batch

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
AD_sch_mask_weigh
    • mask
    ◄points_string0:(0.0), 7:(1.0), 15:(0.0) â–ș
    ◄invertfalseâ–ș
    ◄frames16â–ș
    ◄width512â–ș
    ◄height512â–ș
    ◄easing_typeâ–Ÿâ–ș

    Think of this as AD_sch_prompt_basic's cousin, but instead of outputting text conditioning, it outputs a mask. You write the same kind of keyframe schedule - a value at a given frame, blended across frames with an easing curve - and this node renders it as a flat-value MASK batch whose brightness rises and falls over time according to that schedule. It's not a spatial mask generator (there's no shape input here); it's a way to turn a weight curve into something you can plug into any node that expects a mask, like a blend or composite step, so an effect can fade in and out across an animation instead of staying at a constant strength.

    How it works

    points_string defines the curve using the same frame:(value) syntax the pack's other scheduling nodes use, frames sets how many total frames the schedule covers, and easing_type controls how the value transitions between points. The result is rendered as a solid-color mask at each frame - width×height in size - with the brightness following the curve.

    The inputs and outputs that matter

    • points_string (multiline STRING) - default is 0:(0.0),\n7:(1.0),\n15:(0.0)\n, meaning: start at 0, ramp to full by frame 7, ramp back down to 0 by frame 15. Same syntax family as AD_sch_IPA.
    • invert (BOOLEAN, default false) - flips the curve, so what was 0 becomes 1 and vice versa.
    • frames (default 16, range 2–255) - total frame count for the output mask batch.
    • width / height (default 512×512) - canvas size for each mask frame.
    • easing_type - 23 choices, the same full easing family as the other AD_sch_* nodes (Linear, plus every _In/_Out/_InOut combination of Sine, Quart, Cubic, Circ, Back, Elastic, and Bounce).

    Output is a single mask (MASK) batch, frames long, at your chosen width×height.

    How to install it

    Via ComfyUI Manager: search "ComfyUI-Apt_Preset". Manually:

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

    Then install.bat (Windows) or pip install -r requirements.txt (Linux/Mac), and restart. No model files needed - this is a curve renderer, not a generation node.

    Common issues & troubleshooting

    Mask looks solid, not spatially shaped. That's correct behavior - this node produces a flat value per frame, not a shape or region. If you need a mask that's also spatially varying (a gradient, a specific area of the frame), you'll need to combine this node's output with an actual spatial mask elsewhere, not expect this one to draw a shape.

    frames doesn't match your animation length. Set it to match whatever your generation's actual frame count is - a 16-frame schedule played against a 97-frame LTX clip will only cover the first chunk of the animation and then hold (or error, depending on the downstream node) for the rest.

    Effect doesn't fade the way you expect. Check invert first - it's an easy toggle to forget about, and it silently flips the whole curve. After that, try a different easing_type; Linear fades evenly while the Sine/Quart/Cubic family holds closer to one end longer before moving.

    Not sure your points_string syntax is valid. Match the default's format exactly - comma-separated frame:(value) pairs - since this is a hand-typed schedule string, a malformed entry is a likely cause if the curve doesn't render as expected.

    CategoryApt_Preset/AD/đŸ˜șbackup

    Inputs (6)

    NameTypeDefaultDescription
    points_stringSTRING0:(0.0), 7:(1.0), 15:(0.0) —
    invertBOOLEANfalse—
    framesINT162–255—
    widthINT5121–4096—
    heightINT5121–4096—
    easing_typeCOMBO23 options: Linear, Sine_In, Sine_Out, Sine_InOut, Sin_Squared, Quart_In, +17

    Outputs (1)

    NameTypeDescription
    maskMASK—