ComfyUI Node Runs on cloud

Tangent

Tangent and arctangent in one node

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

    DF_Tangent computes a tangent - or, flip one toggle, an arctangent - of a value you feed it. It's one of the trig nodes in Derfuu_ComfyUI_ModdedNodes, a math-and-utility pack that's been part of the ComfyUI furniture since 2023, back when there wasn't much built into ComfyUI for doing arithmetic on a value mid-graph. You will not need this for a normal generation workflow. It's for the smaller set of graphs that need an angle-driven or periodic value: staggering a parameter across a batch on a curve instead of a straight ramp, driving a rotation, or any custom formula someone wired up node-by-node before ComfyUI had a proper expression evaluator.

    Worth knowing up front: the pack also ships a plain Tangent node with identical inputs and output, in the same Derfuu_Nodes/Math/Trigonometry menu. That's the older, unprefixed name kept around for workflows that already reference it; DF_Tangent matches the naming convention the rest of the pack settled on (DF_Sum, DF_Sinus, DF_Cosines, and so on), so it's the one to reach for if you're wiring something new.

    How it works

    Three inputs, one output - a thin wrapper around Python's math module:

    • value (FLOAT, default 1) - the angle to take the tangent of, or, with arcTan on, the ratio you want the angle for.
    • type_ - RAD or DEG, so the node matches whatever unit the rest of your math chain uses.
    • arcTan - a toggle that flips the node from tangent to its inverse, arctangent.

    With arcTan off, the output is tan(value) - and unlike sine or cosine, tangent isn't bounded, so it can swing to very large numbers as value approaches 90°/π⁄2 radians (and is undefined right at that point). With arcTan on, you feed it a ratio and get back the angle it corresponds to, in whichever unit type_ specifies. Having both directions behind one checkbox instead of two separate nodes is a small, genuinely convenient choice.

    The inputs and outputs that matter

    Output is a single FLOAT - the tangent or arctangent result, wired onward into whatever's consuming the computed angle or ratio.

    Where it fits

    This is a building block for someone composing their own formula on the canvas, alongside things like DF_Sum, DF_Multiply, or DF_Random. It predates rgthree's Power Puter, which evaluates a whole python-like expression in one node instead of a chain of single-operation nodes - genuinely less wiring if you're starting fresh and just need tan(x) once. DF_Tangent earns its keep when you're extending a workflow that already leans on Derfuu's math nodes throughout, or when you'd rather see every intermediate step of a calculation as its own inspectable node.

    How to install it

    The 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 ComfyUI. It's pure Python logic - no models to download, no unusual dependencies - so the install itself is fast and rarely the thing that goes wrong.

    Common issues & troubleshooting

    Huge or inf-looking numbers. That's tangent doing what tangent does near 90° (or π⁄2 radians) - the function genuinely blows up there. If a downstream node chokes on the value, clamp it before it goes further.

    Node doesn't show up right after installing. Restart the server and hard-refresh the browser tab - a stale frontend cache is the usual culprit, and it's a generic ComfyUI quirk rather than anything specific to this pack.

    Old workflow references a Tangent node that won't load. Derfuu has a documented history of removing deprecated nodes outright on updates instead of keeping a legacy-labeled version - people who've relied on the pack a while have flagged this happening to nodes they used. If a graph throws a missing-node error after you update, check the repo for a renamed equivalent before assuming your install is broken. Trig nodes haven't historically been the ones pruned, but the pattern is worth knowing before you build something that leans on this pack long-term.

    CategoryDerfuu_Nodes/Math/Trigonometry

    Inputs (3)

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

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT