power
2 to the 10th, without the math node
- INT
Raising a number to a power is the operation behind every "doubling" calculation - 2^n, growth curves, resolution doubling chains - and it's the kind of thing a generic math node makes feel heavier than it is. power from the Basic data handling pack is a clean integer exponent node: base in, exponent in, integer out. If your workflow ever computes 2^x or similar, this is the node that makes it a one-liner instead of a formula-string puzzle.
What it does
base ** exponent, plain Python exponentiation. 2 ** 10 is 1024. 3 ** 3 is 27. Two details worth internalizing:
- An exponent of
0gives1- the default, and correct, since anything to the power of zero is one. That default means double-clicking the node gives you1, not an error. - Keep exponents non-negative. Python's
int ** negative-intreturns a float -2 ** -1is0.5- and a float doesn't fit this node's INT output cleanly. For fractional powers, use the pack's floatpowernode instead.
Inputs and outputs
base- INT, default1. The number being raised.exponent- INT, default0. How many times to multiply it.- Output
INT- the result ofbase ** exponent.
Install
Part of the Basic data handling pack. ComfyUI Manager → search "Basic data handling" → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
then restart ComfyUI. Pure Python, no dependencies, no model downloads.
When it's the right tool
The classic use is resolution math: a "tile until it's big enough" loop that squares dimensions, or an upscale factor computed as 2^n for N refinement passes. Pair it with IntMultiply for anything more complex than a plain power. And the growth warning: exponentiation gets big fast, and unlike fixed-width languages Python won't stop you - 10 ** 100 is a 101-digit integer that will happily flow into the next node. Great for exploration, but put a cap on it when it's feeding real parameters.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| base | INT | 1 | — |
| exponent | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |