ComfyUI Node

FL Image Crop

Trim a fixed number of pixels off one or two sides

By filliptm·Created 3 years ago·Updated about 15 hours ago· 628
FL Image Crop
  • image
  • IMAGE
crop_directionTop
crop_amount50

Sometimes you don't need a full crop-to-region tool with bounding boxes and masks - you just need to shave 40 pixels off the top because a generation left a banding artifact at the edge, or trim the letterboxing off a video frame. FL_ImageCrop is that simple tool: pick a direction, pick a pixel amount, done.

How it works

You choose which edge (or pair of edges) to trim from and by how many pixels, and it slices that amount off. It validates the crop amount against the image's actual dimensions first, so asking for a crop bigger than the image itself fails cleanly rather than producing a negative-size or corrupted result.

The inputs and outputs that matter

All required:

  • image - what you're cropping.
  • crop_direction - one of Top, Bottom, Left, Right, Top and Bottom, Left and Right. Note the paired options crop from both sides at once, by the same amount each.
  • crop_amount (1–2048, default 50) - pixels to remove. With a paired direction, this amount comes off each side, so Top and Bottom at 50 removes 100px of height total, not 50 split between them.

Output: a single IMAGE.

How to install it

Ships inside ComfyUI_Fill-Nodes. ComfyUI Manager: search ComfyUI_Fill-Nodes, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes

then restart. Plain tensor slicing, no dependencies beyond what ComfyUI ships with.

Common issues & troubleshooting

One node, one direction (or pair) at a time. Want to trim top, bottom, and left in one pass? This node doesn't do arbitrary combinations - only the six listed options. Chain two FL_ImageCrop nodes if you need to trim from more than one axis independently (e.g. one node for Top, a second for Left and Right).

crop_amount applies per side on the paired options, easy to miscalculate. People sometimes expect Top and Bottom at 50 to remove 50px total (25 off each); it actually removes 50 off each side, 100px total. Halve your number if you meant a fixed total reduction.

Requesting more pixels than the image has fails rather than clamping. The node validates the crop amount against the image's dimensions and won't silently clamp to "crop as much as possible" - if your crop_amount is close to the image's full height or width, check the actual pixel dimensions first (FL_ImageDimensionDisplay is a quick way to confirm) rather than guessing.

For anything more than a fixed pixel trim, look elsewhere in the pack. If you need to crop to a target aspect ratio, that's FL_ImageAspectCropper. If you need mask-driven cropping around a region for inpainting, that's FL_InpaintCrop. This node is deliberately the simple, fixed-amount case.

Category🏵️Fill Nodes/Image

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
crop_directionCOMBOTop6 options: Top, Bottom, Left, Right, Top and Bottom, Left and Right
crop_amountINT501–2048

Outputs (1)

NameTypeDescription
IMAGEIMAGE