Temporal Stitch Stabilizer
Stop a mask from popping before you stitch
- masks
- stabilized_masks
Here's the failure mode this node exists for. Your mask is good. Frame 40 is good. Frame 41 is good. Play them together and the edge of the mask crawls, or the whole shape pops for a frame, and suddenly your stitch line breathes like a bad alpha channel from 2004. The per-frame result is fine; the sequence isn't.
Temporal Stitch Stabilizer fixes that, and it's almost embarrassingly simple: a Gaussian blur applied across frames instead of across pixels.
How it works
Input is masks - a mask sequence, one per frame, in timeline order. Output is stabilized_masks. That's the whole node: one in, one out, one setting.
temporal_sigma (default 2, range 0–16, step 0.5) is the Gaussian width in frames, and the filter reaches 3σ frames either side. At the default that's a reach of six frames each way - enough to smooth a jitter of one or two frames, small enough that a genuine cut in mask shape isn't dragged across the shot.
Two behaviours worth knowing from the tooltips. A single mask comes back unchanged, so it's safe to drop into a graph you also run on stills. And values of temporal_sigma at 0.1 or below bypass the node entirely - the author's way of saying "off" without adding a switch.
Why per-pixel across time rather than a per-frame morphological cleanup? Because jitter is a high-frequency signal in the time axis, and a low-pass filter in time is exactly the right primitive for it. Each pixel of the mask gets its own little 1-D blur of its own history, which means the edge moves smoothly as a curve rather than being snapped to a threshold every frame. It's the same logic as frame-blending an inconsistent alpha, minus the ghosting you get from blending whole images.
Where it earns its keep
Stitching is the case in the node's name. When you composite two pieces of coverage - an upscale seam, a patch of regenerated detail, a plate extension - the stitch line has to be in the same place for the whole shot. If it wobbles, the audience sees a seam even when each frame is technically clean.
It also helps before a matting or rotoscoping pass, for the same reason: a mask with frame-to-frame jitter will produce a matte with frame-to-frame jitter, and no amount of edge refinement downstream fixes a mask whose shape changes per frame. And it's useful on masks that came from a per-frame prediction - depth-derived, detection-derived, anything that re-derives its own answer every frame - where a model can be right on average and noisy in detail.
The trade
Blurring across time is a low-pass filter, so it costs you legitimate change too. A mask that must snap - a character's hand entering frame, an occlusion appearing - gets softened by exactly the amount you blur. That's the whole tuning job: enough sigma to kill the crawl, not enough to make deliberate changes late.
Because the reach is 3σ, the ends of the sequence have less history to average with. Expect the first and last few frames to be less smoothed than the middle, and if that bothers you, extend the range upstream.
Install
- ComfyUI Manager → search Radiance → Install → restart → refresh the browser.
- Or:
cd ComfyUI/custom_nodes
git clone https://github.com/fxtd-studios/radiance.git
cd radiance
python -m pip install -r requirements.txt
Windows portable: run that pip line with python_embeded\python.exe. Radiance is a large pack - the requirements include OpenEXR, OpenImageIO, OpenColorIO, transformers, diffusers - but this node is pure tensor maths and downloads nothing. If Manager installs an older build than the README's 3.5.0 (the registry has lagged), hit Update or git pull inside custom_nodes/radiance.
Gotchas
Feed it frames in order. It has no way to know your sequence is a batch that ComfyUI reordered into a different section - it assumes timeline order, and shuffling is the one input mistake that produces a worse result than no node at all.
And don't reach for it to fix a mask that is wrong rather than jittery. Averaging a bad mask over time just gives you a smoother bad mask. If the shape is wrong in a consistent direction, that's an upstream problem.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | Mask sequence, one mask per frame in timeline order. A single mask is returned unchanged. | |
| temporal_sigma | FLOAT | 2.00–16 | Gaussian width in frames; the filter reaches 3 x sigma frames each way. Values of 0.1 or less bypass the node. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| stabilized_masks | MASK | — |