ImageCompositeRelative
Center or corner-pin images with percentages, not pixels
- images_a
- images_b
- IMAGE
Pixel offsets are great until you change the canvas size and every element is suddenly in the wrong place. ImageCompositeRelative is the responsive sibling of ImageCompositeAbsolute: instead of typing pixel numbers, you place each image with a 0–1 percentage, and the node converts that to pixels based on the container and image sizes at runtime. It's the node that survives resolution changes without you touching a thing.
How it works
For each image the offset is computed as (container_size - image_size) × percent. Read that as "fraction of the leftover space": 0 pins the image flush to the top-left, 1 pins it flush to the bottom-right, and 0.5 centers it - in both X and Y, independently. So images_a_x = 0.5 with images_a_y = 0.5 is "center image A," and images_b_x = 1 with images_b_y = 1 is "image B in the bottom-right corner," regardless of what the sizes actually are.
The canvas itself is defined by container_size_type:
- max - the largest width and largest height of the two images (what
ImageContainerInheritanceMaxbuilds). - sum - both widths and both heights added.
- sum_width - side-by-side sizing (widths add).
- sum_height - stacked sizing (heights add).
One flag worth knowing: in the current source, the sum_height branch adds height_a twice rather than height_a + height_b. It's a real quirk, and if your stacked layout comes out a frame taller than it should be, that's why - treat that mode with suspicion and check the output size.
The background input picks which image is the base layer, and method is the usual pair / matrix batch behavior.
Why you'd use it
Any layout you want to be self-adjusting: a centered watermark, a corner badge, a two-up comparison that needs to work at any generation resolution. Because the percentages resolve against real sizes, you can build the workflow once and swap in bigger images later. Same RGBA and edge-cropping notes as the rest of the family - output is transparent where nothing is placed, and extreme placements can crop.
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 - more reliable given the pack's history of manual-install import errors (reinstall via Manager was the repeated fix in early Reddit threads). Dependencies are rembg + onnx; 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 - the README's update-troubleshooting docs have the fix; delete-and-reclone is the blunt one. [Allor] console lines at startup are the pack writing config.json and checking updates, not an error.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| images_a | IMAGE | — | |
| images_b | IMAGE | — | |
| images_a_x | FLOAT | 0.00 | — |
| images_a_y | FLOAT | 0.00 | — |
| images_b_x | FLOAT | 0.00 | — |
| images_b_y | FLOAT | 0.00 | — |
| background | COMBO | 2 options: images_a, images_b | |
| container_size_type | COMBO | 4 options: max, sum, sum_width, sum_height | |
| method | COMBO | 2 options: pair, matrix |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |