Nodes/ComfyUI-NynxzNodes/Grid Style (Layout)
ComfyUI Node

Grid Style (Layout)

The geometry half of a grid, with real sockets on it

By Nynxz·Created 11 months ago·Updated about 12 hours ago· 4
Grid Style (Layout)
  • style
  • style
◄columns3►
◄size_modecells►
◄cell_width320►
◄cell_height180►
◄canvas_width1280►
◄canvas_height720►
◄gap_x12►
◄gap_y12►
◄padding24►
◄fitcover►

Every grid in this pack has geometry: how many columns, how big each cell is, how wide the gaps are, how much padding around the outside. Grid Style (Layout) is that half of the look on its own - no border, no shadow, no colour panel, just eleven native integer and combo widgets you can wire into, promote, or drive from a primitive.

That last bit is the actual argument for using this instead of the all-in-one Grid Style node. Because every field is a native input, columns can come out of a primitive, cell_width can come off a maths node, and the whole thing can be promoted to a subgraph input so one workflow produces both a 3-column sheet and a 6-column one without touching the node. If you've ever wanted a grid whose layout responded to anything, this is the node that allows it.

The eleven fields

columns - cells per row, 1 to 64, default 3. size_mode - cells (fixed cell size, canvas derived) or canvas (fixed canvas, cells derived). This is the field to understand first. cell_width / cell_height - 320 / 180, used only in cells mode. canvas_width / canvas_height - 1280 / 720, used only in canvas mode. gap_x / gap_y - 12 / 12, the space between cells. padding - 24, the space between the outermost cells and the canvas edge. fit - cover (crop to fill the cell) or contain (letterbox inside it).

The two-mode design is doing more work than it looks. cells mode is for consistency: every cell is exactly 320×180 and the canvas grows with however many images you have. canvas mode is for fitting a page: fix 1920×1080 and let the compositor work out what cell size divides into it. Pick canvas when the output has to be a specific size, cells when the images have to be a specific size.

gap_x and gap_y being separate is a small thing that most grid nodes get wrong - a 12px vertical gap and an 18px horizontal gap is how a sheet of portrait images stops looking cramped between rows.

Output

One: style. Feed it into Grid From Images, or into a Border or Shadow node to keep building. Optional input style lets you extend upstream values: this node overlays only its own geometry keys and passes everything else through, which is why it interoperates with the all-in-one Grid Style node in either direction.

Install

Manager → search Nynxz → ComfyUI-NynxzNodes, or:

comfy node install comfyui-nynxz-nodes

From source:

cd ComfyUI/custom_nodes
git clone https://github.com/Nynxz/ComfyUI-NynxzNodes
cd ComfyUI-NynxzNodes
pnpm install && pnpm build

Restart. No models, no Python dependencies.

This one is the least hurt by a missing frontend build, since it has no config panel - but the grid node it feeds still wants the built web/ for its preview, and web/ is gitignored in the repo. pnpm build (or Manager, which ships it) is not optional overall.

Troubleshooting

Changing canvas size does nothing. You're in cells mode. The canvas is derived from cell size × columns, so canvas_width and canvas_height are inert. Both pairs of fields are visible at once with no indication of which is live, which is the single most confusing thing about this node.

Cells are enormous. Something's wrong with your columns count relative to how many images you fed in - a five-image batch at 3 columns means two rows, and if size_mode = cells with a bumped cell_width, that's a 1000px-tall canvas before you've looked at it.

Big empty band at the bottom. The last row isn't full, so the remaining cells are blank. That's honest layout, not a bug. Either pick a columns that divides into your count, or accept the gap; the compositor doesn't reflow to a ragged bottom.

Promoting a field to a subgraph does nothing downstream. Check the chain: if you promoted columns on this node but a downstream Border or Shadow node was created from a fresh style (its style input unwired), it started over from defaults. Chain them, don't parallel them.

Choose this node over the all-in-one Grid Style when you care about automation, and the all-in-one when you care about the colour panel. There's no wrong answer; they produce the same link.

CategoryNynxz/Grid

Inputs (11)

NameTypeDefaultDescription
columnsINT31–64Cells per row.
size_modeCOMBOcellscells = fixed cell size, canvas derived · canvas = fixed canvas, cells derived.
cell_widthINT3201–16384Cell width, px (used when size_mode = cells).
cell_heightINT1801–16384Cell height, px (used when size_mode = cells).
canvas_widthINT128016–16384Canvas width, px (used when size_mode = canvas).
canvas_heightINT72016–16384Canvas height, px (used when size_mode = canvas).
gap_xINT120–8192Horizontal gap between cells, px.
gap_yINT120–8192Vertical gap between cells, px.
paddingINT240–8192Outer padding around the grid, px.
fitCOMBOcovercover = crop to fill the cell · contain = letterbox inside it.
styleoptNYNXZ_GRID_STYLEUpstream style to extend. Unwired = start a fresh style from defaults.

Outputs (1)

NameTypeDescription
styleNYNXZ_GRID_STYLEWire on to the next Grid Style node, or into a grid node.