Nodes/ComfyUI-WJNodes/mask crop option SmoothCrop
ComfyUI Node

mask crop option SmoothCrop

Stopping your crop box from jittering across video frames

By 807502278·Created 2 years ago·Updated 11 months ago· 21
mask crop option SmoothCrop
  • add_option
  • crop_option
enable_smooth_cropfalse
multi_frame_smooth3
smooth_strength0.50
smooth_threshold50
enable_blank_fillfalse

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.

CategoryWJNode/ImageEdit/mask_crop

Inputs (6)

NameTypeDefaultDescription
enable_smooth_cropBOOLEANfalse
multi_frame_smoothINT33–51
smooth_strengthFLOAT0.500–1
smooth_thresholdINT500–1000
enable_blank_fillBOOLEANfalse
add_optionoptcrop_option

Outputs (1)

NameTypeDescription
crop_optioncrop_option