Nodes/GlitchNodes/PixelRedistribution WIP | GlitchNodes
ComfyUI Node

PixelRedistribution WIP | GlitchNodes

Pixels that diffuse instead of smear

By pxl-pshr·Created 2 years ago·Updated 3 months ago· 73
PixelRedistribution WIP | GlitchNodes
  • image
  • image
distance_modecenter
patternoutward
color_size64
order0,1,2
strength1.0
contrast1.0
brightness0.0
invertfalse
seed0

PixelRedistribution is the pack's WIP physics experiment: it doesn't displace or corrupt pixels, it redistributes them - letting color "flow" across the image according to a distance field and a pattern. The result is something between pixel sorting and a fluid simulation: colors drain and pool, producing gradient-melt looks you can't get from the slice-based nodes. It's experimental (the display name says WIP), but when it lands, it's one of the most distinctive effects in the pack.

The mechanism is described in the source as "vectorized diffusion: pixels flow from dense to sparse colors." The node first builds a distance map based on distance_mode (center, top, left, or random origin) combined with pattern (outward, spiral, waves, or diagonal). That map defines how far each pixel should travel. Then colors are quantized to color_size levels per channel, and pixels are re-sorted along that distance field so over-represented colors spread out and sparse colors gather - a smooth, organized reshuffle rather than random noise. order (a comma-separated string like "0,1,2") lets you control which channels process first, which changes how colors bleed into each other.

The inputs that matter

  • pattern - outward, spiral, waves, or diagonal. This is the personality of the effect: outward gives a radial melt, spiral gives that hypnotic swirl, waves make bands.
  • distance_mode - where the pattern originates (center, top, left, random).
  • color_size (2–128, default 64) - color levels per channel. Higher = smoother gradients, lower = more posterized chunks.
  • strength (0.1–2, default 1) - how aggressively pixels move. This is the master intensity.
  • order - channel processing order, e.g. 0,1,2. Try 2,1,0 and watch the color bleed direction flip.
  • contrast / brightness - pre-processing before the redistribution kicks in.
  • seed - required; with distance_mode = random, this is what makes a given swirl reproducible.

Output is image (IMAGE) → PreviewImage/SaveImage. Batch input is supported, which is how you'd animate the melt across a sequence.

Installing it

Same pack install as everything here:

cd ComfyUI/custom_nodes
git clone https://github.com/pxl-pshr/GlitchNodes
# restart ComfyUI

or ComfyUI Manager → Install Custom Nodes → search "GlitchNodes". Deps: numpy, torch, Pillow, opencv-python, scipy. No models.

Gotchas

Two things to know. First, it's WIP - this node isn't in the README's node table the same way the stable ones are, and the source shows vectorized diffusion logic that can misbehave on weird shapes or extreme parameter combos. Second, the effect is easy to overdrive: strength above ~1.5 on a detailed image tends to collapse into uniform mush, so work up slowly. Start with waves + center, color_size 64, strength 1.0 - that's the sweet spot where it looks intentional. And the standing pack warning applies: "highly experimental and may break or even error."

CategoryGlitchNodes

Inputs (10)

NameTypeDefaultDescription
imageIMAGE
distance_modeCOMBOcenter4 options: center, top, left, random
patternCOMBOoutward4 options: outward, spiral, waves, diagonal
color_sizeINT642–128
orderSTRING0,1,2
strengthFLOAT1.00.1–2
contrastFLOAT1.00.1–4
brightnessFLOAT0.0-1–1
invertBOOLEANfalse
seedINT00–18446744073709550000

Outputs (1)

NameTypeDescription
imageIMAGE