Nodes/ComfyUI-Apt_Preset/lay_images_free_layout
ComfyUI Node

lay_images_free_layout

Comic-style panel layouts for ComfyUI images

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
lay_images_free_layout
  • images
  • image
page_width512
page_height512
template
border_thickness5
outline_thickness2
outline_color#000000
panel_color#00FF62
bg_color#FF0000
custom_panel_layoutH123

Regular grids assume every panel is the same size. Comic pages, magazine spreads, and social carousels usually don't work that way - you want one big panel and a couple of small ones, or an asymmetric split down the page. lay_images_free_layout is the node in cardenluo's ComfyUI-Apt_Preset built for exactly that: templated, non-uniform panel layouts instead of a uniform rows×cols grid.

What it does

Unlike lay_ImageGrid or lay_image_grid_note (uniform grids) or lay_edge_cut (splitting one image into pieces), this node composes a fixed-size canvas - page_width × page_height - out of panels arranged according to a template. The template list (custom, G21, G22, H2, H3, H12, H13, V2, V3, V31, V32) reads as a shorthand for panel-splitting patterns: H/V for horizontal/vertical splits, the numbers for how many panels and in what proportion. If none of the presets fit, template: custom hands control to custom_panel_layout, a string field (default "H123") where you presumably describe your own split pattern using the same H/V + numbers convention the presets use.

Each panel gets a border (border_thickness), and the whole layout gets an outline (outline_thickness, outline_color) plus a fill color for empty panel space (panel_color) and a canvas background (bg_color) - the kind of controls you'd expect from a comic-panel or magazine-mockup tool, not a plain image compositor.

Inputs and outputs

Required: page_width / page_height (8–4096 px, canvas size), template (preset or custom), border_thickness, outline_thickness, outline_color, panel_color, bg_color. Optional: images (the IMAGE batch to drop into the panels, in order) and custom_panel_layout (your own layout string, only relevant when template is custom).

Single image output - the assembled page, ready for Preview/Save.

Since images is optional, you can run this node without any images at all to preview an empty template - useful for figuring out which preset gives you the panel count and proportions you want before you wire up your generated images.

Where this fits

This is the node for anything that needs deliberate visual hierarchy rather than a uniform tile grid: comic pages, before/after spreads where one image should dominate, or a social post layout with a hero image and supporting shots. If your comparison is genuinely apples-to-apples (same size, same importance), the plain grid nodes are simpler and faster to set up; reach for this one when the layout itself needs to say something.

Installing it

ComfyUI Manager: search ComfyUI-Apt_Preset. Manual install:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

Run install.bat (Windows) or install requirements.txt yourself, then restart ComfyUI. No external model downloads for this node - it's compositing logic only.

Troubleshooting

Since this node depends on the same big pack as everything else in this write-up, check for a clean import first: ComfyUI-Apt_Preset has a documented case of failing to import entirely for at least one user, so if it's missing from your node list, look at the ComfyUI console on startup for the actual error rather than assuming your workflow is at fault.

Node-specific: the custom template's syntax isn't spelled out anywhere in the schema beyond the "H123" default, so if you're building a custom layout, start from that default string and tweak it incrementally rather than guessing the format from scratch - small changes make it easier to see what each character or number is controlling. And if images land in panels in an order you didn't expect, remember the node fills panels using the order of your images batch, so batch order - not panel position on the page - decides which image goes where; reorder your batch upstream if you need a different pairing.

CategoryApt_Preset/imgEffect

Inputs (10)

NameTypeDefaultDescription
page_widthINT5128–4096
page_heightINT5128–4096
templateCOMBO11 options: custom, G21, G22, H2, H3, H12, +5
border_thicknessINT50–1024
outline_thicknessINT20–1024
outline_colorSTRING#000000
panel_colorSTRING#00FF62
bg_colorSTRING#FF0000
imagesoptIMAGE
custom_panel_layoutoptSTRINGH123

Outputs (1)

NameTypeDescription
imageIMAGE