PixelRedistribution WIP | GlitchNodes
Pixels that diffuse instead of smear
- image
- image
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, ordiagonal. 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. Try2,1,0and 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."
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| distance_mode | COMBO | center | 4 options: center, top, left, random |
| pattern | COMBO | outward | 4 options: outward, spiral, waves, diagonal |
| color_size | INT | 642–128 | — |
| order | STRING | 0,1,2 | — |
| strength | FLOAT | 1.00.1–2 | — |
| contrast | FLOAT | 1.00.1–4 | — |
| brightness | FLOAT | 0.0-1–1 | — |
| invert | BOOLEAN | false | — |
| seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |