Nodes/ComfyUI-nhknodes/🎯 Image Grid Composite (nhk)
ComfyUI Node

🎯 Image Grid Composite (nhk)

Turn any pile of images into a clean contact sheet grid

By EnashkaΒ·Created 12 months agoΒ·Updated 28 days agoΒ· 23
🎯 Image Grid Composite (nhk)
    • composite
    • width
    • height
    β—„width1024β–Ί
    β—„images_per_row2β–Ί
    β—„spacing10β–Ί
    β—„background_colorblackβ–Ί

    Reviewing a batch of generations usually means scrolling through a wall of preview thumbnails, one per image. ImageGridComposite gives you the grown-up version: it lays your images out into a proper grid on a canvas - spacing, background, rows and all - and outputs it as a single image you can eyeball, save, or share. It's the "make me a contact sheet" node, and it's the visual counterpart to the pack's batch-stacking node.

    It lives in nhk/image of the nhknodes pack and, like its sibling, takes unlimited image inputs via dynamic sockets that appear as you connect them. Where ImageGridBatch just concatenates tensors, this one actually arranges things - which makes it the node you reach for when the output is meant for human eyes, not a sampler.

    How it works

    The node collects all connected IMAGE inputs, decides how many rows it needs from images_per_row, and lays images left-to-right, top-to-bottom into a canvas of your chosen width. The important details:

    • Height is calculated, not chosen. You set the total width; the node scales each image to fit its cell, centers it, and grows the canvas vertically to fit the rows. There's no height input because there doesn't need to be.
    • It only downscales, never upscales. Each image is shrunk to fit its cell while keeping its aspect ratio, then centered in the cell. The "padding" effect - even spacing around every image - comes from centering within each cell.
    • Spacing and background. spacing (default 10px) is the gap between cells, filled with background_color - black, white, gray, red, green, or blue. The background also fills any empty cell in the last row, so a 3-image grid at 2 per row leaves one tidy empty cell instead of a broken layout.

    Inputs: width (default 1024, 64–8192), images_per_row (default 2, up to 20), spacing, background_color. Outputs: composite (the grid image), plus width and height (INT) of the finished composite - the dimensions are useful if you're feeding this into a save node that wants the exact size.

    Installing

    Standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Enashka/ComfyUI-nhknodes
    

    or ComfyUI Manager β†’ search "NHK Nodes" β†’ install β†’ restart. Under nhk/image, no extra dependencies.

    Where people get burned

    • Mixed aspect ratios look uneven. Images keep their own aspect ratios, so a portrait beside a landscape beside a square makes a ragged grid. There's no "crop to uniform cell" mode - this is a fit-and-center node. If you want a strictly uniform contact sheet, normalize aspect ratios upstream.
    • "My text is blurry / images look small." That's width vs images_per_row math. Lower the per-row count or raise the width to give each cell more pixels.
    • It's for presentation, not processing. The composite is a new image at a new resolution - don't feed it back into a sampler expecting your originals. Save it or preview it.

    For "I ran 12 variations and I want to see them all at once," ImageGridComposite is the nicest low-effort answer in the pack. It won't do fancy captions or tile borders, but it doesn't need to - it gets you the contact sheet without a trip to an external image tool.

    Categorynhk/image

    Inputs (4)

    NameTypeDefaultDescription
    widthINT102464–8192Total width of output composite (height calculated automatically)
    images_per_rowINT21–20Number of images per row in the grid
    spacingINT100–100Spacing between images in pixels
    background_colorCOMBOblackBackground color for spacing and empty cells

    Outputs (3)

    NameTypeDescription
    compositeIMAGEβ€”
    widthINTβ€”
    heightINTβ€”