ComfyUI Node Runs on cloud

Cosines

Cosines – ComfyUI Node from Derfuu_ComfyUI_ModdedNodes

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

    If you've opened an older workflow and found a lone node called just Cosines sitting in your graph - no DF_ prefix, nothing else like it - you're looking at a fossil from Derfuu_ComfyUI_ModdedNodes, a math/utility pack that's been part of the ComfyUI furniture since mid-2023. It does exactly what the name says: feed it an angle, get back its cosine (or arccosine).

    This pack ships a second node, DF_Cosines, with the identical inputs and identical output, living in the same Derfuu_Nodes/Math/Trigonometry menu. That's not a coincidence or a bug in the catalog - both are genuinely registered by the pack. The bare Cosines name looks like an older, pre-DF_-prefix class that's been kept around for backward compatibility with workflows that already reference it, while everything else in the pack (Sum, Subtract, Sinus, and so on) has since settled on the DF_ naming convention. If you're wiring a new graph from scratch, reach for DF_Cosines instead - it's the one that matches the rest of the pack, and it's the one you'll find getting maintained going forward. This node exists mainly so old workflows don't break.

    What it actually does

    Cosines takes a single numeric value and three settings:

    • value - the angle you're feeding in (or, if you flip arcCos on, the cosine ratio you want the angle for)
    • type_ - RAD or DEG, telling the node whether value is in radians or degrees
    • arcCos - a toggle that switches the node from "give me the cosine of this angle" to "give me the angle whose cosine is this" (the inverse function)

    It returns a single FLOAT. With arcCos off, that's cos(value) - always somewhere between -1 and 1, no matter how big the angle. With arcCos on, it's the inverse: you hand it a ratio and get back the angle, in whichever unit type_ is set to.

    Trig nodes like this one aren't the bread-and-butter of a typical image workflow - you won't need this for a normal txt2img pass. Where they earn their keep is in more elaborate parametric setups: driving a rotation, staggering values across a batch with a sine/cosine curve instead of a flat linear ramp, or any custom math chain someone built before ComfyUI had a proper expression node. If you've seen rgthree's Power Puter, that's the modern equivalent - one node that evaluates a whole formula instead of wiring up a Cosines node per operation. Derfuu's approach predates that; it's one operation, one node, wired by hand.

    Installing it

    Grab the whole pack, not just this node - there's no way to install a single node from a Derfuu-style custom-node repo. Easiest path is ComfyUI Manager: open it, search for Derfuu_ComfyUI_ModdedNodes, install, restart. Manually, it's:

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

    then restart ComfyUI. No models to download, no heavyweight Python dependencies - it's pure logic nodes, so the install is fast and there's very little that can go wrong on that front.

    Troubleshooting

    If the node doesn't show up in the menu right after installing, restart the ComfyUI server and refresh your browser tab - a stale frontend cache is the most common cause, and it's a known point of confusion in the community, not something specific to this pack.

    The bigger thing worth knowing: Derfuu has a track record of deleting deprecated nodes outright on updates rather than keeping them around with a legacy label. People who've used the pack for a while have specifically flagged this - nodes they depended on (string helpers, a "tuples" node) vanished between updates instead of getting a deprecation warning first. If you update the pack and a workflow that used to load suddenly throws a missing-node error, that's the likely cause - check the pack's GitHub for a renamed or replacement node before assuming your install is broken. Given that history, don't be surprised if a bare-named legacy node like this one eventually goes away entirely; DF_Cosines is the safer long-term bet either way.

    CategoryDerfuu_Nodes/Math/Trigonometry

    Inputs (3)

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

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT