comfyui-panels
Comics/Manga like panel layouts.
Nodes (45)
The three-second constructor for the pack's bounding boxes
The invisible constraint that makes panel edges behave
Round those harsh right-angle panel corners
Where the abstract layout becomes real shapes
The boring rectangle every panel workflow secretly starts with
The directions you didn't ask for
Crop with a bounding box object instead of raw numbers
The sibling crop that keeps your mask in sync with your image
The background-cropping node with the mouthful of a name
Turn a drawing of a page into real panel polygons
The node that draws the black lines around your panels
Panel borders, but with a sketchier feel
The softest border in the pack
The fastest way to a comic page layout
Push one edge of a panel out, leave the rest alone
Flip N to S and E to W
Glue two lists of panels together
Splice panel lists with Python slice syntax
The layout that hides inside an image file
The layout variation node — turn one comic page into a dozen siblings
Grow or shrink a panel — the node that makes the gutters between panels
The node that turns panel shapes into something ComfyUI can actually use
The node that stitches your separately-generated panels back into a page
The polygon's bounding box, handed to other nodes as a BBOX
The default pivot — panel center, made explicit
Pivot around where the panel's mass actually is
Pivot a panel around any x,y point you type in
Hinge a panel on one of its own corners
Turn a panel polygon into an actual mask, ready for inpainting
The panel-to-mask node that keeps your crops consistent
A polygon's bounds as four plain integers, for the other packs
Preview a page layout before you commit to building panels
Actually look at your panels before you generate art inside them
Random comic page layouts on demand — the usual place a page starts
Crop a crop, using the original page's coordinates
Spin a panel around any point you choose
Your layouts, saved as PNGs that are secretly the layout itself
Stretch or squash a panel — independently on each axis
Tilt a panel out of shape for perspective and drama
Subset a list of panels with Python slice syntax
Put Your Comic Panels Back in Reading Order
Turn a Line of Layout Text Back Into a Comic Page
Freeze a Comic Layout as a Line of Text
Nudge a Comic Panel Without Rebuilding the Page
Get the Four Numbers Out of a BBOX
ComfyUI Panels
This packages contains nodes for generating and-or organizing comics-manga like panels, such as the ones below (images have the workflow embedded).
<span> <img src="./workflows/QwenEdit2509 AND Panel with Bleedout Subgraph.png" alt="drawing" style="width:225px;"/> <img src="./workflows/Character Over Panels.png" alt="drawing" style="width:225px;"/> <img src="./workflows/Panels Over Image.png" alt="drawing" style="width:225px;"/> </span>Panel Layouts
Panel Layouts are abstract hierarchical representations of a series of cuts made on a page to create comic or manga panels.
The process begins with an empty page (a single full-page panel). Initial cuts—whether single or multiple equally spaced ones—divide this page into distinct panels. Subsequent cuts are applied to existing panels and can be nested to achieve arbitrary levels of complexity.
Cuts are defined by:
- Direction — horizontal or vertical
- Position — selected from 5 potential relative positions to the panel being cut
- Angle — a slight deviation from the defined direction for aesthetic purposes
- Number of cuts — only applicable for one relative position option, where cuts are forced to have equal spacing
Sample layouts are provided in the sample_layouts folder, but you can create and store your own using the Save Panel Layout node.
The image below shows one of the sample layouts:
<img src="./sample_layouts/PanelLayout (1).png" alt="Sample panel layout" style="width:200px;"/>A Panel Layout does NOT store specific panel properties such as:
- Corner shape
- Margins relative to page borders
- Line thickness or style
However, it can implicitly define relative spacing between panels through the order of cuts, though not with concrete values.
The order of panels (annotated with number stamps) is determined by the cut sequence. By default, this order also defines relative spacing between panels. The first cut(s) create larger margins, suggesting a reading direction parallel to the cut for nested panels, which are visually grouped due to having smaller margins. The panel order aligns with this visual suggestion—to deviate from this pattern, you must modify the panels or their order separately from the layout.
<img src="./images/cuts_and_panels_order.jpg" alt="Cuts and panel order diagram" style="width:450px;"/>When saving, previewing, or processing a layout, you can choose between left-to-right or right-to-left orientations. These options don't change the underlying data—a layout saved as left-to-right can be used as right-to-left—but help maintain visual coherence with your preferred reading direction.
Panels
Panels are represented as shapely.Polygon objects, defining the concrete shape of each panel on the canvas.
To extract panels from a layout, use the Build Layout Panels node.
These panels can be modified using the following nodes:
- Rotate Polygon
- Scale Polygon
- Translate Polygon
- Skew Polygon
- Bevel Polygon
- Offset Polygon Bounds
Alternatively, panels can be extracted from images using the Detect Panels In Image node. This node uses a basic computer vision algorithm that performs best on blank images with black shapes representing the panels. However, clean and simple panel layouts from comics or manga can also be used effectively as input.
<img src="./workflows/Custom Panel Layout from Mask like Image.png" alt="Panel preview example" style="width:700px;"/> <img src="./workflows/Manga Panel Extration Example A.png" alt="Panel preview example" style="width:700px;"/>Once a polygon is adjusted as desired, you can convert it into a mask using one of these nodes:
- Panel to Mask
- Polygon To Resized Mask (recommended when used with the Paste Crops with Masks node)
To better understand the differences and potential uses of these nodes, refer to the example workflows.
You can use the Draw Panels Edges node to generate an image with the panels' outlines, which you can use to have clear visual separation between the panels and the rest of the page. Additionally, there are nodes available that create panel borders using dashed or dotted lines instead of solid strokes.
<img src="./workflows/Panel Edges Draw Variants.png" alt="Panel preview example" style="width:700px;"/>As you may have noticed, panels are sometimes referred to as "polygons" in the node names and outputs.
This dual naming, though potentially confusing, is intentional: nodes and outputs using the "polygon" nomenclature are designed for broader compatibility with other packages that may also use shapely.Polygon objects.