ComfyUI Node

Pt Cosh

Hyperbolic cosine, the trig cousin you'll use twice a year

By HowToSD·Created about a year ago·Updated about a year ago· 7
Pt Cosh
  • tens_a
  • TENSOR

Pt Cosh computes the hyperbolic cosine of every element in a tensor. If that made you go "right, that thing," you're the audience. If it made you go "hyperbolic what," the honest answer is: you don't need this node yet, and that's fine.

Hyperbolic cosine (cosh) is the even half of the cosh/sinh pair - cosh(x) = (e^x + e^-x) / 2. It shows up in real math more often than its reputation suggests: the shape of a hanging cable (catenary), stable activations in some neural architectures, and various soft-plus-adjacent transformations. In this pack it sits in the math-operations cluster alongside PtCos, PtSin, PtTan and PtSinh, all wrapping the corresponding torch function with zero added logic. Input a float tensor, get a same-shape float tensor out, element-wise.

What to actually know

It's a thin wrapper over torch.cosh(tens_a) - one input, one output, no parameters to mis-set, no dtype traps beyond "keep it float." The only realistic mistake is reaching for PtCos (plain cosine) when your math calls for PtCosh - they're adjacent in the node list and visually similar. Check your formula before you blame the graph.

And a genuinely niche-but-neat property worth remembering: cosh is strictly positive and grows very fast, so it's occasionally used as a smooth, always-positive nonlinearity in hand-built models. If you're assembling a network from the pack's model-building nodes and need such a thing, this is the one.

Installing it

Ships in ComfyUI-Pt-Wrapper by Hide Inada (HowToSD). ComfyUI Manager → search "ComfyUI-Pt-Wrapper" → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Pt-Wrapper

The pack drags a heavy requirements.txt along - transformers, datasets, scikit-learn, scipy, gensim, pandas, peft, accelerate, matplotlib, seaborn. If the auto-install chokes, pip install -r requirements.txt inside the clone. No model downloads for pure tensor math.

CategoryData Analysis

Inputs (1)

NameTypeDefaultDescription
tens_aTENSOR

Outputs (1)

NameTypeDescription
TENSORTENSOR