DJZ Offsquare Collage
2–6 images into one 4MP collage — without the manual layout dance
- images
- image
- layout_info
ComfyUI hands you batches of images everywhere - four seeds out of a KSampler, a character-consistency pass, a stack of variants - but stitching them onto one canvas is usually something you end up doing in a separate editor. DJZ Offsquare Collage is the node that closes that gap inside the graph. Feed it a batch of 2–6 images and it lays them out on a single ~4-megapixel canvas with overlapping, deliberately non-grid regions (hence "Offsquare"), then hands back one tidy IMAGE plus a text summary of what it chose. No image editor required.
Where it actually earns its keep: "same prompt, different seed" comparison boards, character sheets, quick reference collages to feed into img2img or an upscaler, and source boards before a ControlNet or inpainting pass. It's pure post-processing - CPU compositing with PIL, no generation, no model involved. If you want to generate grids inside the sampler so the cells influence each other during denoising, that's a different tool (latent-grid nodes like GridSwapper); this node takes finished images and arranges them, full stop.
How it works
The node ships three layout strategies per image count (2–6): diagonal/vsplit/hsplit for two, cascade/l-shape/reverse-l for three, grid/dominant-three/t-layout for four, quincunx/asymmetric/l-shape for five, and three grid variants for six. It scores each candidate by how well your images' aspect ratios match each region (70% weight) plus how much screen real estate each region claims (30%), then picks the winner automatically - there's no layout picker to fiddle with. Two placement rules are fixed: your first image goes to the top-left at the bottom of the z-order, and your last image goes to the bottom-right on top, sized to spill over the region below it. Every image is scaled to cover its region and centered, so cropping is expected, not a bug - that overlap is the whole collage look.
The inputs that matter
- images - a batch of 2–6 images. This is the one that trips people up: a single LoadImage output is a batch of 1, and the node throws a hard "requires at least 2 images" error. Batch your images first with something like core's
ImageBatchMulti. - aspect_ratio - a dropdown of
1:1, 16:9, 9:16, 3:2, 2:3, 4:3, 3:4. The canvas keeps ~4MP total (2048×2048 at 1:1), so 16:9 comes out 2731×1536. - border_radius - 0–64, corner rounding per region. 0 is sharp; something like 12–16 softens the collage feel a lot.
- background_color - a hex string (default
#000000) for the gaps between and behind regions.
Outputs: image (the finished collage - wire it to Save Image, an upscaler, or img2img) and layout_info, a STRING with the chosen layout type, canvas size and aspect ratio. Handy for a debug text node, little use beyond that.
Install
ComfyUI Manager, search ComfyUI-DJZ-Offsquare, install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/ComfyUI-DJZ-Offsquare.git
Then restart ComfyUI - it shows up under image/compositing → DJZ Offsquare Collage. The pack is refreshingly light: its requirements.txt is just torch, numpy and Pillow, all already present in any ComfyUI install, and there are no model downloads. It's the rare custom node you don't have to fear for your environment.
Gotchas
- Batch size is the whole game. Fewer than 2 images errors out; more than 6 gets silently truncated to the first six (warning only in the console).
- background_color must be a valid hex - a non-hex character raises instead of being guessed.
- The output is ~4MP, well above most current models' native resolution band (roughly 1–2MP). Don't pipe it straight back into a sampler and expect sensible results; treat it as a source for img2img at reduced scale or as an upscaler target.
That's it - one node, one job, zero dependency drama. If you build comparison boards or reference sheets in ComfyUI, this is the node that kills the "export and open Photoshop" step.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| aspect_ratio | COMBO | 1:1 | 7 options: 1:1, 16:9, 9:16, 3:2, 2:3, 4:3, +1 |
| border_radius | INT | 00–64 | — |
| background_color | STRING | #000000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| layout_info | STRING | — |