Nodes/Node_Fun_ComfyUI/Multi Alpha Composite
ComfyUI Node

Multi Alpha Composite

Layer up to 8 images like Photoshop — alpha compositing for the node graph

By nofunstudio·Created 2 years ago·Updated about a month ago· 9
Multi Alpha Composite
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • image7
  • image8
  • IMAGE
num_images2

Multi Alpha Composite stacks up to eight images together using alpha blending - Photoshop layers, but as a ComfyUI node. You put images in, they composite bottom-to-top, and transparent regions of each layer let the layers beneath show through. If you've ever tried to build a multi-layer composite with ComfyUI's standard ImageCompositeMasked and felt the pain of chaining six of them together, this is the node that collapses the whole chain into one box.

The mechanism is the classic "over" compositing operation, done with PIL and alpha channels. Each input image is converted to RGBA, then composited in order with a standard alpha blend - bottom layer first, each subsequent layer painted on top, transparent pixels acting as the windows the README describes. The output is a single flattened RGB image. The source code is a textbook implementation: convert to RGBA, blend, flatten - no cleverness, no surprises, which is exactly what you want from a compositing utility.

The inputs:

  • num_images (2–8) - how many layers you're actually using. Set it to match, and the node only processes that many.
  • image1 - the bottom layer. Required, always.
  • image2 through image8 - layers stacked above it in order. image2 is required; 3–8 are optional.

One output, the flattened IMAGE.

Where it earns its place: any workflow that produces multiple alpha-keyed layers and needs them merged. The classic use is generated-background compositing - pull a subject out with an RMBG or background-removal pass (the KB's background-removal coverage is the canonical reference for that half of the pipeline), drop the cutout over a background, then layer a foreground element on top, and here's the whole thing as one node instead of a daisy chain. Another genuinely useful pattern: text or logo overlays with alpha, stacked on a base image. If you're already running a background-removal node in the graph, this is the natural landing spot for its output.

Honest limits. It's dumb in the best way - there's no positioning, no scale, no blend modes beyond straight alpha-over. Everything must already be the same size and in place, because this node has zero geometry controls. If you need to move, resize, or feather a layer, you do that before this node (ImageTransform, masks, whatever) and let this one just stack. And note the flattening: RGBA in, RGB out. Any alpha information dies here, so this is a terminal compositing step, not a pass-through.

Also worth knowing: image1's alpha is ignored in practice - the composite always paints the bottom layer as an opaque base (the code composites over a white background first). So if you expected layer 1's transparency to show through to something beneath, there is no "beneath" - put the truly opaque layer at the bottom.

Install is the pack standard: ComfyUI Manager search "Node Fun", or clone https://github.com/nofunstudio/Node_Fun_ComfyUI into custom_nodes, pip install -r requirements.txt, restart. No models, no keys, pure image math. For anyone who's survived a five-node composite chain, this is the "why didn't I have this already" node.

CategoryImage/Composite

Inputs (9)

NameTypeDefaultDescription
num_imagesINT22–8
image1IMAGE
image2IMAGE
image3optIMAGE
image4optIMAGE
image5optIMAGE
image6optIMAGE
image7optIMAGE
image8optIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE