Nodes/ComfyUI-nhknodes/⏹️ Extract Grid Panel (nhk)
ComfyUI Node

⏹️ Extract Grid Panel (nhk)

Slice a Panel Out of a Grid Image — Extract Grid Panel (nhk)

By Enashka·Created 12 months ago·Updated 28 days ago· 23
⏹️ Extract Grid Panel (nhk)
  • image
  • image
  • panel_name
  • width
  • height
rows2
columns2
panela1
separator_width0

Extract Grid Panel (nhk) pulls a single cell out of a grid image using spreadsheet notation. You tell it how many rows and columns the grid has, ask for panel b2, and it returns that one cell as its own image. Grid → single panel, no manual pixel math.

Why does that matter? Because grid composites are everywhere in this hobby - presentation sheets, character sheets, storyboard grids, 2x2 or 3x3 compilations, the "grid of variants" output that ComfyUI's own image grid tools love to produce. The problem is you almost never want the whole grid: you want panel a1 to upscale, panel b2 to inpaint, or each cell fed back through a detail pass. That's what this node is for.

The pack treats this as a family: it also ships "Load 2x2 Grid Series" and "Load 3x3 Grid Series" for extracting all cells from a directory of grids, and "Image Grid Composite" for building grids in the first place. This node is the general, single-cell version that works on any grid you hand it.

How it works

It parses the panel string into a column letter and a row number - letter = column (a is the first column), number = row (1 is the first row). Then it divides the image by rows × columns, accounts for separator_width (the pixel width of the gutter lines between cells, useful when a grid tool drew visible separators - set to 0 for clean grids), and slices out the requested cell. Output includes the cell as an image, plus the panel's resolved panel_name, width, and height so you know exactly what you got without measuring.

Inputs and outputs

  • image - the grid image.
  • rows - INT, 1–10, default 2. Grid height in cells.
  • columns - INT, 1–10, default 2. Grid width in cells.
  • panel - STRING, default a1. E.g. a1, b2, c3. Letter=column, number=row.
  • separator_width - INT, 0–100, default 0. Width of separator lines between panels.

Outputs: image (the extracted cell), panel_name (STRING), width and height (INT).

Installing it

Part of ComfyUI-nhknodes:

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

restart, or "NHK Nodes" from ComfyUI Manager. No extra deps beyond pillow/torch.

Where people get tripped up

The number one mistake is forgetting separator_width when your grid has visible gutters - the cells come out misaligned, shifted by half a gutter. If your grid was made with gutters, set that field. Second, the rows/columns you declare must actually match the grid; the node assumes you're telling the truth, it doesn't auto-detect (auto-detection is what the 2x2/3x3 loaders do). Third, remember panel notation is letter first - a1 is top-left, and b2 is column b, row 2, not "second row." If you're chaining this with the pack's Image Grid Composite, the flow is compose → extract → process each cell - a tidy loop for per-panel upscaling or detail passes that would otherwise be pure misery by hand.

Categorynhk/image

Inputs (5)

NameTypeDefaultDescription
imageIMAGEGrid image to extract panel from
rowsINT21–10Number of rows in the grid
columnsINT21–10Number of columns in the grid
panelSTRINGa1Panel to extract (e.g., a1, b2, c3). Letter=column, number=row.
separator_widthINT00–100Width of separator lines between panels (pixels)

Outputs (4)

NameTypeDescription
imageIMAGE
panel_nameSTRING
widthINT
heightINT