Nodes/ComfyUI-Addoor/Image Concat with Mask
ComfyUI Node

Image Concat with Mask

Stitch two images and keep a mask of where they meet

By Eagle-CN·Created 2 years ago·Updated about a year ago· 75
Image Concat with Mask
  • image1
  • image2
  • mask
  • image
  • mask

Joins two images into one and hands you a mask alongside. That mask is the reason this exists - plenty of nodes glue images together, but the mask marking where the second image sits is what makes this useful for the "reference beside target" trick that shows up all over modern editing workflows.

Why you'd want this

The pattern this feeds is everywhere in Flux Kontext and Qwen-Edit style workflows: you put a reference image next to your working image on one canvas, run it through the model, and use a mask to tell the model which half to actually change. Stitch a product shot beside a blank area, mask the blank, and the model paints something consistent with the reference. Or set up a before/after layout for editing.

Doing that stitching by hand - canvas math, pasting, building a matching mask - is fiddly and easy to get one pixel off. This node keeps the join and the mask in sync automatically.

The inputs and outputs

  • image1 (required) - the first image.
  • image2 (optional) - the second. Wire it in and the two get combined.
  • mask (optional) - feed a mask in, and it travels along with the concatenation, kept aligned to the result.

Outputs are the combined image and a mask covering the appropriate region of that combined canvas.

Because image2 and mask are both optional, the node degrades gracefully - pass just image1 and it'll pass through, which is handy when you're toggling parts of a workflow on and off.

How it fits a workflow

Typical shape: image1 is your working image, image2 is your reference, and the mask output goes into whatever you're inpainting or conditioning with, so the model knows the reference region is off-limits and the target region is fair game. The combined image goes into your VAE encode. After sampling you crop back to the half you care about.

One honest caveat: the exact layout - whether it stitches side-by-side or top-to-bottom, and which region the mask covers - isn't something the node's interface spells out, so wire it up, run once, and look at the mask preview before you build the rest of the graph around it. Thirty seconds of checking saves a confusing debug later.

Installing ComfyUI-Addoor

ComfyUI Manager: Install Custom Nodes → search "ComfyUI-Addoor" → install → restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/Eagle-CN/ComfyUI-Addoor.git
cd ComfyUI-Addoor
pip install -r requirements.txt

Restart and look under 🌻 Addoor / image. Preview the mask output first - that's the fastest way to understand exactly what this node is doing before you commit to a layout.

Category🌻 Addoor/image

Inputs (3)

NameTypeDefaultDescription
image1IMAGE
image2optIMAGE
maskoptMASK

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK