Nodes/ComfyUI ASDF Pixel Sort Nodes/Pixel Sort Advanced (ASDF)
ComfyUI Node

Pixel Sort Advanced (ASDF)

The version of this pack you'll actually want

By A043-studios·Created about a year ago·Updated about a year ago· 3
Pixel Sort Advanced (ASDF)
  • image
  • IMAGE
modewhite
white_threshold-12345678
black_threshold-3456789
bright_threshold127
dark_threshold223
custom_sketch_path

If you're reaching for this pack at all, you want this node, not its basic sibling. "Advanced" here doesn't mean fancier effects - it means the four sorting thresholds are optional instead of required, and there's a custom_sketch_path input that lets you point the node at a fixed copy of the Processing sketch without editing Python. That last one is the whole ballgame, for reasons that'll be clear in a second.

Pixel sort is the classic glitch look: scan each row and column, find runs of pixels bounded by a brightness threshold, sort each run, and smear the colors into streaks. It's Kim Asendorf's 2010 ASDFPixelSort algorithm, and it's a great way to make a render feel like corrupted VHS or a datamoshed broadcast. This node is the ComfyUI wrapper around it. Wire it LoadImage → Pixel Sort Advanced (ASDF) → SaveImage and it hands back an IMAGE you can keep feeding into upscaling, color grading, or anything else downstream.

What's actually in the UI

Required, just two: image and mode. The mode enum - white, black, bright, dark - picks which pixel values become the boundaries that sorting stops at. Think of white/black as one axis measured in absolute RGB (0 = pure white, negative values go darker) and bright/dark as another measured in plain 0–255 brightness.

Everything else is optional, with the stock sketch's defaults pre-filled, and the sensible move is to only touch the ones matching your mode:

  • white_threshold / black_threshold - absolute-RGB thresholds, −16777216 to 0, step 1000
  • bright_threshold / dark_threshold - 0–255 brightness values
  • custom_sketch_path - a path to the .pde sketch directory, overriding the hardcoded /root/Processing/ASDFPixelSort

On that last one: the pack's basic node bakes its sketch path into Python, so if you moved the sketch you were editing source. Advanced solves that from the UI - you point it at wherever your (fixed) sketch lives and leave the code alone.

Installing - and the part nobody warns you about

Manager: search "ASDF Pixel Sort". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/A043-studios/ComfyUI-ASDF-Pixel-Sort-Nodes

Restart, done - with the Python side, anyway. The catch is that this node doesn't sort pixels itself. It writes your image to a temp file, calls processing-java (Processing 4.3, a Java environment), runs the sketch, and reads back the result. So you also need Java 17+, Processing 4.3 installed at the hardcoded /root/Processing/processing-4.3/processing-java, and a virtual display for headless runs:

sudo apt install openjdk-17-jdk
Xvfb :99 -screen 0 1280x1024x24 &

The README's sudo ./scripts/install.sh won't do any of this for you - that script isn't in the repo. And requirements.txt is a formality (torch, numpy, Pillow - all already in ComfyUI).

Where people get burned

This is a one-commit pack that shipped in mid-2025 with essentially no community footprint, so this is from reading the code, not accumulated forum wisdom. The big one: the shipped sketch ignores everything the node passes it. The bundled ASDFPixelSort.pde is the untouched 2010 original - it loads a hardcoded mountains.jpg, saves to its own directory, and waits for a click to exit. The node expects the sketch to write to the temp path it supplied and check it - so out of the box you get "Output image was not created" or a 120-second timeout. The custom_sketch_path knob only helps once you've patched a copy of the sketch to read the input/output arguments and quit after saving; then you point the node at that copy.

Other things to know: it handles one image per run (it takes image[0], dropping any batch), and it forces DISPLAY=:99, so even desktop users need Xvfb on that display or Processing can't open a window.

Honest verdict: if you're committed to the Processing route for pixel sorting, Advanced is the one to install - optional thresholds mean you can leave everything alone and get the classic look, and the sketch-path override is a genuine life-saver for a pack whose defaults are this brittle. If you just want the streak effect without a JVM and a virtual display in your stack, a pure-Python pixel sorter gets you 90% of the aesthetic for none of the dependency debt.

Categoryimage/effects

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
modeCOMBOwhite4 options: white, black, bright, dark
white_thresholdoptINT-12345678-16777216–0
black_thresholdoptINT-3456789-16777216–0
bright_thresholdoptINT1270–255
dark_thresholdoptINT2230–255
custom_sketch_pathoptSTRING

Outputs (1)

NameTypeDescription
IMAGEIMAGE