ComfyUI Node

Un-Jitter Image

Undo the offset so your supersampled frames line back up

By spacepxl·Created 3 years ago·Updated 8 months ago· 293
Un-Jitter Image
  • images
  • IMAGE
jitter_scale1.0
oflow_alignfalse

The other half of the jitter pair. Jitter Image nudges a frame by a small sub-pixel offset so you can run some operation on several slightly-shifted copies of the same image; Un-Jitter Image shifts each one back into alignment afterward so they can be averaged together cleanly. That average-of-offset-samples pattern is how you fake supersampling/antialiasing without actually rendering at higher resolution - the same trick real-time engines use for temporal anti-aliasing, just done by hand across a small batch instead of across video frames.

Why it needs its own node instead of just inverting the offset

Realigning after a jitter isn't always as simple as shifting by the exact negative of what you applied - if whatever ran between the jitter and un-jitter steps introduced its own motion or distortion (a generative pass, a warp, anything non-trivial), a naive inverse shift won't line things back up perfectly. That's what the oflow_align option is for: instead of relying purely on the deterministic reverse of the jitter offset, it can pull in optical-flow-based alignment - the same underlying idea as this pack's Batch Align (RAFT) node - to compensate for real movement between frames, not just the synthetic jitter you introduced.

Inputs and outputs

  • images (IMAGE) - the jittered batch you want realigned.
  • jitter_scale (default 1, minimum 0.1) - must match whatever value you used on the Jitter Image node that produced this batch. Mismatch here and the realignment is simply wrong.
  • oflow_align (boolean, default off) - when enabled, brings optical-flow alignment into the realignment step, useful if content moved for reasons beyond the deterministic jitter you applied. Leave it off for a pure, cheap inverse-shift when nothing else in your pipeline introduced motion.

Output is a single IMAGE - the realigned batch, ready to be averaged (the README names a dedicated BatchAverageUnJittered node for that last step) into your final antialiased result.

Installing it

Through ComfyUI Manager: search "ComfyUI-Image-Filters," install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Image-Filters

pip install -r requirements.txt (or install.bat on Windows), restart ComfyUI. No model downloads for this node.

The pack-wide opencv gotcha applies here too - this node ships inside the same repo as everything else, so a conflicting cv2 install elsewhere on your system will break the whole pack's import, not just this one node. import_error_install.bat is the fix: it removes every opencv variant and reinstalls the single correct one.

Common issues

The single biggest mistake is a jitter_scale mismatch between this node and the Jitter Image node upstream - since this node recomputes the reverse offset rather than reading back an exact value from the jitter step, any discrepancy leaves your frames misaligned, and averaging misaligned frames just produces a soft, ghosted blur instead of a clean antialiased image. If your final averaged result looks smeared rather than sharp-but-smooth, check that value first before assuming the technique doesn't work. Second, oflow_align adds real compute cost for the optical flow calculation - leave it off unless you've actually got motion between frames beyond the synthetic jitter, since it won't help (and just slows things down) on a batch where the only difference between frames is the deterministic offset you applied yourself.

CategoryImage-Filters/image/jitter

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
jitter_scaleFLOAT1.0
oflow_alignBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE