YC Image Crop Batch Apply
One crop, applied to every frame
- image
- crop_params
- image
- mask
This is the pack's crop logic, applied across a batch. Where YC Image Crop Interactive gives you a c_param DICT describing one crop, YC Image Crop Batch Apply takes that same DICT plus a batch of images and applies the identical crop to every frame. If you crop one frame interactively and want the exact same framing across a whole batch - a short video clip, a stack of variations - this is the node that keeps them aligned.
How it works
The crop_params DICT carries crop_x, crop_y, crop_width, crop_height and fill_color. For each frame the node builds a canvas of the requested crop size, copies the source pixels where the crop box overlaps, and fills whatever hangs over the edge with the fill color. Frames smaller than the crop get padded; the mask marks what's real image vs. filled space (1.0 where it's fill/extension, 0.0 where real pixels landed). Same intersection logic as the interactive node, just looped over the batch.
- Inputs:
image(a batch,B,H,W,C),crop_params(DICT). - Outputs:
image(cropped batch),mask(matching batch).
The pairing that matters
The DICT is designed to be fed from the Interactive node's c_param output - that's the intended workflow: crop one frame interactively, grab its params, and let Batch Apply replicate the crop across everything else. Hand-building the DICT is fiddly, so don't. One caveat: every frame gets the same mask and the same framing, which is exactly right for consistent series work and exactly wrong if your frames need per-frame crops - in that case you want per-frame masks, which this node won't invent for you.
Installing
Same pack, same two lines:
cd ComfyUI/custom_nodes
git clone https://github.com/yichengup/ComfyUI-YCNodes_Toolkit
Restart (or ComfyUI Manager → search "ComfyUI-YCNodes_Toolkit"). Dependencies are just numpy and Pillow, no models. It's a small, single-purpose node; its value is entirely in how well it slots after the Interactive crop node when you're processing series rather than single images.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| crop_params | DICT | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |