ComfyUI Node

BMAB Crop

A plain crop-and-optionally-resize node

By portu-sim·Created 2 years ago·Updated 8 months ago· 124
BMAB Crop
  • image
  • image
width2
height3
resize

Not every crop needs a detection model behind it. Sometimes you just know the exact box you want and need a node that does exactly that, with an option to resize the result afterward. That's this one.

What it is and why you'd reach for it

BMAB Crop takes an image and a target width/height, and crops to it - with an optional resize pass so the cropped output can be scaled to a different final size rather than just clipped. It sits apart from BMAB's detection-driven cropping nodes (BMAB Detection Crop, which uses an object detector to find the region for you): this one is manual, deterministic, and doesn't need a detection model or any GPU inference at all. If you already know the coordinates or aspect ratio you want - say, standardizing a batch of images to the same crop before a training run, or trimming a border a previous node left behind - this is the more direct tool.

How it works

Straightforward image cropping to the specified width and height, with the resize flag deciding whether the crop is then scaled or left at its native cropped size. This is plain PIL/torch-style image manipulation - no model weights, no detection, nothing probabilistic. Same input, same output, every time.

Inputs and outputs

  • image (required) - the image to crop.
  • width (required, default 2) - target crop width. The default of 2 in the schema is clearly a placeholder rather than a sensible starting value - you'll want to set this explicitly to whatever your actual target width is before running the node.
  • height (required, default 3) - target crop height, same caveat as width.
  • resize (required, enum: disable / enable) - whether to resize the cropped region afterward, or leave it at its native cropped dimensions.

Output: a single cropped image.

Installing it

Through ComfyUI Manager: search comfyui_bmab, install, restart. Manual install:

cd ComfyUI/custom_nodes
git clone https://github.com/portu-sim/comfyui_bmab.git
cd comfyui_bmab
pip install -r requirements.txt

(Windows portable users: python_embeded\python.exe -m pip install -r requirements.txt instead.) This node is pure image manipulation - no dependency on BMAB's optional comfyui_controlnet_aux or ComfyUI_IPAdapter_plus companion packs, and nothing to download beyond the base pack itself.

Common issues

  • Leaving width/height at their schema defaults. Those defaults (2x3) are not usable values for real work - set them to your actual intended crop size before running the graph, or you'll get a nearly invisible sliver of an image and wonder what went wrong.
  • Crop dimensions larger than the source image. If your target width or height exceeds the source image's actual size, you're asking the node to crop outside the image's bounds - check your source dimensions first if the result looks padded or unexpected.
  • Forgetting to enable resize when you actually wanted a resize. If your output is staying at the exact crop dimensions when you expected it scaled to something else afterward, double-check the resize toggle is set to enable.
CategoryBMAB/resize

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
widthINT20–10000
heightINT30–10000
resizeCOMBO2 options: disable, enable

Outputs (1)

NameTypeDescription
imageIMAGE