ComfyUI Node

Square

Square a number in your graph without a calculator node

By Scorpiosis0·Created 10 months ago·Updated 2 months ago· 3
Square
  • a
  • result

This is a node that returns x². That's it. Square takes a number and squares it, in the same spirit as the rest of WtlNodes' logic pack - a tiny, single-purpose math node that exists so your graph can do arithmetic without dropping into a calculator or a custom script.

The honest review: you will probably not rebuild your whole workflow around this node. But it's genuinely handy in the niche case where you're composing math inside a graph - area calculations from side lengths, quadratic scaling of a value, noise-intensity curves - and you want the operation visible as a node rather than buried in a big math expression.

The inputs

  • a - the number to square. It accepts INT or FLOAT, and the output keeps that type, so 2 gives you 4 (int) and 2.0 gives you 4.0 (float).

One output: result.

Where it actually gets used

  • Squaring a scale factor. Doubling a dimension quadruples the area - if you're scaling a canvas or a region by a multiplier and need the area multiplier, this is the node.
  • Quadratic falloff. A cheap intensity curve - square your slider value and you get a fast-then-gentle response, which is exactly the shape you want for some blend strengths.
  • Building math pipelines. Pair it with the pack's Add/Subtract/Multiply/Divide nodes and you can compose a small arithmetic chain entirely in the graph.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Scorpiosis0/ComfyUI-WtlNodes.git

Restart ComfyUI, or search "WtlNodes" in ComfyUI Manager.

The honest gotcha

Core ComfyUI already ships a primitive and math options, and there's no shortage of expression-eval nodes in the ecosystem - if you're doing more than one math op, a proper math node will serve you better than a chain of these. Square is for the occasional in-graph multiplication, not a replacement for arithmetic infrastructure. It does exactly one thing, does it right, and moves on. Sometimes that's all you need.

CategoryWtlNodes/logic

Inputs (1)

NameTypeDefaultDescription
aINT,FLOAT0

Outputs (1)

NameTypeDescription
resultINT,FLOAT