Nodes/comfyui-mixlab-nodes/Merge Layers ♾️Mixlab
ComfyUI Node Runs on cloud

Merge Layers ♾️Mixlab

Merge Layers — Flattening Mixlab's Layer Stack Into One Image

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Merge Layers ♾️Mixlab
  • layers
  • images
  • IMAGE
  • MASK
is_multiply_blendfalse

If you've used a NewLayer node to stack a few positioned, sized, and z-ordered images on top of each other Mixlab's Photoshop-style way, Merge Layers is the node that actually flattens that stack into something you can save, sample from, or run through ControlNet. The README frames this whole feature as splitting an image into layers so you can composite and feed the result into further processing - Merge Layers is the "composite" half of that pair.

The inputs match that job directly: layers, typed LAYER, is the stack you built up - typically a chain of NewLayer nodes, since each NewLayer optionally accepts a layers input from the previous one and passes the growing stack forward. images, typed IMAGE, is your base - the background or canvas everything else gets composited onto. There's one optional toggle, is_multiply_blend (boolean, default false), which switches how each layer combines with what's beneath it: leave it off for a normal alpha-over composite (each layer simply sits on top, respecting its mask/transparency), turn it on for a multiply blend, which darkens overlapping areas instead - the same basic distinction you'd recognize from any layer-based image editor's blend mode dropdown, just reduced to a single on/off switch here rather than a full list of blend modes.

Two things come back out: IMAGE, the fully composited result, and MASK, a mask covering the composited area. That mask output matters if your next step is feeding this into ControlNet or an inpaint pass and you need to know exactly which pixels came from your layer stack versus the original background - the README specifically calls out feeding a composed layer image into ControlNet as one of the intended uses.

Because Merge Layers depends entirely on getting a real LAYER-typed stack in from NewLayer (or several chained NewLayer nodes), the failure mode to watch for isn't really inside Merge Layers itself - it's upstream. If your composited result looks wrong (a layer missing, wrong stacking order, wrong position), check the z_index and x/y values on the individual NewLayer nodes feeding this before assuming Merge Layers mishandled something; it's a straightforward compositor operating on whatever stack it's handed, and a badly ordered or mispositioned stack will merge exactly as badly as it was built.

Install is the pack-wide standard. Through ComfyUI Manager: search "comfyui-mixlab-nodes," install, restart - the simplest route. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git
cd comfyui-mixlab-nodes
install.bat

or pip3 install -r requirements.txt in a venv, or the embedded-python pip call on a portable build. Restart ComfyUI when it's done. No separate model download needed here - layer compositing is plain image math, not an inference step, so there's nothing extra to fetch before this node works. If it's missing from the node menu after installing, that's a whole-pack load issue worth checking the console for, not something specific to Merge Layers.

Category♾️Mixlab/Layer

Inputs (3)

NameTypeDefaultDescription
layersLAYER
imagesIMAGE
is_multiply_blendoptBOOLEANfalse

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK