Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI_LC123_nodes > LC Image Grid 🖼️

ComfyUI Node: LC Image Grid 🖼️

Class Name

LCImageGrid

Category
LC123/image
Author
lonecatone23 (Account age: 417days)
Extension
ComfyUI_LC123_nodes
Latest Updated
2026-11-14
Github Stars
0.06K

How to Install ComfyUI_LC123_nodes

Install this extension via the ComfyUI Manager by searching for ComfyUI_LC123_nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI_LC123_nodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

LC Image Grid 🖼️ Description

Arranges batched images into a customizable grid with consistent cells, spacing, and borders.

LC Image Grid 🖼️:

LCImageGrid arranges every image in an input batch into a single visual grid, making it useful for comparing variations, reviewing generated results, creating contact sheets, or presenting multiple images together. Images are placed from left to right and then from top to bottom, with the number of columns limited by your chosen maximum. The node calculates a shared cell size from the largest image, centers smaller images within that size, and can add spacing, internal padding, outlines around individual cells, and a border around the complete grid. This produces a consistent composition even when the source images have different dimensions. Color values are read from hexadecimal strings such as #000000 or #FFFFFF. If the input batch contains no images, the node creates a 64 × 64 black image instead of returning an empty result.

LC Image Grid 🖼️ Input Parameters:

images

The batch of images that you want to arrange. Each image is converted into an RGB image and placed into the grid in its original batch order. The node uses the largest image width and height to establish a shared cell size, so smaller images are centered inside matching cells rather than changing the grid structure. Images with more than three color channels use their first three channels, while grayscale images are converted to RGB. An empty batch produces a 64 × 64 black image.

max_columns

Sets the maximum number of images that can appear in one row. Rows are filled from left to right and then continue on the next row. The minimum value is 1, the maximum is 64, the step is 1, and the default is 3. The actual number of columns is also limited by the number of input images, so a batch of two images with max_columns set to 3 creates two columns rather than leaving an unused third column. Lower values create taller grids, while higher values create wider grids.

gap

Controls the empty space between neighboring cells, measured in pixels. The minimum is 0, the maximum is 256, the step is 1, and the default is 8. A value of 0 places cells directly next to each other, while larger values make the separation between images more visible. The gap uses the background color and increases the final grid dimensions.

cell_pad

Adds space inside each cell around the original image before the cell is aligned with the other cells. The minimum is 0, the maximum is 256, the step is 1, and the default is 4. Padding is added to both sides of the width and both sides of the height, so a value of 4 adds up to eight pixels to each dimension before shared cell sizing. The padding is filled with bg_color and can help separate the artwork from its outline or create a framed thumbnail appearance.

outline_thickness

Sets the thickness of the outline drawn around every individual cell image. The minimum is 0, the maximum is 64, the step is 1, and the default is 2. A value of 0 disables cell outlines. Increasing this value makes each image stand out more clearly, but also increases the width and height of every cell and therefore increases the final grid size. The outline uses outline_color.

border_thickness

Sets the thickness of the outer border surrounding the complete grid. The minimum is 0, the maximum is 256, the step is 1, and the default is 2. A value of 0 removes the outer border. Increasing the value adds pixels to all four sides of the finished grid, using border_color. This border is separate from the outlines drawn around individual cells.

bg_color

Defines the background color used for gaps, cell padding, and any unused space around smaller images inside their cells. The default is #000000. Enter a hexadecimal RGB color in the form #RRGGBB; three-character shorthand such as #FFF is also accepted and expanded to its six-character equivalent. If the value is missing or cannot be interpreted as a valid hexadecimal color, the node falls back to black.

outline_color

Defines the color of the outline around each individual cell. The default is #FFFFFF. Enter a hexadecimal RGB color such as #FFFFFF for white or #FF0000 for red. Three-character shorthand such as #FFF is accepted. If the value is invalid, the node falls back to white.

border_color

Defines the color of the outer border around the entire grid. The default is #000000. Enter a hexadecimal RGB color such as #000000 for black or #FFFFFF for white. Three-character shorthand such as #000 is accepted. If the value is invalid, the node falls back to black.

LC Image Grid 🖼️ Output Parameters:

image

The finished image grid containing all input images arranged into rows and columns. The result is returned as a single RGB image batch containing one image, with pixel values represented in the normal IMAGE format. The output dimensions depend on the largest input image, the number of columns and rows, cell padding, outlines, gaps, and outer border. Smaller images are centered within the shared cell size, and any surrounding area uses the selected background color.

LC Image Grid 🖼️ Usage Tips:

  • Use max_columns values between 2 and 5 for contact sheets that are easy to inspect. Use 1 for a vertical comparison list or a larger value when you need a compact overview.
  • Keep gap at 0 or 4 for a tight montage, and use values such as 8 to 16 when you want clear separation between generated variations.
  • Set cell_pad to 0 when preserving the most compact layout is important. Use 4 or more when you want visible background space around each image.
  • Use outline_thickness with a contrasting outline_color to separate adjacent images, especially when the artwork contains dark or similarly colored edges. Set it to 0 for a minimal presentation.
  • Use border_thickness to give the complete montage a clean frame. Set it to 0 when the grid will be placed inside another composition that already provides its own border.
  • Choose a light bg_color such as #FFFFFF for bright presentation sheets and a dark value such as #000000 for artwork that benefits from a dark surround. The background also fills padding and gaps, so preview the color in relation to the images.
  • Remember that the largest input width and height determine the shared cell size. Mixing very large and very small images can create substantial empty space around the smaller images; resize the source images first if a tighter grid is needed.
  • For a simple three-column review sheet, the default settings provide a practical starting point: max_columns 3, gap 8, cell_pad 4, outline_thickness 2, and border_thickness 2.
  • Use valid hexadecimal colors with six digits, such as #202020 or #EAEAEA, to avoid accidental fallback colors and make the result predictable.

LC Image Grid 🖼️ Common Errors and Solutions:

Input batch is empty

  • Explanation: No images were available in the images input. The node handles this case by returning a 64 × 64 black image, so the result may appear blank rather than showing an error.
  • Solution: Connect an image-producing node to images and confirm that the upstream node is generating at least one image before running the grid.

Invalid hexadecimal color value

  • Explanation: A color input does not contain a valid hexadecimal RGB value. The node accepts six-character values such as #336699 and three-character shorthand such as #369. Invalid values are replaced with fallback colors: black for bg_color and border_color, and white for outline_color.
  • Solution: Enter colors using the format #RRGGBB, for example #000000, #FFFFFF, or #336699. Include only hexadecimal characters after the optional #.

Grid contains unexpected empty space

  • Explanation: Every cell uses the width and height of the largest input image, so smaller images are centered with background space around them. Additional empty space can also come from cell_pad, gap, or the selected outline and border settings.
  • Solution: Resize input images to a more consistent size before using the node, reduce cell_pad and gap, or reduce outline and border thickness.

Output grid is larger than expected

  • Explanation: The final dimensions include the shared cell dimensions, the number of rows and columns, gaps between cells, outlines around cells, and the outer border. Large source images or high spacing values can therefore produce a large output.
  • Solution: Reduce max_columns only when a taller layout is acceptable, lower gap, cell_pad, outline_thickness, or border_thickness, and resize oversized source images before creating the grid.

Images are touching or difficult to distinguish

  • Explanation: A gap of 0 places cells directly next to each other, and an outline thickness of 0 removes the visual boundary around each cell. Similar image edges or matching background colors can make the boundaries hard to see.
  • Solution: Increase gap slightly, add an outline_thickness of 1 or 2, and choose an outline_color that contrasts with the image edges and bg_color.

Images appear cropped or reduced inside cells

  • Explanation: The node keeps each image's aspect ratio while fitting it into the shared cell size. If an image is larger than the available cell dimensions, it is scaled down to fit. The node does not enlarge smaller images, and it does not stretch images to fill the entire cell.
  • Solution: Check the dimensions of the source images and use consistently sized inputs when you need uniform visual scale. Increase the source resolution before the grid if the images need to remain large.

Unexpected black, white, or default-colored areas

  • Explanation: Invalid color strings trigger fallback colors, and background-colored regions are intentionally used for gaps, padding, and space around smaller images. These areas are not part of the source artwork.
  • Solution: Verify all three color inputs, use valid values such as #202020 or #FFFFFF, and adjust cell_pad and gap if the surrounding areas are larger than intended.

LC Image Grid 🖼️ Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI_LC123_nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

LC Image Grid 🖼️