crop data CoordinateSmooth
Stop a tracked crop region from jittering
- crop_data
- crop_data
Anyone who's run a per-frame crop-and-detail pass on a video knows the specific annoyance this node fixes: the crop box tracks the subject frame to frame, but it never sits perfectly still - it wobbles by a few pixels even when the subject barely moved, and that wobble reads as a visible jitter once you paste the crop back. crop_data_CoordinateSmooth takes that jittery coordinate data and smooths it out over a small window of neighboring frames, so the crop region drifts instead of twitches.
It's one of a family of crop_data-based nodes in ComfyUI-WJNodes, a large personal utility pack (807502278's own words: "a simple node package that I use myself") that builds a home-grown detect → crop → edit → paste-back pipeline for image and mask work, alongside a pile of unrelated file, color, and video tools.
How it works
crop_data is this pack's own bundled type - a dictionary carrying the crop coordinates (and presumably the source images/masks) for a sequence, produced by the pack's mask-crop nodes upstream. This node walks that sequence and, for each frame, looks at the coordinates within a window of neighboring frames (frame_range) and pulls outlier jumps back toward the local average, scaled by smooth_strength. It only intervenes when a frame-to-frame coordinate change is large enough to clear smooth_threshold - small, natural movement is left alone, so you're not flattening real motion, just killing the noise.
The inputs and outputs that matter
crop_data- the crop coordinate sequence you're smoothing. Comes from upstreamcrop_data-producing nodes in this same family (the mask-crop nodes).frame_range(default 3, odd numbers 3–49) - how many neighboring frames the smoothing window looks at. Wider windows smooth more aggressively but can lag behind genuinely fast motion.smooth_strength(default 0.5, 0–1) - how hard the smoothing pulls outlier coordinates back toward the local average.smooth_threshold(default 50) - the minimum coordinate change, in pixels, before smoothing kicks in at all. This is what keeps small, real movement from getting flattened along with the jitter.enable_blank_fill(default off) - a toggle the pack doesn't document beyond its name; test it on a short clip before relying on it if you're not sure what it changes.
Output is a single smoothed crop_data, which feeds forward into the next node in the crop pipeline (an edit or paste-back step) rather than doing anything with images or masks directly.
How to install it
Through ComfyUI Manager, search "ComfyUI-WJNodes" and install. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
Restart ComfyUI. The optional pip install -r requirements.txt inside the pack folder is rarely needed - the README says most dependencies already ship with a normal ComfyUI setup. No models to download for this node; it's pure coordinate math.
Common issues & troubleshooting
Smoothing feels like it's not doing anything. Check smooth_threshold first - if your jitter is smaller than the threshold, the node treats it as intentional motion and leaves it alone. Lower the threshold before cranking smooth_strength.
Crop lags behind fast motion. That's frame_range set too wide for the speed of movement in your clip - a big smoothing window trades responsiveness for stability. Bring it down toward the 3-frame default if the subject moves quickly.
Nothing to smooth - crop_data input errors. This node only accepts the pack's own crop_data type, not a plain dict or JSON string. Make sure it's actually wired from an upstream crop_data-producing node in this pack, not something you built by hand.
No community threads to check against. This is a small piece of a personal toolkit pack rather than a widely-used feature, so if a setting behaves unexpectedly, your fastest path is testing it directly on a short sample rather than searching for someone else who hit the same thing.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| crop_data | crop_data | — | |
| frame_range | INT | 33–49 | — |
| smooth_strength | FLOAT | 0.500–1 | — |
| smooth_threshold | INT | 500–1000 | — |
| enable_blank_fill | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| crop_data | crop_data | — |