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

AbsCosWave πŸ“…πŸ…•πŸ…

The rectified cosine β€” a steady pulse of peaks instead of a smooth swing

By FizzleDorfΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 479
AbsCosWave πŸ“…πŸ…•πŸ…
    • FLOAT
    • INT
    β—„phase1β–Ί
    β—„amplitude0.5β–Ί
    β—„x_translation0β–Ί
    β—„max_value0.50β–Ί
    β—„current_frame1β–Ί

    AbsCosWave is the "absolute value" version of the cosine oscillator in FizzNodes' wave family, and that one word - abs - changes the shape completely. Taking the absolute value of a cosine folds the negative half of the wave up into the positive, so instead of oscillating down through zero you get a series of rounded peaks that dip back down and bounce up again. It's a pulsing waveform, the kind of shape you want for a strobe-ish glow, a rhythmic zoom, or anything that should "throb" rather than smoothly sway.

    The formula is:

    max_value - (|cos(current_frame / phase)| * amplitude)
    

    The key difference from the plain wave nodes is the input set: phase (frames per pulse), amplitude (how deep the dip goes), max_value (the ceiling the peaks reach), and current_frame. There's also an x_translation input in the schema, but fair warning - in the current shipped code it's accepted and then not actually used in the calculation. Don't waste time tweaking it expecting the curve to shift; it won't. (The sibling AbsSinWave has the same quirk.)

    Outputs are FLOAT and INT - same value, INT truncated. Single values per frame, point-sample style: wire in a frame number, get the value for that frame.

    When to grab it

    If your animation needs a repeating pulse where the value always stays positive and snaps back to a ceiling - a heartbeat-ish effect, a light that pulses in place - this is the node. If you want the same idea from a sine instead, AbsSinWave is identical in behavior with a slightly different curve. Both share the wave family's habit of printing every output to the console, which gets noisy on long runs but is otherwise harmless.

    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, no heavy dependencies - it's a line of numpy.

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

    Inputs (5)

    NameTypeDefaultDescription
    phaseFLOAT10–9999β€”
    amplitudeFLOAT0.50–9999β€”
    x_translationFLOAT00–9999β€”
    max_valueFLOAT0.500–9999β€”
    current_frameINT10–9999β€”

    Outputs (2)

    NameTypeDescription
    FLOATFLOATβ€”
    INTINTβ€”