ComfyUI Node

Add

Image addition without the overflow — the pack's most literal blend

By CoiiChan·Created about a year ago·Updated about a year ago· 2
Add
  • imga
  • imgb
  • IMAGE
formularesult = imga + imgb

Add is the most literal node in this pack: it adds two images together, pixel by pixel, channel by channel. No screen trick, no weighted average, no fancy math - result = imga + imgb. It exists because ComfyUI's stock arithmetic nodes live in latent space (where "add" means adding noise schedules, not pixel values), and adding image tensors is genuinely awkward without a custom node. This is the fix.

Why would you add two images instead of blending them? Two real reasons:

  1. You want the sum, not an average. Add a light pass to a base pass and you get more light - the composite brightens where both are bright, rather than both fading toward gray. That's the "additive glow" look.
  2. You're building a formula chain. This pack's whole philosophy is visible, rule-based image math. Add is the atom; you chain it with Multiply, Clamp, and Oneminus to construct the exact blend Photoshop hides behind a dropdown.

How it works

Pre-filled CustomScript-NumPy formula:

result = imga + imgb

That's it. The important part is what the pack does around the addition: the node converts both images to NumPy arrays, broadcasts shapes, and returns a [B, H, W, C] float tensor. Critically, nothing clamps the result - add two fully-bright pixels and you get 2.0. That's mathematically correct, and it's a trap if you forget it.

Inputs and outputs

  • formula - the one-liner above. Editable, like every basic node here.
  • imga - reference image, sets output resolution (512×512 default if unconnected).
  • imgb - second image. Leave it empty and you get imga back (missing input = zeros), which is a handy identity check.

One IMAGE output.

Install

ComfyUI Manager → search "FuncAsTexture", or:

cd ComfyUI/custom_nodes
git clone https://github.com/CoiiChan/ComfyUI-FuncAsTexture-CoiiNode
# restart ComfyUI

No models, no requirements.txt. Category: FunctionAsTexture.

Where people get burned

  • Values above 1.0 are real. The tensor can hold 2.0, 3.0, whatever - only the preview clamps. If you feed that downstream, you'll get clipped or poisoned results. The pack's own answer is the Clamp node (np.clip(imga, 0, 1)) right after Add.
  • Resolution mismatch throws. imga at 1024 and imgb at 768 is a NumPy shape error. Keep them identical.
  • Additive compositing ≠ averaging. If you actually wanted a 50/50 mix, you want (imga + imgb) * 0.5 - which is exactly the kind of formula the CustomScript-NumPy main node exists to let you type. Add is the raw material.

Use it as the raw addition it is, clamp or scale the result, and it's rock solid. Expect it to silently wash out images and you'll have a confusing five minutes.

CategoryFunctionAsTexture

Inputs (3)

NameTypeDefaultDescription
formulaSTRINGresult = imga + imgb
imgaoptIMAGEOptional ,Reference size ,Default =(1,512,512,3)
imgboptIMAGEOptional

Outputs (1)

NameTypeDescription
IMAGEIMAGE