ComfyUI Node

Add

Add without the int/float existential crisis

By Scorpiosis0·Created 10 months ago·Updated 2 months ago· 3
Add
  • x
  • result
int_value0
float_value0.00

Stock ComfyUI's math nodes have a personality disorder: INT nodes only accept ints, FLOAT nodes only accept floats, and if you wire the wrong one in, the connection simply won't take. WtlAdd sidesteps all of that with one input socket, x, that accepts INT or FLOAT, and adds a value to it. That's the entire job, and it does it cleanly.

The mechanism is the pack's signature dual-widget setup. x is a union socket, and next to it you get two sliders: int_value and float_value, both defaulting to 0. Connect an int wire and the frontend shows you the integer slider; connect a float and you get the float one. Under the hood it's a one-line isinstance check that picks whichever matches. You can't set the wrong one because you never see it.

Output is a single result socket, typed INT,FLOAT to match whatever came in. If you add an int to an int you get an int back; throw a float in and the result is a float. That type fidelity is the whole reason to use this over rolling your own math - the next node downstream will accept what this hands off, because it's the same type you gave it.

Where does this earn its keep? Everywhere you're doing arithmetic on values that aren't fixed numbers - say offsetting a steps value computed by another node, or nudging a seed, or adding a constant to a denoise float that's coming out of a scheduler. It's also just a nicer constant-builder than typing into a bare INT widget when the amount you're adding changes based on workflow state.

It ships in the WtlNodes pack (Scorpiosis0/ComfyUI-WtlNodes). Install via ComfyUI Manager by searching "WtlNodes", or:

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

then restart ComfyUI. Dependencies are just numpy, scipy, and pillow - no models, no keys, no downloads.

There's no real trap here unless you count one: this is the kind of node you'll forget isn't stock ComfyUI, then reload a shared workflow and get "missing node" errors until you install the pack. It's a tiny utility, but it's the right shape - one job, typed correctly, no ceremony.

CategoryWtlNodes/logic

Inputs (3)

NameTypeDefaultDescription
xINT,FLOAT
int_valueINT0-2147483648–2147483647
float_valueFLOAT0.00-1000000000–1000000000

Outputs (1)

NameTypeDescription
resultINT,FLOAT