ComfyUI Node

MX_SineWave

Make your image wobble like a bad VHS tracking glitch

By Intersection98·Created 2 years ago·Updated 2 years ago· 13
MX_SineWave
  • image
  • IMAGE
amplitude20
frequency10
direction

MX_SineWave is the pack's distortion toy: it slides rows (or columns) of your image sideways by an amount that follows a sine wave, so straight lines turn into gentle S-curves and the whole frame gets that wobbly, heat-haze, bad-tape-glitch quality. It's a one-trick node, but the trick is a good one for adding motion and weirdness to otherwise static renders.

It's part of Intersection98/ComfyUI-MX-post-processing-nodes. It's one of the pack's simpler effects and the fastest to learn - three inputs, and two of them you'll barely touch.

How it works

For each row of the image (horizontal direction) or each column (vertical), the node computes a sine-based offset and rolls that line by the offset using torch.roll. The offset oscillates across the image - frequency controls how many wave cycles fit across the frame, amplitude controls how far each row shifts. Because the shift varies smoothly from row to row, the result is a continuous undulation rather than a series of disjointed slices. The one artifact to know about: torch.roll wraps content around the edges, so a line that shifts right pulls pixels in from the left edge - at large amplitudes you'll see hard vertical seams on the frame edges.

The inputs that matter

  • image - your IMAGE tensor.
  • amplitude - 0 to 150, default 20. Max shift in pixels. Under ~10 it's a subtle jitter that reads as analog wobble; 40+ is full liquid-mirror territory.
  • frequency - 0 to 20, default 10. Wave cycles across the image. Low values = one slow undulation; high values = many tight ripples.
  • direction - horizontal (rows slide left/right, the classic glitch) or vertical (columns slide up/down, for a "shutter tear" feel).

Output is a single IMAGE, same resolution.

Install

Standard MX pack install. ComfyUI Manager (search MX or ComfyUI-MX-post-processing-nodes), or:

cd ComfyUI/custom_nodes
git clone https://github.com/Intersection98/ComfyUI_MX_post_processing-nodes
cd ComfyUI_MX_post_processing-nodes
pip install -r requirements.txt

Restart ComfyUI; it's under postprocessing/Effects. No models, no downloads - it's pure torch tensor math, doesn't even need the pack's OpenCV dependency.

Where people get burned

The edge-wrapping seam is the thing that catches everyone: crank amplitude up and the frame edges develop hard strips of recycled pixels. If that ruins the shot, keep amplitude below ~5% of the image width, or crop a few percent after the effect. Second, because the sine pattern is tied to pixel rows/columns, the same frequency value produces different visual results at different resolutions - set it by eye, not by muscle memory. And it's worth stating plainly: this is an effect node, not a fixer - if you were hoping for lens-distortion correction or perspective repair, this isn't that. For its actual purpose (adding organic wobble to a static image before compositing it into an animation or glitch edit), it's cheap, instant, and exactly as weird as you dial it to be.

Categorypostprocessing/Effects

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
amplitudeFLOAT200–150
frequencyFLOAT100–20
directionCOMBO2 options: horizontal, vertical

Outputs (1)

NameTypeDescription
IMAGEIMAGE