Manhwa Crop
Drag out AI-friendly squares on a manhwa page — no math required
- image_in
- crop
- original
- x
- y
- size
Manhwa and webtoon pages are tall vertical strips - 800 pixels wide, 3,000 tall - and your diffusion models were trained on squares. Feed a whole page to an image-editing or inpainting model and it chokes: panels get mushed, speech bubbles survive, the art goes sideways. The fix everyone ends up doing is cropping each panel to a square, fixing it, and stitching it back. That's this pack, and this node is the front half: Manhwa Crop draws the page right on the node and lets you drag out square selections by hand.
It exists because the automated panel-detectors aren't there for webtoons - the classic manga splitter assumes traditional comic grids, and community threads about manhwa editing keep circling back to "models can't crop the panels, so I do it manually." This node is that manual step, done as fast as it can be done.
How it works
The magic lives in the front-end, not the Python. Drop an image into the node's upload widget and the page renders on the node body, overlaid with a canvas. Click and drag on it and you draw a cyan square; on release the selection snaps to the nearest multiple of 16 - exactly the sizing latents are happy with. Behind the scenes it just writes three plain x / y / size integers, then the backend does the crop.
The backend is refreshingly honest about edges: _snap_size_to_16() rounds your selection up to a multiple of 16, and if your square hangs off the page, the out-of-bounds area comes back as white padding rather than an error. You can't break it by selecting badly, you just get a white border to crop or mask later.
Inputs and outputs
Two ways in. The image widget works like LoadImage - pick or upload from your input folder. Or wire an IMAGE tensor into the optional image_in and skip the upload entirely, which matters if you're feeding a preprocessed page.
The three required numbers - x, y, size - are hidden widgets normally, set by your drag. They're also where the node's outputs come from: crop (your square), original (the whole page, passed through untouched), and x, y, size as separate INTs.
That's the bit to wire up: feed crop into your editor/inpainter, and pipe x, y, size (plus the original) into the pack's Manhwa Stitch Save node so it knows exactly where to paste the result back. Get the geometry from the crop node and you never have to transcribe coordinates.
Installing it
The README promises a ComfyUI Manager listing "shortly" - if Manager can't find it yet, clone it directly:
cd ComfyUI/custom_nodes
git clone https://github.com/Norian11/comfyui_ManhwaCropping
Restart ComfyUI and search for "Manhwa Crop". No requirements.txt, no model downloads, nothing heavy - it's pure torch/Pillow plus one JS file, so it's compatible with any ComfyUI install you already have running.
Where people get burned
- Snapping is silent. Drag a 501-pixel square and it becomes 496 (or 512). If your stitch-back looks off by a few pixels, this is usually why - the white padding fills the difference.
- The widget and the drag can disagree. If you hand-type
x/y/size, the next drag overwrites them. Pick one method. - It's a manual node by design. If you're hoping for automatic panel detection, this isn't it - that's a different problem than the one it solves.
Square panel in, stitched page out. It's a tiny tool, but it's the difference between an hour of fiddly manual cropping and ten minutes of dragging.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| x | INT | 0-100000–100000 | — |
| y | INT | 0-100000–100000 | — |
| size | INT | 5121–100000 | — |
| image_inopt | IMAGE | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| crop | IMAGE | — |
| original | IMAGE | — |
| x | INT | — |
| y | INT | — |
| size | INT | — |