Nodes/DenRakEiw_Nodes/πŸ–ΌοΈ Multi-Image Aspect Ratio Composer
ComfyUI Node

πŸ–ΌοΈ Multi-Image Aspect Ratio Composer

Compose up to 8 images into one frame, sized and face-centered automatically

By DenRakEiwΒ·Created about a year agoΒ·Updated a day agoΒ· 34
πŸ–ΌοΈ Multi-Image Aspect Ratio Composer
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • composed_image
  • width
  • height
  • info
β—„input_count2β–Ί
β—„aspect_ratio16:9 (Widescreen)β–Ί
β—„megapixels2 MPβ–Ί
β—„arrangementhorizontalβ–Ί
β—„spacing0β–Ί
β—„background_colorblackβ–Ί
β—„face_detectiondisabledβ–Ί
β—„face_detection_confidence1.3β–Ί

Making a collage the dumb way means manually resizing and stacking images at pixel coordinates. This node does it smartly: you tell it how many images you're feeding, what aspect ratio and total resolution you want, and it computes the layout, resizes and crops each image to fit, and hands back one composed image - plus, optionally, centers each crop around a detected face. It's the "feed this into an img2img model to make a coherent multi-subject image" node, and it's the workhorse of the pack's image tools.

The dynamic input trick

Set input_count (1–8), click Update Inputs, and the node's image_1 … image_8 inputs appear or disappear to match. That's the one workflow gotcha: the inputs aren't all there by default - the node dynamically regenerates them from the count, so if an input seems "missing," bump the count. The README's troubleshooting confirms it: "Missing images β†’ check all inputs connected + click Update Inputs."

Inputs that matter

  • input_count (1–8) - how many images you're composing.
  • aspect_ratio - a 15-option list from 1:1 to 21:9 and 9:21, plus photo and monitor ratios.
  • megapixels - 0.5 MP up to 32 MP; the node auto-calculates exact pixel dimensions from ratio Γ— MP.
  • arrangement - horizontal, vertical, smart_grid, classic_grid. Smart grid picks the layout from your count and ratio (8 images at 16:9 β†’ two rows of 4; at 1:1 β†’ 3,3,2; at 9:16 β†’ four rows of 2). Classic grid is the boring equal grid; the two linear ones stack everything in a line.
  • spacing (px) and background_color - black, white, or transparent.

Face detection is where it earns its name: face_detection off/haar_cascade/dnn_face, plus face_detection_confidence (1.1–3.0, default 1.3). Haar is the fast CPU cascade; DNN is the more accurate deep model. With detection on, each crop is centered on the largest detected face rather than the image center - which is exactly what you want for portraits and character sheets. The README's warning: detection is slow, disable it for non-portrait material.

Outputs

composed_image (IMAGE) - the final canvas. Plus width and height (INT) and an info string. Typical use: composed image β†’ VAE encode β†’ img2img, or straight to Save.

Install and caveats

Part of DenRakEiw_Nodes: ComfyUI Manager β†’ "DenRakEiw Nodes", or git clone https://github.com/DenRakEiw/DenRakEiw_Nodes + pip install -r requirements.txt + restart. Face detection needs opencv-python, which the requirements pin.

Caveats: high megapixels values (16–32 MP) on many inputs can eat serious RAM - the README says reduce megapixels on memory issues. Haar cascade misses angled or heavily stylized faces; that's what the confidence knob is for. And it's a one-author pack with minimal support, so the GitHub issues page is your help desk. But for the character-sheet/composite job, the face-centering alone is worth the install.

Categorydenrakeiw/image

Inputs (16)

NameTypeDefaultDescription
input_countINT21–8β€”
aspect_ratioCOMBO16:9 (Widescreen)15 options: 1:1 (Square), 4:3 (Standard), 3:4 (Portrait), 16:9 (Widescreen), 9:16 (Vertical), 21:9 (Ultrawide), +9
megapixelsCOMBO2 MP10 options: 0.5 MP, 1 MP, 2 MP, 4 MP, 6 MP, 8 MP, +4
arrangementCOMBOhorizontal4 options: horizontal, vertical, smart_grid, classic_grid
spacingINT00–100β€”
background_colorCOMBOblack3 options: black, white, transparent
face_detectionoptCOMBOdisabled3 options: disabled, haar_cascade, dnn_face
face_detection_confidenceoptFLOAT1.31.1–3β€”
image_1optIMAGEβ€”
image_2optIMAGEβ€”
image_3optIMAGEβ€”
image_4optIMAGEβ€”
image_5optIMAGEβ€”
image_6optIMAGEβ€”
image_7optIMAGEβ€”
image_8optIMAGEβ€”

Outputs (4)

NameTypeDescription
composed_imageIMAGEβ€”
widthINTβ€”
heightINTβ€”
infoSTRINGβ€”