ImageContainerInheritanceMax
A canvas that fits both of your layers, no math required
- images_a
- images_b
- IMAGE
You've got two images of different sizes and you want a canvas big enough to hold both without clipping either. ImageContainerInheritanceMax builds it for you: it takes two image batches, takes the max width and max height across them, and returns a solid-color RGBA canvas of exactly that size. It's the natural preamble to an absolute composite - build the canvas, then place both layers onto it.
How it works
It looks at the first frame of images_a and the first frame of images_b, computes max(width_a, width_b) and max(height_a, height_b), and creates a canvas there. Simple enough that you could do it by hand - the value is that it updates automatically when your source resolutions change, and it handles batches for you.
Inputs that matter:
- images_a / images_b - the two layers. Only the first frame of each sets the canvas size.
- red / green / blue / alpha - fill color. Alpha defaults to 0 (transparent) here too.
- method -
singlereturns one canvas;for_each_pairreturns one per frame of A (length of A);for_each_matrixreturnslen(A) × len(B)canvases for cross-product batch workflows.
The pair/matrix modes exist because the composite nodes work the same way: pair zips A and B 1:1 (and errors if the lengths don't match), matrix gives you every combination. Keep the method here matching the method downstream and your batch sizes will line up.
Why you'd use it
The classic case is compositing layers that come from different sources - a generated foreground and an upscaled background, say - where you don't want to babysit exact pixel sizes. Instead of a giant fixed canvas that wastes memory, or a too-small one that crops, InheritanceMax gives you the tightest canvas that fits both. From there, feed it into ImageCompositeAbsolute (with a container size of 0, which auto-fits to max - this node is that same logic made into a canvas you can also draw on), or pass it to any ByContainer node.
Installing Allor
This is one of ~90 nodes in the Allor Plugin (Nourepide/ComfyUI-Allor), an image-processing pack that's been around since early 2024. Install the pack once:
cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
cd ComfyUI-Allor
pip install -r requirements.txt
Restart ComfyUI, or search "Allor Plugin" in ComfyUI Manager and install there - the more reliable route with this pack, since early Reddit threads about Allor are mostly manual-install import errors fixed by reinstalling via Manager. Dependencies are rembg and onnx (pack's segmentation side only); 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, and delete-and-reclone is the blunt one. And the [Allor] lines in your console at startup are the pack writing config.json and checking updates, not an error.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images_a | IMAGE | — | |
| images_b | IMAGE | — | |
| red | INT | 255 | — |
| green | INT | 255 | — |
| blue | INT | 255 | — |
| alpha | FLOAT | 0.00 | — |
| method | COMBO | 3 options: single, for_each_pair, for_each_matrix |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |