Visual Crop + Resize (BBox)
Crop it by eye, then get it latent-ready — one node does both
- image
- mask
- image
- mask
- width
- height
- x
- y
Visual Crop + Resize (BBox) is the crop you actually live in: draw a box on the node, and in the same step the node runs your selection through the pack's unified resize pipeline - five scaling modes, an aspect-ratio lock, a divisible-by constraint, and an optional post-scale center crop. It exists because the dumbest recurring ComfyUI failure is feeding a sampler dimensions it can't handle. SDXL and LTX-2.x want side lengths divisible by 32 (or 64); crop to an arbitrary region and you'll get a "latent size not divisible" error or silently garbage output. This node makes that impossible to trip over by accident.
It's one of four node groups in PlagueKind-Nodes, a small personal pack (Plague_Kind) that also ships the crop-only Visual Crop (BBox), a unified resize node, and an LTX LoRA stack loader. If you're in LTX workflows, the LoRA loader is probably why you installed the pack - this crop/resize node is the bit you end up using every single run.
How it works
First half is the visual crop: run once, drag a box on the generated preview, and the node stores your selection as normalized 0–1 coordinates so it survives source resolution changes. Second half is the resize, and this is where it gets smarter than the stock ComfyUI image scale node:
scale_modepicks how the cropped region is sized:Dimensions (W × H),Multiplier,Longer Side,Shorter Side, orTotal Pixels (MP).divisible_by(default 32) snaps the result to a multiple of that value - the README's whole complaint about other nodes is that they "only do one side," so you'd upscale to 1024 wide but get 1019 tall. This node snaps both, andmaintain_aspectkeeps the ratio intact while it does it. Setdivisible_byto 1 to disable.post_crop(disabled/center) applies a scale-to-cover then center-crop when the target ratio doesn't match the source - the same trick "cover" mode uses in CSS.upscale_method-nearest-exact,bilinear,area,bicubic, orlanczos. Bilinear is a sane default for getting latent input sizes; bicubic/lanczos if you care about the visual result.
The same transform is applied to the optional mask with a bilinear interpolate, so image and mask stay pixel-aligned - the recurring mask-drift problem this pack is built to kill.
The inputs and outputs that matter
aspect_ratio- Free, the standard presets, orCustom(viacustom_ratio_w/h).crop_x/y/w/h- normalized box, set by dragging.scale_modepluswidth/height,multiplier,megapixels,long_side_target/short_side_target- whichever one matches the mode you chose.- Outputs:
image,mask, andwidth/height/x/y- the final size plus the crop origin in source-pixel space for compositing back.
Install
ComfyUI Manager → search "PlagueKind-Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/PlagueKind/ComfyUI-PlagueKind-Nodes.git
Restart ComfyUI. No dependencies beyond stock ComfyUI - no requirements.txt in the repo, nothing to download.
Gotchas
- No image connected → it becomes a resolution selector. The source falls back to computing the target size and prints "Resized to: W × H" in the node's text output. Handy for text-to-video setups where you just want the right latent dims, but confusing if you expected a crop.
- First run is just to summon the preview - you can't draw the box until the node has executed once with an image.
- Watch
divisible_byon video. The default 32 is right for LTX-2.x, but if your workflow wants 64 you'll get faster sampling from a more expensive-looking number. Don't crank it blindly.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 10 options: Free, 1:1, 4:3, 3:4, 16:9, 9:16, +4 | |
| custom_ratio_w | INT | 11–100 | — |
| custom_ratio_h | INT | 11–100 | — |
| crop_x | FLOAT | 0.0000–1 | — |
| crop_y | FLOAT | 0.0000–1 | — |
| crop_w | FLOAT | 1.0000.001–1 | — |
| crop_h | FLOAT | 1.0000.001–1 | — |
| show_crop_values | BOOLEAN | false | — |
| scale_mode | COMBO | 5 options: Dimensions (W × H), Multiplier, Longer Side, Shorter Side, Total Pixels (MP) | |
| long_side_target | INT | 10241–16384 | — |
| short_side_target | INT | 7681–16384 | — |
| width | INT | 10241–16384 | — |
| height | INT | 10241–16384 | — |
| multiplier | FLOAT | 1.00 | — |
| megapixels | FLOAT | 1.00 | — |
| upscale_method | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| post_crop | COMBO | 2 options: disabled, center | |
| divisible_by | INT | 321–512 | — |
| maintain_aspect | BOOLEAN | true | — |
| imageopt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| width | INT | — |
| height | INT | — |
| x | INT | — |
| y | INT | — |