Nodes/Chye ComfyUI Toolset/🌈 CYH Post Process | Chromatic Aberration
ComfyUI Node

🌈 CYH Post Process | Chromatic Aberration

Lens fringing, from subtle to full VHS hallucination

By chyerΒ·Created about a year agoΒ·Updated 6 months agoΒ· 1
🌈 CYH Post Process | Chromatic Aberration
  • image
  • IMAGE
β—„presetvintageβ–Ί
β—„intensity1.00β–Ί
β—„center_x0.50β–Ί
β—„center_y0.50β–Ί
β—„qualityfastβ–Ί
β—„k1_r0.150β–Ί
β—„k2_r0.000β–Ί
β—„k3_r0.000β–Ί
β—„k1_g0.000β–Ί
β—„k2_g0.000β–Ί
β—„k3_g0.000β–Ί
β—„k1_b-0.150β–Ί
β—„k2_b0.000β–Ί
β—„k3_b0.000β–Ί

Chromatic aberration is the colored fringing you see at the edges of a photo - red bleeding one way, cyan the other - the thing cheap lenses do and expensive ones are designed to eliminate. Which is exactly why it reads as "photographic" when you add a hint of it back. This node adds it with per-channel distortion and a few presets so you don't have to think too hard.

It's one of the four post-process nodes in the Chye ComfyUI Toolset, wired in the usual spot: KSampler β†’ VAE Decode β†’ CYH Post Process | Chromatic Aberration β†’ Save.

How it works

Real chromatic aberration isn't a color shift - it's each color channel being magnified slightly differently by the lens. This node does the same: it splits the image into R, G, B and applies a barrel distortion to each channel independently using a classic lens model:

r_distorted = r * (1 + k1*r^2 + k2*r^4 + k3*r^6)

Each channel has its own k1/k2/k3 coefficients (the k1_r, k2_r... inputs), which is how you get red edges fringing one way and blue the other. The remap is done with OpenCV, and the distortion maps are cached so re-running with the same parameters doesn't rebuild them.

The inputs that matter

Three inputs to actually touch, plus an IMAGE in:

  • preset - none, vintage, modern, extreme, custom. Vintage is the default and the workhorse: red +0.15, blue βˆ’0.15, which is the classic subtle lens look. Extreme goes to Β±0.25 with higher-order terms - that's the "glitchy" look, more art than lens.
  • intensity (0–2, default 1) - a master multiplier on all the coefficients. Turn it down for a barely-there hint; at 2.0 even vintage gets loud.
  • quality - fast (bilinear) or high (bicubic) interpolation for the remap. You won't see the difference on small images; high costs a bit more CPU.

The advanced k1/k2/k3 per-channel inputs are only relevant if you pick custom - with any other preset the coefficients are overwritten. center_x/center_y shift the distortion center (default 0.5/0.5), which is the classic trick for making fringing look off-center and organic rather than perfectly radial. Output is IMAGE.

Where it bites

The pack-wide limitation applies again: only the first image in a batch is processed (image_np[0]). And it's a CPU pass via OpenCV - fine for one image, slow for batches.

The other thing to keep in mind is taste: 1.0 on the vintage preset is already clearly visible on high-contrast edges. This is a "small dose" effect. If you're adding it to a photorealistic image and people can name the effect, you've used too much.

Install

ComfyUI Manager (search "Chye ComfyUI Toolset"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/chyer/Chye-ComfyUI-Toolset
cd Chye-ComfyUI-Toolset
pip install -r requirements.txt

Restart after. Needs opencv-python (in the pack's requirements; you likely already have it). Zip installs need .git/.cnr-id (Chye-ComfyUI-Toolset) per the README.

Verdict

Presets plus an intensity knob is the right design for an effect like this - most people want "a little vintage," not a coefficient sandbox. It's a solid, no-frills tool for a specific look. Just remember the batch caveat.

Categorypost_process

Inputs (15)

NameTypeDefaultDescription
imageIMAGEβ€”
presetCOMBOvintage5 options: none, vintage, modern, extreme, custom
intensityFLOAT1.000–2β€”
center_xoptFLOAT0.500–1β€”
center_yoptFLOAT0.500–1β€”
qualityoptCOMBOfast2 options: fast, high
k1_roptFLOAT0.150-1–1β€”
k2_roptFLOAT0.000-0.5–0.5β€”
k3_roptFLOAT0.000-0.2–0.2β€”
k1_goptFLOAT0.000-1–1β€”
k2_goptFLOAT0.000-0.5–0.5β€”
k3_goptFLOAT0.000-0.2–0.2β€”
k1_boptFLOAT-0.150-1–1β€”
k2_boptFLOAT0.000-0.5–0.5β€”
k3_boptFLOAT0.000-0.2–0.2β€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”