XWAVE Histogram Glitch
Per-channel curves that actually look like a glitch
- image
- IMAGE
Most "glitch" nodes fake it with pixel sorting or channel shifting. XWAVE Histogram Glitch does something lazier and stranger: it applies a different mathematical curve to each of the three color channels independently, and because red, green and blue stop agreeing with each other, the image falls apart in a way that reads as genuinely broken. At the default settings you get wavy bands of rainbow inversion rolling across the image. It's one of those "I have no idea what I'm doing and I love it" nodes.
How it works
Each channel (R, G, B) gets its own mode from four options:
- solarize -
0.5 + 0.5 * sin(freq * π * value + phase). A sine wave wrapped around the pixel values, so bright and dark regions periodically invert.freqsets how many inversion bands you get,phaseslides them. - log -
log(1+x)/log(2). Compresses the dynamic range, pulling details out of shadows. - gamma -
x^gamma. Classic power curve;gamma_valunder 1 brightens midtones, over 1 darkens them. - normal - passthrough. Leave that channel alone.
Because the modes default to solarize on all three channels but with slightly different phases (0.4 / 0.3 / 0.2), the waves land at different offsets per channel - that's the built-in rainbow banding at defaults. Set two channels to normal and you've got a single-channel tinting effect instead.
The inputs that matter
r_mode/g_mode/b_mode- the four modes above. This trio is the whole game.r_freq/g_freq/b_freq(0.1–10) - solarization frequency per channel. Low = smooth waves, high = rapid inversions.r_phase/g_phase/b_phase(0–6.28) - wave offset per channel. Full 6.28 rotates the cycle once.gamma_val(0.1–3) - only used by channels ingammamode.
Output is a single IMAGE, into Preview/Save or whatever's downstream.
Actually getting a good result
- Defaults are a statement, not a look. All-solarize is wild; dial a couple of channels to
normaland keep one solarize for a controlled effect. - Mix modes. Solarize red, log green, gamma blue is the README's suggestion and it delivers - it looks like a broken analog capture.
- Match phases to tame the rainbow. Set all three phases equal and the waves stack instead of splaying; you lose the glitch but gain a moody tone curve.
freqis sensitive. 0.5–2 is where you live; 10 looks like crushed static.
Installing it
It's in ComfyUI XWAVE Nodes. ComfyUI Manager → search "XWAVE" → install ComfyUI XWAVE Nodes → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/XWAVEart/comfyui-xwave-xlitch-nodes
cd comfyui-xwave-xlitch-nodes
pip install -r requirements.txt
Pillow, numpy, scipy - no models, no keys, pure CPU.
Gotchas
- No overall blend/opacity control. The output is the transformed image, period. There's no "mix with original" knob, so pair it with a Blend node if you want subtlety.
- Log mode can look washed out.
log(1+x)/log(2)compresses hard, so a channel in log mode often ends up milky. That's the aesthetic, not a bug. - Gamma applies globally to gamma-mode channels. All channels in
gammamode share onegamma_val- there's no per-channel gamma. Annoying if you wanted R at 0.8 and B at 1.6, but that's what the mode options are for.
The pack is new and quiet - no community lore to lean on, so trust your eyes and the waveform. If it looks broken in the interesting way, it's working.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| r_mode | COMBO | solarize | 4 options: solarize, log, gamma, normal |
| g_mode | COMBO | solarize | 4 options: solarize, log, gamma, normal |
| b_mode | COMBO | solarize | 4 options: solarize, log, gamma, normal |
| r_freq | FLOAT | 1.00.1–10 | — |
| g_freq | FLOAT | 1.00.1–10 | — |
| b_freq | FLOAT | 1.00.1–10 | — |
| r_phase | FLOAT | 0.400–6.28 | — |
| g_phase | FLOAT | 0.300–6.28 | — |
| b_phase | FLOAT | 0.200–6.28 | — |
| gamma_val | FLOAT | 0.500.1–3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |