LatentOperationSinh
The steepest, most aggressive nonlinearity in the box
- op
Every activation in this pack is a tool, and LatentOperationSinh is the one labeled "handle with care." Hyperbolic sine, (e^x − e^(−x)) / 2, is the odd-symmetric curve that stays near-linear for small values and then explodes - exponentially - once values get large. Applied to a latent, it's an aggressive contrast amplifier: it passes modest values through almost untouched, but anything at the edges of the distribution gets stretched hard. If you're chasing a strong, symmetric, dramatic reshape, this is the one. If you're not sure you want that, you don't.
The mechanism
def sinh(latent, **kwargs):
return torch.sinh(latent * alpha)
One input: alpha (FLOAT, default 1.0) - the input gain shared by every activation node in this pack. The latent is multiplied by alpha, then sinh runs. Since sinh is odd and symmetric, positives get stretched upward and negatives stretched downward, and the near-linear region shrinks as alpha grows - at alpha = 1 a value of 1 maps to ≈1.175 (mild), but a value of 3 maps to ≈10 (severe). Crank alpha and the tails of your latent distribution go flying off toward infinity, which is exactly how you get NaNs or a decoder that produces searing noise. There's no clamp, no floor, no guard - the pack ships LatentOperationClamp as a separate node, which should tell you something about the division of labor.
Compared to the rest of the family, think of it this way: LatentOperationSigmoid and LatentOperationSiLU squash and smooth; LatentOperationReLU and LatentOperationReLU6 gate; LatentOperationSinh amplifies. The one legitimate niche is deliberate, strong shaping - stretching the dynamic range of a latent in a symmetric, smooth way that a linear MulBroadcast can't reach because linear scaling can't change the shape of the distribution, only its size. If you want more contrast character without the exponential blowup, LatentOperationMish gives you smooth non-monotonic behavior with a bounded floor, and LatentOperationTanh (a sibling node in this pack, not among these) is the bounded inverse. For a beginner, reach for sinh only when you've already watched what it does on a copy - this is an "experiment on a saved workflow" node.
The op output
Output is op of type LATENT_OPERATION - a deferred closure, like every node in hnmr293/ComfyUI-latent-ops. The pack builds operations and ships no apply node, so you need a LATENT_OPERATION consumer (Sonar's SonarApplyLatentOperationCFG is the one that exists in the wild) or your own apply node. Wiring op directly into a VAE Decode gives you a type mismatch - the pack's universal first trap, by design.
Install
Same story as the rest. ComfyUI Manager → search ComfyUI-latent-ops, or git clone https://github.com/hnmr293/ComfyUI-latent-ops into ComfyUI/custom_nodes, then restart. No requirements.txt, no model downloads - plain PyTorch. This is hnmr293's personal latent workbench (he wrote sd-webui-cutoff and llul); it's essentially unmarketed, so latent_ops/functions.py is your documentation. Everything lives under hnmr/latent_ops.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| alpha | FLOAT | 1.0000-10000–10000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| op | LATENT_OPERATION | — |