ComfyUI Node

Pt Sinh

The math node you'll use exactly when you need it

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

Pt Sinh computes the hyperbolic sine of every element in a tensor. Let's be honest: you will not reach for this one often. It's the kind of node that exists because the ComfyUI-Pt-Wrapper pack tries to mirror the full PyTorch math toolbox, and hyperbolic functions are part of that toolbox. But when you do need it - growth/decay curves, certain activation-adjacent math, probability distributions with hyperbolic terms, or just recreating a formula that uses sinh - it's a one-node drop-in instead of a trip out of ComfyUI to compute the values and paste them back in.

What it actually does

It's a direct wrapper around torch.sinh(tens_a). One TENSOR in, one TENSOR out, same shape, element-wise. Unlike regular sine, there are no units to worry about - sinh doesn't take angles, it takes plain numbers, so the "radians vs degrees" trap doesn't apply here. That makes it friendlier to use blind than its sibling Pt Sin.

What does apply: hyperbolic functions grow fast. sinh(x) is (e^x - e^-x)/2, and for large positive inputs that's basically half of e^x. Feed in values like 10 or 20 and you'll get astronomically large numbers - and with float16 or bfloat16 tensors you'll overflow to inf quickly. If your data has big magnitudes, either scale it down first or keep an eye on your dtype.

Only one input:

  • tens_a - the tensor to transform.

Output is a TENSOR of the same shape, ready to feed the next math node or a display node if you want to sanity-check the numbers.

How to install it

It's part of the ComfyUI-Pt-Wrapper pack. ComfyUI Manager: search ComfyUI-Pt-Wrapper, install, restart. Or clone it:

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

Restart after. The pack's requirements.txt pulls in the heavy training stack (transformers, datasets, accelerate, peft, gensim, sentencepiece, pandas, scikit-learn, scipy), so first install is slow and can conflict with other nodes pinning different versions of transformers. For one hyperbolic node, that's a big install - but it's bundled, so it's take-it-or-leave-it.

Gotchas

Overflow is the real gotcha here, not units. sinh explodes for large inputs, so if your tensor contains values past roughly ±88 for float32 (or much smaller for float16), you'll get inf or NaN. If your output suddenly looks like garbage, check the input magnitude first - it's almost certainly the math doing exactly what it's supposed to.

CategoryData Analysis

Inputs (1)

NameTypeDefaultDescription
tens_aTENSOR

Outputs (1)

NameTypeDescription
TENSORTENSOR