ComfyUI Node

MX_ChromaticAberration

Fake lens fringing for a glitch look, no Photoshop required

By Intersection98·Created 2 years ago·Updated 2 years ago· 13
MX_ChromaticAberration
  • image
  • IMAGE
red_shift0
red_direction
green_shift0
green_direction
blue_shift0
blue_direction

ChromaticAberration is the glitch-effect node in the MX pack: it slides the red, green, and blue channels apart so edges get that magenta/cyan fringing you see on cheap lenses - or in every vaporwave edit ever made. Real lenses produce this at the edges of the frame; this node lets you add it everywhere, on purpose, per channel.

It's part of Intersection98/ComfyUI-MX-post-processing-nodes, and it's a great post-VAE-decode effect for pushing a render toward "shot on a cheap camcorder" or straight into intentional glitch territory. The photorealism crowd talks about lens artifacts as part of what makes AI images read as captured; this is the cheap, controllable version of that idea.

How it works

The node takes your image and rolls each color channel by a pixel offset using torch.roll - content that shifts off one edge wraps around to the other, which is a classic cheap aberration trick. Each channel has its own shift amount and its own direction (horizontal or vertical). One implementation detail worth knowing: positive vertical shifts are internally negated, so the "positive = down" convention is inverted on the vertical axis - the node authors did that so the sign behaves consistently with horizontal. You can set all three channels with independent offsets, which is where the interesting looks come from.

The inputs that matter

  • image - your IMAGE tensor.
  • red_shift, green_shift, blue_shift - each -20 to 20 pixels, default 0. The classic setup is red one way, blue the other (e.g. +3 and -3), green left alone at 0 - that's the standard RGB-split glitch. Larger offsets like 8–15 get aggressive.
  • red_direction, green_direction, blue_direction - horizontal or vertical, per channel. Mixing directions (red horizontal, blue vertical) gives a more chaotic, "broken signal" look.

Output is a single IMAGE at the original resolution.

Install

Standard MX pack install. ComfyUI Manager (search MX or ComfyUI-MX-post-processing-nodes), or:

cd ComfyUI/custom_nodes
git clone https://github.com/Intersection98/ComfyUI_MX_post_processing-nodes
cd ComfyUI_MX_post_processing-nodes
pip install -r requirements.txt

Restart ComfyUI; it lives under postprocessing/Effects. No model downloads, and this node in particular is pure torch - it doesn't even need the pack's OpenCV dependency to run.

Where people get burned

The default state (all shifts at 0) is a no-op passthrough, which is fine, but the "wrap around" behavior is the real gotcha: because torch.roll wraps, hard offsets can pull a ghost of the opposite edge of the image into frame - at high shifts you'll see the image wrap on itself. If that ruins the look, keep shifts modest (≤5) or crop slightly after the effect. Second, don't expect a faithful simulation of real lens fringing: genuine chromatic aberration is strongest at frame edges and absent in the middle. This node applies the same offset everywhere. For realism that's wrong; for glitch art it's exactly the blunt instrument you want. If you're chasing the subtle edge-only look, the photorealism playbook would tell you to leave this effect out or keep it extremely subtle - a ±1–2 pixel shift reads as "imperfect lens," everything beyond that reads as "glitch on purpose."

Categorypostprocessing/Effects

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
red_shiftINT0-20–20
red_directionCOMBO2 options: horizontal, vertical
green_shiftINT0-20–20
green_directionCOMBO2 options: horizontal, vertical
blue_shiftINT0-20–20
blue_directionCOMBO2 options: horizontal, vertical

Outputs (1)

NameTypeDescription
IMAGEIMAGE