Nodes/IAMCCS-nodes/IAMCCS Target Crop
ComfyUI Node

IAMCCS Target Crop

Crop to exact target dimensions without the guesswork

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
IAMCCS Target Crop
  • image
  • image
  • x
  • y
  • width
  • height
  • report
target_x0
target_y0
target_width1280
target_height720
resize_to_targetfalse

Every video pipeline has that moment where your source image is 1440×810 but the sampler wants 1280×720 and you're doing mental math about where to crop. IAMCCS Target Crop is the node that makes that explicit instead of accidental: you tell it the pixel box, it crops, and it hands you back the exact coordinates and dimensions it actually used - plus a JSON report you can pipe anywhere.

It lives in the IAMCCS/Cine/Ideogram category, which tells you where it came from: the author's storyboard/Ideogram workflow needed a deterministic crop so that every frame fed into a pipeline was cropped to the same target without silently distorting aspect. This node does not resize by default - it crops first, and only scales up to the target if you ask it to.

Inputs that matter

  • image - your input batch, any resolution.
  • target_x / target_y - top-left corner of the crop box, in pixels.
  • target_width / target_height - how big the box is. Defaults are 1280×720, which is why the node feels at home in video graphs.
  • resize_to_target - the one that can surprise you. Off by default: the crop is clipped to the source bounds and left at whatever size it lands on. Flip it on and the cropped result is resized (bilinear) to exactly target_width × target_height, which is what you want when a downstream sampler is strict about dimensions.

Outputs

  • image - the crop.
  • x, y, width, height - the actually applied box, which differs from what you typed when the box hangs off the edge. Wire these into anything that needs to know where the crop landed.
  • report - JSON with source size, requested box, applied box, and whether resizing happened.

The report output is the quietly great part. In an LTX 2.x graph where frame dims must stay consistent across segments, you can log that JSON and catch drift instead of discovering it three renders later.

Install

Part of IAMCCS-nodes. ComfyUI Manager → search "IAMCCS", or:

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Restart ComfyUI. Nothing extra to download - this node is pure tensor slicing and resize, no models.

Where people get burned

The biggest one is forgetting that crops are clamped, not errors. Ask for x=2000 on a 1280-wide image and you get x=max(0, min(2000, 1279)) = 1279 and a tiny sliver, not a crash. That's usually fine, but if you're routing width/height into a latent setup that requires specific multiples (LTX wants widths divisible by 32), set resize_to_target and your target to a compliant size rather than trusting a clamped crop. And keep in mind the node assumes a [B,H,W,C] tensor - feed it a video that's already been decoded to frames and you're golden, but a raw LATENT won't work here; decode first.

CategoryIAMCCS/Cine/Ideogram

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
target_xINT00–16384
target_yINT00–16384
target_widthINT12801–16384
target_heightINT7201–16384
resize_to_targetBOOLEANfalse

Outputs (6)

NameTypeDescription
imageIMAGE
xINT
yINT
widthINT
heightINT
reportSTRING