Nodes/ꘇ Genereti/ꘇ top.composite
ComfyUI Node

ꘇ top.composite

Layer two images without a Photoshop round-trip (alpha intact)

By languel·Created about a month ago·Updated 3 days ago· 1
ꘇ top.composite
  • image
  • background
  • image
◄operation▾►
◄opacity1.00►

Most ComfyUI image nodes treat a picture as opaque RGB. The moment you've keyed a subject, or you're carrying alpha through a chain, "put A on top of B" stops being obvious and you find yourself exporting to a compositor for something that should take four seconds. top.composite is the boring node that fixes that: A over B, six blend modes, real alpha math, B resized to fit A.

The wider context matters here. The deterministic pixel-ops layer in ComfyUI is old and settled - nobody is going to innovate a blend mode - but the tooling around it is genuinely uneven: the broadest historical pack has been dormant for years, and the good small packs cover the common jobs and stop. If your job is "keyed product onto a rendered background" or "glow pass screened back over the source", this is glue that keeps you in the graph. It's also the node that makes feedback tricks work (see below).

How it works

The operation combo gives you over, under, add, multiply, screen, difference, cross. The math is straight (non-premultiplied) alpha compositing: output alpha is aa + ab(1-aa), and the blend function is applied only where the two layers overlap, weighted by both alphas. That's why over doesn't just paste the top layer's transparent border over the background. under is literally over with the operands swapped. cross is the odd one out: it interpolates premultiplied color and alpha by opacity, so it's a proper crossfade/wipe between the two inputs, written so transparent pixels don't smear halos into the blend.

B is resampled to A's dimensions when they disagree, and the resize is done premultiplied (color × alpha, interpolate, divide back), which is the detail that stops transparent edges from going dark. A sets the output resolution.

The inputs that matter

  • image (A) - the top layer. Resolution authority, so put the one you care about here.
  • background (B) - whatever sits under it. Gets scaled to A.
  • operation - over is right most of the time. Reach for screen/add when you're accumulating light (a blur pass, a feedback trail, a bloom), and difference when you want a fast change/motion matte between two frames.
  • opacity - fades A. Note it applies to B when operation is under, because the operands are swapped internally.

Output: image. Wire it to Preview/Save, or feed it forward - the pack's own Texture-Lab example goes noise/drawing → feedback → blur → corner pin → composite, and top.displace will happily eat a composite as a displacement map.

Install

Search ꘇ Genereti in ComfyUI Manager and install (publisher liuboto), or from your ComfyUI folder:

git clone https://github.com/languel/genereti.git custom_nodes/genereti
./.venv/bin/python -m pip install -r custom_nodes/genereti/requirements.txt

Restart Comfy, then refresh the browser page. The requirements file is one line - comfyui-frontend-package>=1.53.6 - because ComfyUI already ships torch and NumPy. No model downloads, no server, no API key for any of these texture nodes. They register under the Genereti / TOP category with display names like ꘇ top.composite; the leading glyph is the pack's mark and it sorts badly, so search genereti or top.composite instead of scrolling.

Where people get burned

Live vs Queue. Every one of these nodes has two backends: a WebGPU path for live browser rendering, and a PyTorch path for a normal Queue run. Same node, mathematically the same operation, not bit-identical output - live intermediates are 8-bit, Queue keeps float. If a queued render looks a hair darker than the live preview, that's the design, not a bug. Live mode needs a WebGPU-capable browser.

Alpha dies downstream, not here. Composite will hand you a four-channel image, but a lot of ComfyUI plumbing silently drops the alpha channel on the way to disk. If your keyed subject lands on black in the saved file, blame your Save/Preview node before you blame this one.

Batches. If both inputs are batches they must have the same number of images, or B must be a single image that broadcasts. Mismatched batches raise an error rather than guessing.

The pack is explicitly labelled super-alpha, early classroom testing. Back up workflows you care about before you update it.

CategoryGenereti / TOP

Inputs (4)

NameTypeDefaultDescription
imageIMAGE—
backgroundIMAGE—
operationCOMBO7 options: over, under, add, multiply, screen, difference, +1
opacityFLOAT1.000–1—

Outputs (1)

NameTypeDescription
imageIMAGE—