mask crop option SmoothCrop
Stopping your crop box from jittering across video frames
- add_option
- crop_option
If you've done per-frame face or object detailing on video - mask a region each frame, crop it, refine it, paste it back - you've probably seen the crop box twitch. The mask flickers slightly frame to frame, the detected bounding box shifts by a few pixels even when the subject barely moved, and the result is a crop that visibly jitters or "breathes" across the sequence. This node exists specifically to smooth that out.
It's a companion settings node in ComfyUI-WJNodes, a personal pack from an author known only as 807502278, and it plugs into mask_crop_square's option input the same way mask_crop_option_Basic does - this node doesn't crop anything itself, it configures how the crop stabilizes over a run of frames. The underlying pattern - crop tightly around a mask, process at native resolution, stitch back - is the same one behind Impact Pack's video detailer workflows and the broader Inpaint Crop and Stitch approach that's become standard across the ComfyUI inpainting ecosystem; per-frame jitter in exactly this kind of crop-and-stitch pipeline is a documented pain point in that world, which is precisely the problem this node targets.
What it configures
- enable_smooth_crop - the master switch. Off by default, so you have to opt in.
- multi_frame_smooth - the window size, in frames, that the smoothing averages over. Constrained to odd numbers from 3 to 51. A small window (3–5) tracks fast motion more responsively but smooths less; a large window flattens jitter harder but can lag behind genuinely fast movement.
- smooth_strength - how much of the smoothing effect to apply, 0 to 1. Think of it as a blend between "raw per-frame crop position" (0) and "fully smoothed" (1) rather than an on/off.
- smooth_threshold - a cutoff (default 50) below which small frame-to-frame shifts get smoothed away, while larger, presumably-real movements pass through more directly.
- enable_blank_fill - a separate toggle for filling in gaps, off by default.
Output is a crop_option object - same type mask_crop_option_Basic produces - wired into a crop node's option input. The optional add_option input lets you chain this after (or before) another options node if you want both basic crop behavior and smoothing configured together.
Installing it
ComfyUI Manager: search "ComfyUI-WJNodes." Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
Restart ComfyUI afterward. No models or heavy dependencies for this node specifically.
Where this gets fiddly
The whole point of temporal smoothing is a trade-off, and it's worth being honest about it upfront: crank smooth_strength too high or multi_frame_smooth too wide, and a crop box that should be tracking a subject moving quickly across frame will start lagging behind it, clipping the edge of whatever you're trying to keep in frame. Start conservative - a small window, moderate strength - and only widen it if you're still seeing visible jitter, rather than maxing everything out on the first pass.
This is another node from a pack with essentially no public discussion anywhere - there's no thread to check for "what values do people actually use." The practical approach is to render a short test clip, actually look at the crop boundary frame-by-frame, and tune from there rather than trusting a default that was picked for the author's own use case, which may not match yours. And remember: this node does nothing unless enable_smooth_crop is on and its output actually reaches mask_crop_square - a disconnected or disabled options node just means you're back to raw, unsmoothed per-frame cropping.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| enable_smooth_crop | BOOLEAN | false | — |
| multi_frame_smooth | INT | 33–51 | — |
| smooth_strength | FLOAT | 0.500–1 | — |
| smooth_threshold | INT | 500–1000 | — |
| enable_blank_fill | BOOLEAN | false | — |
| add_optionopt | crop_option | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| crop_option | crop_option | — |