ComfyUI Node

ImageComposite_Zho

The overlay node that makes collages and text-on-image painless

By ZHO-ZHO-ZHO·Created 3 years ago·Updated 2 years ago· 123
ImageComposite_Zho
  • images_a
  • images_b
  • IMAGE
alpha_a1.00
alpha_b1.00
images_a_x0
images_a_y0
images_b_x0
images_b_y0
container_width0
container_height0
background
method

ImageComposite_Zho is the node that finally lets you put one image on top of another inside the graph, with real control over where it lands and how see-through it is. No Photoshop step, no external script, no fiddling in a Save Image workflow before or after. You feed it two image batches, it hands you one combined image. That's it, and that turns out to cover a lot: watermarking, logo-on-image, side-by-side comparison shots, text-on-poster, and - the thing people actually discover it for - composing text rendered by this pack's own Text_Image_Zho onto a generated background.

It's from ZHO-ZHO-ZHO's ComfyUI-Text_Image-Composite pack. The README is famously bare ("docs still being written" is about the extent of it), but the node is dead simple in practice, so it's fine. Unlike several of the author's other packs, this one downloads no models, needs no API key, and runs entirely on PIL - it's pure image math.

How it works

Under the hood it's a classic alpha composite. Each input image gets an alpha channel filled with its alpha_ value, both get placed into a container canvas at their x/y offsets, and PIL's alpha_composite merges them. The container is sized to the larger of the two images by default - set container_width/container_height to anything nonzero and you get an explicit canvas instead, with out-of-bounds pixels clipped.

The two choices that actually change your life:

  • background - which image sits underneath: images_a or images_b. The other one is composited on top.
  • method - pair expects both batches to be the same length and composites them index-by-index; matrix crosses every image in A with every image in B, so two batches of 3 give you a batch of 9. That's your free contact-sheet / grid mode.

The inputs that matter

  • images_a, images_b - the two IMAGE inputs. Batch tensors work.
  • alpha_a, alpha_b - opacity, 0 to 1. Both default to 1 (fully opaque). This is the "overlay" knob.
  • images_a_x, images_a_y, images_b_x, images_b_y - integer pixel offsets from the top-left of the canvas. Yes, pixels, not percentages - see the By sibling if you want resolution-agnostic positioning.
  • background, method - the enums above.

Output is a single IMAGE, ready to feed into a VAE decode, an image upscale pass, or Save Image.

Installing it

Via ComfyUI Manager, search ComfyUI-Text_Image-Composite and install. Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-Text_Image-Composite

Then restart ComfyUI. There's no requirements.txt - the pack only needs torch, numpy, Pillow and torchvision, all of which ship with ComfyUI already. Fonts for the text nodes are bundled in the pack's font/ folder, so nothing else to fetch.

Where people get burned

  • Pair mode with mismatched batches raises a ValueError telling you the sizes aren't equal. If you're feeding it two images of different lengths, switch to matrix.
  • Both offsets at 0 means both images occupy the same top-left corner - they'll sit exactly on top of each other. That's correct behavior, just not usually what you wanted. Give the top image an offset or grow the container.
  • The node menu label is Zho模块组/image (that's Chinese for "Zho module group"), which can make the node hard to find if you search in English. Search for the class name instead.

A common trap is expecting per-pixel alpha from the inputs - you don't get that. alpha_a and alpha_b are uniform values for the whole image, so if you want a soft gradient fade you'll need a mask and a different compositor. For flat overlays, watermarks and layouts, this is the one you'll actually reach for.

CategoryZho模块组/image

Inputs (12)

NameTypeDefaultDescription
images_aIMAGE
images_bIMAGE
alpha_aFLOAT1.000–1
alpha_bFLOAT1.000–1
images_a_xINT0
images_a_yINT0
images_b_xINT0
images_b_yINT0
container_widthINT0
container_heightINT0
backgroundCOMBO2 options: images_a, images_b
methodCOMBO2 options: pair, matrix

Outputs (1)

NameTypeDescription
IMAGEIMAGE