Nodes/Soda Storyboard/斜切裁剪 · Cut Quads
ComfyUI Node

斜切裁剪 · Cut Quads

Slanted Manga Panels Don't Survive a Rectangular Crop

By cOkieeman·Created 3 days ago·Updated a day ago· 5
斜切裁剪 · Cut Quads
  • image
  • IMAGE
◄page_info►
◄inset12►
◄border3►
◄redraw_borderstrue►

A page layout with diagonal gutters sounds like a stylistic flourish until you try to produce one. Diffusion models will happily paint you a tilted panel edge, and it will be a couple of degrees off, wobbling, and bleeding into the neighbouring panel's corner. SodaCutQuads is the cleanup pass: it takes the finished page, consults the storyboard's actual panel polygons, whitens everything inside a slanted panel's bounding rectangle that isn't inside a panel, and then draws crisp borders along the real edges.

The mechanism, which is more careful than it looks

The lazy version of this node would crop each slanted panel to its box and paste white wedges back. That breaks when two panels' bounding rectangles overlap - which they do constantly on a dynamic page. So the code unions every panel's interior into one mask first, and only clears pixels that are inside a slanted panel's bounds but outside all interiors. Neighbours protect each other, even when their boxes overlap.

Then it draws borders. Slanted panels get their polygon outline, inset by inset pixels, stroked with border-pixel lines using a curve joint so the corners don't show spiky mitres. Rectangular panels get a plain rectangle drawn. Both inset and border are multiplied by the ratio between the image you hand it and the storyboard canvas, so the geometry scales with your image - which is exactly why this node still works after a second sampling pass or an upscale. That's the whole trick: the storyboard is resolution-independent, and every finishing node in this pack remaps it onto whatever size image arrives.

The one input people get wrong

redraw_borders is optional and defaults to on, and the author's tooltip is the honest summary: if the image already has panel lines, turn it off to keep the original frame - the slanted cutting still happens. This matters because a model that draws its own borders will put them slightly off from your storyboard's polygons, and with redraw on you get double lines: the model's wonky one and your clean one, half a pixel apart. It was on by default purely to preserve old workflows.

So: page where the model drew the frames well, redraw_borders off. Page where it drew mush or nothing, leave it on and let the node's crisp geometry win.

A fully rectangular page is the other case. There's nothing to clip, so with redraw on all you get is new black rectangles around every panel - the pack's own full-colour tutorial workflow skips this node entirely for that reason and keeps the model's own panel frames. The node isn't doing damage there; it just has no job.

inset at 12 and border at 3 are reasonable. Push inset up if a slanted panel still shows a sliver of the gutter, and remember it's in canvas pixels, so a page upscaled 2× gets 2× the inset.

Wiring

One input that matters besides image: page_info, the same snapshot string the loader emits and every other finishing node consumes. Output is a single IMAGE, so it slots in right after VAEDecode and before lettering and saving:

VAEDecode → SodaCutQuads → SodaLetterPage → SaveImage

Do not put lettering before this node on a slanted page - the cut will happily paint white over a bubble that crossed a panel edge.

Install

Same pack, same shared dependency:

cd ComfyUI/custom_nodes
git clone https://github.com/cOkieeman/ComfyUI-Soda-Storyboard
cd ComfyUI-Soda-Storyboard && python -m pip install --upgrade soda-storyboard

Or ComfyUI Manager → search Soda Storyboard (registry id comfyui-soda-storyboard), then restart. The pack itself pulls in nothing heavy - its requirements.txt is the one line soda-storyboard>=0.4.4, and Pillow comes with the core library. Your models are the heavy part: MOSS-Image SFT in models/diffusion_models, the moss_image text encoder in models/text_encoders, flux2-vae in models/vae.

Where it bites

If the generated page has a different aspect ratio than the storyboard canvas, the mapped geometry is going to be approximate and panels will be cut in slightly the wrong place. Fix the page, not the node - the pack already refuses canvas sizes that aren't multiples of 16 on import, which catches the most common cause.

inset is bounded at 0 minimum and border at 1 minimum, and the node raises if you somehow send less. Fine. The bigger practical issue is patience: this is a finishing node, so changing inset and border means re-running the whole page unless your workflow already cached the decode. Use a preview or save-image node right after the decode while you're dialling it in.

CategorySoda Storyboard

Inputs (5)

NameTypeDefaultDescription
imageIMAGE—
page_infoSTRING—
insetINT120–512—
borderINT31–64—
redraw_bordersoptBOOLEANtrue原图已有格线时可关闭,保留原图格框;斜切裁剪仍生效

Outputs (1)

NameTypeDescription
IMAGEIMAGE—