ComfyUI Node Runs on cloud

Cosines

DF_Cosines – ComfyUI Node from Derfuu_ComfyUI_ModdedNodes

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Cosines
    • FLOAT
    value1.00
    type_
    arcCos

    DF_Cosines is the trig node from Derfuu_ComfyUI_ModdedNodes, a grab-bag math/utility pack that's been around since ComfyUI's early days in 2023. It computes a cosine - or, flipped around, an arccosine - of whatever value you feed it. If you're not doing anything with angles or periodic curves in your graph, you'll almost never touch this one; it's here for the handful of workflows that build custom math chains (staggering a value across a batch on a curve, driving a rotation, that kind of thing) rather than for anything in a typical generation pipeline.

    Worth knowing up front: the pack also ships a node called plain Cosines, with the exact same inputs and output, sitting in the same Derfuu_Nodes/Math/Trigonometry menu. That's an older, unprefixed name kept around for backward compatibility - DF_Cosines is the one that matches the pack's current naming convention (everything else is DF_Something), so it's the one to use if you're building fresh.

    How it works

    Trig nodes in this pack are simple wrappers around Python's math module, and DF_Cosines takes three inputs:

    • value - the angle to take the cosine of (or, with arcCos on, the ratio to find an angle for)
    • type_ - RAD or DEG, so you can work in whichever unit your downstream math expects without converting by hand
    • arcCos - flips the node from cosine to arccosine (the inverse function)

    Output is a single FLOAT. With arcCos off you get cos(value), always clamped between -1 and 1 regardless of how large the input angle is. With arcCos on, you're going the other direction - feed it a ratio, get back the angle in your chosen unit. That's a genuinely useful direction switch to have in one node instead of two separate ones.

    Where this fits in a workflow

    Realistically, this is a building block for people composing their own math logic inside a graph - the kind of thing you reach for alongside DF_Sum, DF_Multiply-equivalents, or DF_Random to compute something ComfyUI doesn't expose a widget for. It predates rgthree's Power Puter, which does the same job of "arbitrary expression evaluation" in a single node with a typed formula instead of a chain of one-operation-per-node math blocks. If you're starting a workflow from scratch today and just need to evaluate a formula with cosine in it, Power Puter is less wiring. DF_Cosines earns its keep when you're maintaining or extending an existing workflow that already leans on Derfuu's math nodes throughout, or when you want each step of the calculation visible as its own node on the canvas.

    Installing

    The whole pack installs as one unit - there's no way to grab a single node out of it. Through ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes
    

    then restart. It's pure Python logic - no models to fetch, no unusual dependencies - so install is quick and low-risk.

    Troubleshooting

    If DF_Cosines (or any node from the pack) doesn't show up in the node menu right after install, restart the server and then hard-refresh the browser tab; a stale frontend is the usual culprit and it's a generic ComfyUI quirk, not specific to Derfuu.

    The one thing that is specific to this pack: Derfuu has a history of removing deprecated nodes on updates rather than keeping a legacy-labeled version around, and people who've relied on the pack for a while have called it out directly - nodes they used (string helpers, a "tuples" node) disappeared between versions with no warning. If a workflow that used to open cleanly suddenly throws a missing-node error after you update the pack, that's the most likely explanation - check the GitHub repo for a renamed equivalent before assuming your ComfyUI install is broken. Trig nodes aren't the ones that have been pruned historically, but it's worth knowing the pattern exists before you build something that depends heavily on this pack long-term.

    CategoryDerfuu_Nodes/Math/Trigonometry

    Inputs (3)

    NameTypeDefaultDescription
    valueFLOAT1.00
    type_COMBO2 options: RAD, DEG
    arcCosCOMBO2 options: false, true

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT