Nodes/GraftingRayman/GR Stack Image
ComfyUI Node

GR Stack Image

Glue two images together side by side or top to bottom

By GraftingRayman·Created 2 years ago·Updated about a month ago· 76
GR Stack Image
  • image1
  • image2
  • IMAGE
border0
colour
horizontal_stackfalse

The simplest node in this whole pack, and it does exactly what it says: takes two images and stitches them into one, either stacked vertically or side by side, with an optional colored divider between them. It's the node for before/after comparisons, model-A-vs-model-B grids, or just gluing two outputs into a single shareable image without opening an image editor.

How it works

Feed in image1 and image2, decide the layout with horizontal_stack - off by default, which stacks them top to bottom; set it true for side by side - and optionally add a border (pixels, 0 by default so tiles butt directly against each other unless you set one) in one of seven basic colour choices.

There's no resize or alignment input anywhere in the schema. That means the node has to make its own decision about what to do when image1 and image2 are different dimensions, and the schema doesn't tell you what that decision is. The safe move, rather than guessing, is to resize both inputs to matching dimensions upstream first - matching width if you're stacking vertically, matching height if you're stacking horizontally - with a standard resize node before they hit this one.

The inputs and outputs that matter

  • image1 / image2 - the two images to combine, required.
  • horizontal_stack - false stacks top-to-bottom, true stacks side-by-side.
  • border / colour - an optional divider between the two, seven basic colors (black, white, red, blue, green, purple, yellow).

One output: IMAGE, the combined result.

How to install it

ComfyUI Manager, search GraftingRayman. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/GraftingRayman/ComfyUI_GraftingRayman

Restart afterward. The pack fails to import entirely without OpenAI's CLIP installed separately, even though this node has nothing to do with CLIP - portable ComfyUI: .\python_embeded\python.exe -m pip install git+https://github.com/openai/CLIP.git; system Python: pip install git+https://github.com/openai/CLIP.git.

Common issues & troubleshooting

Pack fails to load. Check your startup console for the CLIP import error and run the pip install above.

Result looks off-center, stretched, or one image dominates the frame. Almost always a size mismatch between image1 and image2 - resize both to matching dimensions before this node rather than relying on it to reconcile the difference for you.

Border isn't showing up. border defaults to 0, so if you want a visible divider you need to set it explicitly along with a colour.

Wanted more color options than the seven basics. This node's palette is deliberately small - for a much wider named-color set, see this pack's GR Text Overlay node, though that's a different tool (text burning, not image stacking) and won't help here directly.

CategoryGraftingRayman/Images

Inputs (5)

NameTypeDefaultDescription
image1IMAGE
image2IMAGE
borderINT0
colourCOMBO7 options: black, white, red, blue, green, purple, +1
horizontal_stackBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE