Nodes/KayTool/𝙆 Image Composer
ComfyUI Node

𝙆 Image Composer

Glue two images together and keep the seam data for later

By kk8bit·Created 2 years ago·Updated about a year ago· 364
𝙆 Image Composer
  • image_a
  • mask_a
  • image_b
  • mask_b
  • DATA
  • IMAGE
  • MASK
positiontop

Image Composer takes two separate images and stitches them into one canvas - stacked top, bottom, left, or right of each other - and, crucially, remembers exactly where the seam is. That position data comes out as a DATA output, and it's what feeds Image Cropper, elsewhere in this pack, to split the two images back apart later. The point of the pair is running something across both images at once - a single upscale pass, a color match, anything that behaves more consistently applied to one combined canvas than to two separate calls - and then recovering the original two pieces afterward without manually tracking crop coordinates.

How it works

image_a and image_b are your two source images, position decides how they're arranged relative to each other, and the node outputs the combined IMAGE, a combined MASK, and the DATA blob that records the layout. If you don't have a mask for one of the images, the node handles that gracefully rather than erroring.

One thing worth flagging plainly, because it's a place where the pack's own README and its actual schema disagree: the README describes both mask_a and mask_b as optional inputs. The node's schema, though, lists mask_a as required and only mask_b as optional. In practice that means you may need to wire something into mask_a - even a blank/full mask from a basic mask node - to get this node to run at all, even though the documentation suggests you shouldn't have to. Worth testing early rather than assuming you can skip it because the README said so.

The inputs and outputs that matter

  • image_a (IMAGE) - required.
  • mask_a (MASK) - required by the schema (see note above), despite the README describing it as optional.
  • image_b (IMAGE) - required.
  • mask_b (optional, MASK).
  • position (top / bottom / left / right, default top) - how the two images are arranged.
  • DATA (output) - the position/layout record, feed this straight into Image Cropper.
  • IMAGE / MASK (outputs) - the combined canvas and its mask.

Installing it

Comes with the full KayTool pack: ComfyUI Manager → search KayTool → install → restart, or cd ComfyUI/custom_nodes && git clone https://github.com/kk8bit/KayTool and restart.

Common issues

If the node refuses to run with a "missing input" complaint on mask_a, that's the required-vs-optional mismatch above - wire in any mask (a solid black one from a basic mask-constant node works fine if you don't have a real one) rather than assuming it can be left empty. Beyond that, remember that whatever you do to the combined image after this node - resizing, cropping, further compositing - needs to happen before you hand it to Image Cropper, or the DATA position record won't line up with the image you're trying to crop from anymore. If you don't actually need to run shared processing across both images, it's worth asking whether you need this pair at all - for workflows where the two images never interact, keeping them on separate wires the whole time is simpler than composing and re-cropping.

CategoryKayTool/Image

Inputs (5)

NameTypeDefaultDescription
image_aIMAGE
mask_aMASK
image_bIMAGE
positionCOMBOtop4 options: top, bottom, left, right
mask_boptMASK

Outputs (3)

NameTypeDescription
DATADATA
IMAGEIMAGE
MASKMASK