Chromatic Aberration
Add (or remove) the fringing that says 'real lens'
- image
- mask
- image
Look at the edge of a high-contrast object through a cheap lens and you'll see it: red and cyan fringing where the glass failed to focus all wavelengths on the same plane. That's chromatic aberration, and it's one of those flaws that instantly reads as "photographed with real glass." AI images tend to have none of it, which is part of why they look synthetic. This node adds it - or removes it, if your source already has it.
Chromatic Aberration is part of ComfyUI-Darkroom's Lens & Optics group, alongside Lens Distortion, Vignette, and the all-in-one Lens Profile node. If you just want the film look without thinking about coefficients, this is the one to reach for.
How it works
It's a lateral (transverse) CA simulation: red and blue channels get shifted radially relative to green, with the shift growing toward the image edges. Chromatic aberration is a per-channel magnification difference, so the effect is naturally strongest at the frame border - which is exactly where real fringing lives. Pick a real lens from the dropdown and you get its measured per-channel behavior; pick "Custom" and drive the red and blue shifts yourself. The strength slider is an intensity multiplier on top, so a lens profile at strength 0.3 gives you a whisper of fringing, 1.0 gives the honest amount, and beyond that you're heading into "deliberately broken" territory.
The inputs that matter
- lens - 103 choices: "Custom" plus 102 real lens profiles (Canon EF primes, zooms, and more). The profiles are measured, not guessed - the same data the pack's Lens Distortion and Lens Profile nodes use.
- strength - overall intensity multiplier, 0–3.
- shift_r - red channel shift in pixels at the edge. Negative = inward. Default −1.
- shift_b - blue channel shift at the edge. Positive = outward. Default +1.
The defaults are telling: red in, blue out - that's the classic real-lens arrangement. Output is image, same shape in and out.
Install and gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/jeremieLouvaert/ComfyUI-Darkroom
pip install -r ComfyUI-Darkroom/requirements.txt
Or search "Darkroom" in ComfyUI Manager and restart. It's under AKURATE/Darkroom/Lens.
Two things to know. First, if your goal is correction - killing fringing that's already in the image - the node works by shifting channels back, so a lens profile (or the right sign on Custom) cancels the aberration rather than adding it. Second, CA is a spatial effect: it lives outside the LUT bake chain. Don't put it between LUT Bake Inject and Extract, or it'll corrupt the lattice - apply it after, on the graded photo.
The fringing-too-far trap is real. A touch of CA sells the lens; cranking strength makes every highlight look like a 3D render glitch. Start at 0.2–0.5 on a real profile and ask whether the image reads more "photographed." It usually does.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| lens | COMBO | Custom | Select a real lens or 'Custom' for manual CA control |
| strength | FLOAT | 1.00–3 | Overall CA intensity multiplier |
| shift_ropt | FLOAT | -1.0-5–5 | Red channel shift in pixels at image edge. Negative = inward |
| shift_bopt | FLOAT | 1.0-5–5 | Blue channel shift in pixels at image edge. Positive = outward |
| maskopt | MASK | Where the fringing applies, 0 to 1. One mask drives all channels together so the red/blue ratio stays lens-true. A few pixels of feather is enough at typical shifts. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |