Nodes/DJZ-Nodes/Djz Pixel Sort V7 Advanced
ComfyUI Node

Djz Pixel Sort V7 Advanced

V7's four sort modes

By MushroomFleet·Created 3 years ago·Updated 6 months ago· 80
Djz Pixel Sort V7 Advanced
  • images
  • IMAGE
◄sort_mode▾►
◄threshold0.50►
◄rotation-90►
◄multi_passfalse►
◄seed42►

DjzDatamoshV7 is the pixel sorter you actually want out of the DJZ datamosh family. Where V6 gives you one mode and one direction, V7 gives you four sorting criteria, rotation, a multi-pass mode that stacks them all, and a seed for reproducibility. It's the node to grab when the classic "sort by brightness" look has gotten boring and you want to sort an image by hue so a sunset turns into horizontal color bands, or by edge strength so the whole thing reads like a contour map. Display name in ComfyUI is "Djz Pixel Sort V7 Advanced," and it earns the word.

How it works

Same skeleton as V6 - threshold-based segmentation, then re-sort within segments - but the sort key is selectable. sort_mode picks the property pixels are ordered by:

  • luminance - the familiar brightness sort.
  • hue - sorts by color angle. This is where things get psychedelic; a gradient of colors reorders itself into smooth rainbow bands.
  • saturation - pulls vibrant pixels apart from muted ones.
  • laplacian - sorts by edge-detection strength, producing contour-heavy, almost topographic results.

threshold (0–1, default 0.5) controls segment length. The doc's framing is slightly counterintuitive: lower values create fewer, longer sorted segments (more dramatic streaks); higher values make more, shorter segments (granular, subtle). It behaves a bit differently per mode since the threshold applies to whichever value is being sorted, so just treat it as "how broken do I want this."

The controls that change the character

  • rotation - rotates the sorting direction in 90° steps, default -90 (vertical sorting). 0 gives horizontal smears; the 180 values flip the direction. The single most useful knob for matching the effect to the image's dominant lines.
  • multi_pass - when on, applies all four modes in a fixed order (luminance → hue → saturation → laplacian) instead of just the selected one. Layered and nasty, and noticeably slower.
  • seed - makes the run reproducible. Note the sorting itself is deterministic; the seed matters for any randomized variation in the pipeline (and for keeping results stable across ComfyUI re-runs).

Input images, output IMAGE. The node runs in pure numpy/torch - no OpenCV, no ffmpeg, no external binaries - so it's the most portable member of the family. One dependency gotcha: it imports scipy's convolve2d for the laplacian mode, and scipy isn't listed in the pack's requirements.txt. If the node won't load, that's the usual culprit - pip install scipy and restart.

The honest take

For a single static image, a V7 multi-pass or hue sort is one of the best "instant art" effects in the pack - wire an image in, hit queue, and you've got a poster. Over a whole video sequence it can get busy fast, so start with luminance or saturation and only enable multi_pass once you know the shot can take it. And if you compare V7 to the "datamosh" name it carries: it's not datamoshing at all, it's pixel sorting - but that's fine, because it's good at exactly that.

Categoryimage/effects

Inputs (6)

NameTypeDefaultDescription
imagesIMAGE—
sort_modeCOMBO4 options: luminance, hue, saturation, laplacian
thresholdFLOAT0.500–1—
rotationINT-90-180–180—
multi_passBOOLEANfalse—
seedINT420–4294967295—

Outputs (1)

NameTypeDescription
IMAGEIMAGE—