ComfyUI Node

asin

Given a ratio, get the angle

By StableLlama·Created about a year ago·Updated 4 days ago· 48
asin
  • value
  • FLOAT
unitdegrees

The angle whose sine is your number

asin is arc sine - the reverse of sine. Where sin(30°) gives you 0.5, asin(0.5) gives you 30°. If you know a vertical component or ratio and need the angle that produced it, this is the node. It's the sibling of the pack's acos, and it sits right beside it under Basic/maths.

Real talk: in a typical image-generation workflow you'll use the trig nodes rarely, and when you do it's usually for a rotation or geometry calculation that a slider would be overkill for. This is the "I just need this one angle" tool for those moments.

How it works

The node computes asin(value) and converts the result to degrees if you've selected that unit (the default). Same design as the pack's other inverse trig nodes: a value input, a unit dropdown with radians/degrees, one FLOAT out.

Same domain rule as acos too: the input must be between -1 and 1, because the sine of a real angle never leaves that band. Feed it 1.5 and you get a Python math domain error with no graceful explanation. The output range is -90° to 90° (or -π/2 to π/2 in radians) - that half-circle range is inherent to how arc sine is defined, so a given ratio maps to exactly one answer in that window. If you need the other possible angle (sine is symmetric), you'll have to derive it - 180° minus your result.

The value field is a text input that takes a plain number (float()-parsed), not an expression. Type 0.5, or wire a node's output into it. The pack's "formula" node is where expressions live; this one wants a number.

Inputs and outputs

  • value (FLOAT or INT, default 0) - a number between -1 and 1.
  • unit (enum, default degrees) - radians or degrees.

Output is a single FLOAT: the angle whose sine is the input, in your chosen unit.

Installing it

Part of Basic data handling by StableLlama, the r/StableDiffusion regular better known for his model comparisons (the Flux Klein 9B writeup especially) than for code. The pack is deliberately minimal - zero runtime dependencies in its pyproject, no models, no API keys - so installation is trivial.

Install via ComfyUI Manager (search "Basic data handling") or:

cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling

Restart ComfyUI; it's under Basic/maths.

Troubleshooting

The two usual suspects: input outside [-1, 1] throws a bare math domain error (clamp your value first), and forgetting the unit dropdown gives you radians when you wanted degrees (or vice versa), which silently mis-scales everything downstream. If a trig result looks obviously wrong, check the unit before anything else.

CategoryBasic/maths

Inputs (2)

NameTypeDefaultDescription
valueFLOAT,INT0
unitCOMBOdegrees2 options: radians, degrees

Outputs (1)

NameTypeDescription
FLOATFLOAT