PixelSort
The glitch that won't stop being cool
- image
- mask
- IMAGE
Pixel sorting is the aesthetic that refuses to die: take rows (or columns) of pixels, sort them by brightness or hue, and the image comes apart into those gorgeous cascading streaks of color - the glitch look from a thousand album covers and vaporwave videos. PixelSort is a faithful implementation with a real mask input, which is the part that makes it actually controllable instead of just "mess up the whole image." It's the pack author's favorite for a reason: no other node in this pack produces anything close to it.
How it works
The mask decides where the effect applies. The image is scanned line by line (or column by column), and wherever the mask is active, the pixels in that contiguous run are sorted by a chosen property - the classic approach is to feed it a thresholded mask so only some regions get scrambled. The key detail: this implementation trims each run's endpoints so the sort only rearranges the interior, keeping the start and end pixels in place. That's what gives you those stable, sharp boundaries between sorted and unsorted regions instead of a total smear.
- mask - an IMAGE that defines the sorted bands. Any grayscale image works; the classic is your own render thresholded, or a gradient. This is the input that makes or breaks the effect.
- direction -
horizontalsorts rows (the classic waterfall streaks),verticalsorts columns. - sort_by -
hue,saturation, orvalue. Hue gives rainbow cascades; value (brightness) gives the clean monochrome streaks. - span_limit (0–100, default 50) - the maximum band length that gets sorted. Runs longer than this stay untouched. Lower it for controlled streaks; set it to 0 for no limit and full chaos.
- order -
forwardorbackward(reversed sorting).
Output is a single IMAGE.
Install
PixelSort is one of ~22 nodes in ComfyUI-post-processing-nodes.
- ComfyUI Manager: search "post processing nodes", install, restart.
- Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/EllangoK/ComfyUI-post-processing-nodes
Restart after. No requirements.txt, no downloads. It's under postprocessing → Effects in the node menu.
Making it not look like garbage
The trap is feeding in no mask or an all-white mask, which sorts the entire image into a smear - technically a glitch, practically unusable. The move: threshold your image by value so only the highlights (or a region you pick) are sorted, leave span_limit around 20–50, and sort by value for a clean look or hue for full vaporwave. It's slow - the sort runs in Python loops per row - so don't feed it a video batch without a plan. But when you land it, it's the most striking thing this pack can do.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | IMAGE | — | |
| direction | COMBO | 2 options: horizontal, vertical | |
| span_limit | INT | 500–100 | — |
| sort_by | COMBO | 3 options: hue, saturation, value | |
| order | COMBO | 2 options: forward, backward |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |