ComfyUI Node Runs on cloud

Video Datamosh

The glitch that made 2009 look like this

By WASasquatch·Created 4 years ago·Updated a day ago· 1,864
Video Datamosh
  • video
  • motion
  • video
◄start_frame0►
◄amplify1.00►
◄residual1.00►
◄refresh0.00►
◄keyframe_every0►
◄block_size16►
◄at_cutscarry►

Datamoshing is what happens when you delete a compressed video's keyframes and keep the motion vectors. Instead of the decoder replacing the picture, it drags whatever is already on screen along the motion - so pixel data from a previous shot gets pushed around by the current one's movement and blooms through it. It was the signature glitch of a certain era of music video, and it is genuinely hard to do by hand: you need to manipulate a codec's frame types, which means re-encoding and hoping.

Video Datamosh fakes it at the pixel level instead, with the same visual result and none of the codec surgery. It is one of the most fun nodes in the pack and, fair warning, one of the easiest to overuse.

Inputs

video is the clip, at least two frames. A clip with a cut in it is the interesting case - the mosh blooms across it.

start_frame (counting from 0) is the first frame moshed; everything before it plays clean. That is how you give the effect an entrance instead of hitting the viewer with it at frame zero.

amplify is how far the motion is pushed: 1 is as it moved, 2 is twice as far for a bigger bloom, 0 freezes the picture entirely. residual is the share of each frame's own change carried in with the motion: 1 is the classic look where a shot holds together and moshes across cuts, 0.5 smears, 0 melts into mush. If you want the textbook effect, this is the control to be strict about - leave it at 1 and use cuts, not residuals, to make things interesting.

refresh is the share of each real frame mixed back in: 0 is a full mosh, 0.1 slowly recovers, 1 is no mosh at all. This is the dial between "glitch moment" and "broken file". keyframe_every is frames between clean frames counted from start_frame - 0 never, 24 once a second at 24 fps. A low value here is how you make the effect look like a codec struggling rather than a total picture loss.

block_size is the side of the blocks the picture moves in: 16 is codec-like (which is the point), 4 is finer, 0 is smooth per-pixel. The blockiness is the aesthetic - this is the one place in the pack where a lower-quality algorithm is the desired output.

at_cuts is the control that defines the classic effect: carry pushes the old shot around with the new shot's motion, and reset starts clean at every cut. Set it to carry, or you have just built a worse version of a smearing filter.

motion is optional and takes a shared measurement from Video Motion of this same clip at any size. Empty, it measures at 768 px on the long side.

Output is one video, same size, length, frame rate and audio.

Install

ComfyUI Manager → search WAS Node Suite v3 → install → restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git

ComfyUI 0.14.0+ and Python 3.10+. Nothing is pip-installed by the pack - requirements.txt is a comment, no network calls happen while features.network is off. No model weights needed. First start, and the first start after an update, is a second or two slower while the pack writes its config and compiles.

Getting a result you would show someone

Pick the clip first. Datamosh needs cut footage - two different shots of the same subject, or a hard cut in a pan - because the effect is entirely about one image's data being pushed by another image's motion. A single continuous take gives you a smear, not a mosh. That is the single most common reason someone tries this node and concludes it doesn't work.

Then keep it short. Two or three seconds of mosh on a ten-second clip lands; ten seconds of mosh is noise. Put start_frame at the cut, run residual 1, at_cuts: carry, block_size 16, and leave refresh at 0. Once that reads, the fun settings are amplify around 1.5–2 for bloom and refresh around 0.1 to let the picture stumble back - which, honestly, looks better than the full melt most of the time.

One last thing: the flow measurement is the expensive part, and a moshed clip needs the same measurement for every node in the chain. If you are stacking glitch effects, measure once in Video Motion and wire motion into each of them.

CategoryWAS Suite/Animation

Inputs (9)

NameTypeDefaultDescription
videoVIDEOThe clip, at least two frames; one with a cut moshes across it.
start_frameINT00–100000First frame moshed, counting from 0; the frames before it play clean.
amplifyFLOAT1.000–8How far the motion is pushed: 1 = as it moved; 2 = twice as far, for blooms; 0 = frozen.
residualFLOAT1.000–1Share of each frame's own change carried in with the motion: 1 = a shot holds together and moshes across cuts; 0.5 = smears; 0 = melts.
refreshFLOAT0.000–1Share of each real frame mixed back in: 0 = full mosh; 0.1 = slowly recovers; 1 = no mosh.
keyframe_everyINT00–10000Frames between clean frames, counted from start_frame: 0 = never; 24 = once a second at 24 fps.
block_sizeINT160–128Side of the blocks the picture moves in: 16 = codec-like; 4 = finer; 0 = smooth per pixel.
at_cutsCOMBOcarry'carry' pushes the old shot around with the new one's motion; 'reset' starts clean at every cut.
motionoptWAS_MOTIONMotion from Video Motion, measured from this same clip at any size. Left empty, it is measured here at 768 px on the long side.

Outputs (1)

NameTypeDescription
videoVIDEOThe moshed clip: same size, length, frame rate and audio.