Djz Datamosh V5 (Size Range)
Sort frames by compressed size
- images
- IMAGE
Let's be honest about what this node is: it's not datamoshing. DjzDatamoshV5 doesn't touch motion vectors or MPEG compression at all. It analyzes how big each of your frames is when saved as a PNG, then reorders them - and the result looks like the chaotic frame-jumping of glitch art without any of the pain of the real thing. Same family of video-essay aesthetic, a tenth of the setup. If your only goal is "my animation should feel broken and unstable," this is the friendlier member of the DJZ datamosh suite.
How it works
The mechanism is almost insultingly simple. Every frame gets saved to a temp directory as a PNG; the file size is recorded; the frames inside your chosen range are sorted by that size; and the whole thing is reassembled through ffmpeg. That's it. It works because compression size is a rough proxy for visual complexity - a detailed, busy frame is a big PNG, a flat or smooth frame is a small one. Reorder by size and you get a sequence that groups all the visually similar frames together, which reads as a stuttering, strobing glitch when played back.
Inputs that matter
- images - a batch of at least two frames. Fewer than that and it bails.
- reverse_sort - sorts largest-to-smallest when on (default), smallest-to-largest when off. Try both; they produce genuinely different rhythms.
- start_frame / end_frame - the range of frames to shuffle. Frames outside the range stay put. This is the underrated part: sort only the middle of your clip and keep the intro and outro intact, or flip just one section. It's how you get a controlled stumble instead of full chaos.
The output is an IMAGE batch of the same frames, same dimensions - just in the new order.
The practical stuff
You need ffmpeg available, because the node pipes the reordered PNGs through it to rebuild the sequence - ComfyUI's portable install ships ffmpeg, and most Linux setups have it. It also needs the temp directory writable, which it will be in a normal ComfyUI install.
One honest caveat: the "sort by PNG size" heuristic can surprise you. Two frames that look near-identical can have very different file sizes because of noise, and a high-detail frame you expected to sit at one end of the sort might not land there. That's not a bug, it's the point - the unpredictability is part of the aesthetic. For sequences with a wide spread of visual complexity you'll get dramatic results; a boring uniform clip gives you a boring reorder. Feed it something with varied motion or detail.
Compared to DjzDatamoshV4 (motion-vector transfer, requires external ffgac/ffedit binaries) and V6/V7 (pixel sorting, deterministic per-image glitch), V5 is the low-friction one. No external tools beyond ffmpeg, no vector files, no silent failures from missing binaries. If you just want frame-level chaos in your animation and you'd rather not fight a toolchain, this is the node to grab first.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| reverse_sort | BOOLEAN | true | — |
| start_frame | INT | 00–999 | — |
| end_frame | INT | -1-1–999 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |