ComfyUI Node

Power

Raise one value to the power of another, type-agnostic

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Power
  • input1
  • power
  • *

Power does exponentiation - input1 ** power - and that's the whole node. What's worth noticing is what it doesn't do: both inputs are typed as * (ComfyUI's wildcard "any type"), not locked to FLOAT or INT. That's a deliberate choice, not a gap - it means this one node handles integer powers, float powers, and whatever numeric type happens to be flowing through your graph at that point, instead of forcing you to pick between an "IntPower" node and a "FloatPower" node depending on context.

It's part of aria1th's ComfyUI-LogicUtils, a personal utility pack from the same handle behind the Illustrious XL training work - a collection of math, string, and logic helpers with a famously thin README. This one's about as simple as the pack gets: no widgets beyond the two connections, no hidden state.

Why you'd reach for it

Most workflows don't need raw exponentiation often, but when you do - computing a value that scales non-linearly with an input (say, an easing curve, a falloff, or a custom schedule multiplier you're building by hand from primitive math nodes) - this saves you from routing through a Python-expression node just for x ** y. It composes cleanly with the rest of LogicUtils' math and logic nodes if you're building a small computed pipeline entirely out of graph nodes rather than a script.

How it works

It computes input1 ** power and returns the result. Because both sockets are wildcard-typed, ComfyUI won't stop you from wiring in mismatched types at the graph level - the actual exponentiation happens in Python at execution time, so whether 2 ** 0.5 or 2.0 ** 3 behaves the way you expect follows ordinary Python numeric rules (int-to-int power stays an int when the exponent is non-negative; anything involving a float promotes to float).

Inputs and outputs

  • input1 (any type, required) - the base.
  • power (any type, required) - the exponent.
  • Output: the result of input1 ** power (also wildcard-typed, matching whatever type the computation produces).

How to install it

ComfyUI Manager: search "ComfyUI-LogicUtils", install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils

then restart ComfyUI. No models, no dependencies beyond the Python standard library.

Common issues & troubleshooting

"Missing node type" on a shared workflow. ComfyUI Manager's "Install Missing Custom Nodes" installs the whole pack from the graph JSON in one step.

Import error on startup. The README documents an opt-in auto-installer for the pack's dependencies: COMFYUI_LOGICUTILS_AUTO_INSTALL=1 before launch to let it install what's needed, or COMFYUI_LOGICUTILS_SKIP_INSTALL=1 to disable that hook if it's the source of the error. PowerNode itself needs nothing beyond built-in Python.

Type errors or unexpected output type. Since both inputs accept anything, ComfyUI's connection UI won't warn you about a mismatch the way a strictly-typed node would - if you feed it something that isn't actually numeric (a string, an image), the error shows up at execution time, not when you make the connection. Double-check both wires are carrying actual numbers if the node fails at runtime.

Negative base with a fractional exponent. Ordinary math rules apply - a negative number raised to a non-integer power produces a complex result in plain Python, which this node isn't built to hand back into a numeric ComfyUI socket. Keep bases non-negative if your exponent isn't a whole number.

CategoryMath

Inputs (2)

NameTypeDefaultDescription
input1*
power*

Outputs (1)

NameTypeDescription
**