Nodes/Allor Plugin/ImageCompositeAbsolute
ComfyUI Node

ImageCompositeAbsolute

Place two images on a canvas with pixel-exact offsets

By Nourepide·Created 3 years ago·Updated 2 years ago· 296
ImageCompositeAbsolute
  • images_a
  • images_b
  • IMAGE
images_a_x0
images_a_y0
images_b_x0
images_b_y0
container_width0
container_height0
background
method

Compositing in stock ComfyUI is a two-node dance: scale everything to the same size, then Composite. That works but it's rigid. ImageCompositeAbsolute is the Allor version that treats placement like coordinates: two image inputs, an X/Y offset in absolute pixels for each, and an output canvas of whatever size you dictate (or auto-fit). Alpha is handled properly the whole way - both images are treated as RGBA and merged with real alpha compositing, not a hard paste.

How it works

The node pastes images_a at (images_a_x, images_a_y) and images_b at (images_b_x, images_b_y) onto a canvas, then alpha-composites them. The background input decides stacking order: images_a means A is the base layer, images_b means B is. If either input image has only 3 channels, the node adds an opaque alpha channel before compositing, so plain generated images just work.

Inputs that matter:

  • images_a / images_b - the two layers.
  • images_a_x / images_a_y and images_b_x / images_b_y - integer pixel offsets for each, default 0 (top-left corner of the canvas).
  • container_width / container_height - canvas size. 0 means auto: it becomes the max of the two images. This is the input that trips people - set it to 0 unless you specifically want a fixed canvas.
  • background - which image is underneath.
  • method - pair zips the batches 1:1 (and raises ValueError if batch lengths differ); matrix produces every A×B combination.

Where people get burned

Offsets are not clamped to the canvas - if an offset pushes an image past an edge, that part is cropped away (negative offsets are clamped to 0). If you place something at x = 900 on a 512-wide container and wonder where it went, that's what happened. Also remember the output is RGBA: composite onto a container if you want an opaque result, because a transparent canvas stays transparent where nothing was placed.

Why you'd use it

It's the cleanest way to build a layout where you've already decided the exact pixel positions - a collage, a comparison grid, a watermark corner, placing a cutout (from a background-removal node, say) at a precise spot on a backdrop. Because it lives in tensor space and does one pass per pair, it's also fast with batches: set up a pair composite once and it processes whole lists.

Installing Allor

Part of the Allor Plugin (Nourepide/ComfyUI-Allor), ~90 nodes from early 2024. Install once:

cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
cd ComfyUI-Allor
pip install -r requirements.txt

Restart, or search "Allor Plugin" in ComfyUI Manager (the more reliable route - early Reddit threads about Allor are mostly manual-install import errors, fixed by reinstalling via Manager). Dependencies are rembg + onnx for the pack's segmentation side; this node needs no models.

Gotchas that apply to the whole pack

The repo was rebased to strip images from history (shrank ~344×), which can break git pull/auto-update - see the README's update-troubleshooting docs; delete-and-reclone is the blunt fix. [Allor] console lines at startup are the pack writing config.json and checking updates, not an error.

Categoryimage/composite

Inputs (10)

NameTypeDefaultDescription
images_aIMAGE
images_bIMAGE
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