Grid Panel Layout Generator
The fastest way to a comic page layout
- PANEL_LAYOUT
If you're just starting with comic layouts in ComfyUI, this is the node to begin with. It makes an even grid of panels - like a classic shonen manga page - from two numbers and a toggle. You want 4 rows by 2 columns? Done. Want the cuts the other way around? Flip the toggle. That's the whole node, and that simplicity is its virtue.
Grid Panel Layout Generator outputs a PANEL_LAYOUT, not panels. That distinction is the pack's core design: layouts are abstract cut trees, and you need Build Layout Panels to turn them into actual polygon shapes on a canvas. So the wiring is always Grid → Build Layout Panels → (canvas) → panels, with a Canvas Panel feeding the size. The pack's example workflow "Grid Layout Generation and Layout Mutation" shows exactly this, plus how to mutate the grid afterward.
How it works
The generator builds a cut tree programmatically: it alternates vertical and horizontal cuts to subdivide the canvas into a rows-by-columns grid. The vcut_first toggle decides whether the first cut is vertical (splitting into columns first) or horizontal (splitting into rows first). Because the pack's layouts carry cut angle and relative-position data, the same structure is what a random or mutated layout produces - so a grid is just a particularly regular member of the same family, and you can feed it through the same downstream nodes (Mutate, Sort, Grow) as any other layout.
The inputs that matter
rows- default 4, range 1–32.columns- default 2, range 1–32.vcut_first- off means the first cut is horizontal; on means vertical. In practice this just transposes which way the "major" division runs, so think about whether you want wide panels stacked or tall panels side by side.
Output is one PANEL_LAYOUT; feed it to Build Layout Panels.
Installing it
Part of comfyui-panels - Manager, search "comfyui-panels", or:
cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_panels
Restart, install deps (shapely, matplotlib, opencv-python), no models.
Where people get burned
The main gotcha is forgetting the second stage and expecting panels out of a layout node. The node's own description calls it out: "Generates a grid like layout (not its panels, use BuildLayoutPanels node to get the panels)." Also note the defaults (4×2, horizontal-first) are aimed at print comics; for a webtoon you'll probably want 1 column and many rows, and remember the reading-order detail: the panel list order follows the cut sequence, so if your story flows bottom-to-top or right-to-left, adjust reading_dir in Build Layout Panels rather than assuming left-to-right.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| rows | INT | 41–32 | — |
| columns | INT | 21–32 | — |
| vcut_first | BOOLEAN | false | Whether the cut orientation in the first node is vertical or horizontal.Cuts' width decreases the higher the depth on the layout hierarchy.The first cut(s) will be the widest. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PANEL_LAYOUT | PANEL_LAYOUT | — |