Nodes/IG Interpolation Nodes/βœ‚οΈ IG Image Crop
ComfyUI Node

βœ‚οΈ IG Image Crop

Crop by pixel amounts off each edge β€” no geometry math required

By IDGallagherΒ·Created 3 years agoΒ·Updated about a year agoΒ· 3
βœ‚οΈ IG Image Crop
  • image
  • image
β—„top0β–Ί
β—„right0β–Ί
β—„bottom0β–Ί
β—„left0β–Ί

IG Image Crop trims pixels off the edges of an image - top, right, bottom, and left each remove that many pixels from their side. It's a border-crop, not a region-pick: you specify how much to remove, and the result is the image minus those margins. That's a slightly different mental model from ComfyUI's crop-by-box nodes, and it's often the more convenient one when you're cleaning up output rather than choosing a subject.

Why would this live in the IG pack? Because the stitchers and the tile machinery in this pack frequently produce images with uneven edges - a panorama whose top sliver is a scan artifact, or a stitched output with a 1-pixel seam. A border crop is the standard cleanup for that, and this node is the shortest path to it. It's also handy for trimming letterbox bars or watermark margins before a pipeline continues.

Inputs:

  • image - IMAGE.
  • top, right, bottom, left - INT, each default 0, meaning "remove nothing from this side."

Output: image - the cropped tensor. All four amounts are clamped at zero (negative values are ignored rather than crashing), and the node raises a clear error if the crop would leave a non-positive-sized image - that's the message to watch for when the math doesn't line up with the actual dimensions.

One honest note: the source comment claims the tensor is BCHW while ComfyUI images are really BHWC, and the slicing happens to work because it indexes on the right axes anyway - so you don't need to care, but it tells you the level of polish this pack's README (which is :)) can't help with. Behavior-wise, batched images work fine; the crop applies to every frame in the batch identically.

Install is the pack standard:

cd ComfyUI/custom_nodes
git clone https://github.com/IDGallagher/ComfyUI-IG-Nodes
cd ComfyUI-IG-Nodes && pip install -r requirements.txt

Or ComfyUI Manager β†’ search "IG Interpolation Nodes" β†’ Install, restart. No models, no heavy deps. It's a thin node and that's the point - when all you need is a border trim, this is four integers and a wire.

CategoryπŸ“ IG Nodes/IO

Inputs (5)

NameTypeDefaultDescription
imageIMAGEβ€”
topINT0β€”
rightINT0β€”
bottomINT0β€”
leftINT0β€”

Outputs (1)

NameTypeDescription
imageIMAGEβ€”