Skip to content

Image Grid

David Sage edited this page Nov 3, 2025 · 17 revisions
2025-10-09_12-26-49_9179 - 890

Generate an Image Grid for Each Batch

While original Fooocus did have the option to produce an image grid, unfortunately the grid was only available as a preview and it could not be saved. Reflecting the fact that the grids were not intended to be saved, the layouts often looked awkward if they diverged from a 4x4 layout, which represents a batch count of four images. For example, if there was an odd number of images the grid would contain a half-row.

FooocusPlus not only saves the grid but the layouts are improved, adjusting for both image count and aspect ratio. To activate image grids, select "Generate an Image Grid for Each Batch" from the Batch Control accordion, located under the Settings tab as shown below. If image grid creation is a feature you always use, "default_generate_image_grid" can be set to "true" in config.txt - but you may need to add this option to config.txt if it is not already there.

Image Grid Checkbox

Image Grids are Saved with the Generated Images

Image grids are saved with the generated images in the Outputs directory within the current day's subdirectory, for example "2025-10-19". An image grid can be viewed within the FooocusPlus Generated Images Catalog but it does not form part of the log because it is not actually a generated image. Both the area in pixels and the filesize of image grids can become quite large because the original images are simply "stuck together" to created one large picture. An image grid containing 16 square 1024x1024 pixel images will be 4096x4096 pixels and be about 23MB in size.

Original Fooocus had this warning about Image Grids:
(Experimental) This may cause performance problems on some computers and certain internet conditions.

This warning would be equally valid for FooocusPlus, although I have not encountered any significant problems with an NVidia 12GB VRAM card and system RAM of 48GB. Considering this, the Image Grid size is intentionally limited to a maximum of 16 cells, any quantity in excess of that is omitted from the grid. On my system there is a significant delay while saving a grid with an Image Grid size of 16 but there has never been a failure.

Image Grid Optimization

This table shows the grid configurations for each Image Quantity (batch size) from 2 to 16. Quantities of 11 and 13 are truncated to 10 and 12 respectively.

Image Quantity Landscape Portrait & Square
2 1 Columns, 2 Rows 3 Columns, 1 Row
3 1 Columns, 3 Rows 3 Columns, 1 Row
4 2 Columns, 2 Rows 2 Columns, 2 Rows
5 1 Column, 5 Rows 5 Columns, 1 Row
6 2 Columns, 3 Rows 3 Columns, 2 Rows
7 1 Columns, 7 Rows 7 Columns, 1 Rows
8 2 Columns, 4 Rows 4 Columns, 2 Rows
9 3 Columns, 3 Rows 3 Columns, 3 Rows
10 2 Columns, 5 Rows 5 Columns, 2 Rows
12 3 Columns, 4 Rows 4 Columns, 3 Rows
14 2 Columns, 7 Rows 7 Columns, 2 Rows
15 3 Columns, 5 Rows 5 Columns, 3 Rows
16 4 Columns, 4 Rows 4 Columns, 4 Rows

The remainder of this article demonstrates several of the smaller grid layouts.

Image Grid for Two Portrait Style Images

In the image shown below, the grid is made of two portrait images placed side by side. Both images with a portrait style aspect ratio - in which the height is greater than the width - and square images are grouped this way when there are only two of them.

2025-10-09_13-57-22_9896 -890

Image Grid for Two Landscape Style Images

For two images with a landscape style aspect ratio - in which the width is greater than the height - they are stacked in one column containing two rows, as shown below:

2025-10-09_13-54-14_3637 890

Image Grid for Three Portrait Style Images

For image grids with two, three, five or seven images in which the height is greater than or equal to the width, all images are placed side-by-side in one row:

2025-10-09_16-38-37_6937

Image Grid for Three Landscape Style Images

And for image grids with two, three, five or seven images in which the width is greater than the height, all images are stacked in one column:

2025-10-09_13-55-44_8328

Image Grid with Four Images

Images grids containing four, nine or sixteen images are arranged in squares in which the number of columns and rows are equal:

2025-10-09_11-25-23_1985

Image Grid with Six Portrait Images

This last example shows a grid of six portrait style images which are arranged in a grid that is three columns wide and two rows high:

2025-10-10_00-51-46_3041

Clone this wiki locally