π CYH Post Process | Chromatic Aberration
Lens fringing, from subtle to full VHS hallucination
- image
- IMAGE
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) orhigh(bicubic) interpolation for the remap. You won't see the difference on small images;highcosts 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.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| preset | COMBO | vintage | 5 options: none, vintage, modern, extreme, custom |
| intensity | FLOAT | 1.000β2 | β |
| center_xopt | FLOAT | 0.500β1 | β |
| center_yopt | FLOAT | 0.500β1 | β |
| qualityopt | COMBO | fast | 2 options: fast, high |
| k1_ropt | FLOAT | 0.150-1β1 | β |
| k2_ropt | FLOAT | 0.000-0.5β0.5 | β |
| k3_ropt | FLOAT | 0.000-0.2β0.2 | β |
| k1_gopt | FLOAT | 0.000-1β1 | β |
| k2_gopt | FLOAT | 0.000-0.5β0.5 | β |
| k3_gopt | FLOAT | 0.000-0.2β0.2 | β |
| k1_bopt | FLOAT | -0.150-1β1 | β |
| k2_bopt | FLOAT | 0.000-0.5β0.5 | β |
| k3_bopt | FLOAT | 0.000-0.2β0.2 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |