Lens Profile
102 real lenses in one dropdown — add their character or correct it away
- image
- mask
- image
Lenses have personalities. A 50mm f/1.2 wide open has dreamy, soft-edged bokeh and heavy vignetting; a 135mm f/2 is sharp with gentle distortion; a cheap vintage zoom has corner softness and chromatic aberration you can see from across the room. Lens Profile is the Darkroom pack's attempt to bottle all of that: a dropdown of 102 real lens models - Canon, Nikon, Sony, Zeiss, Leica, vintage - and a switch to either simulate a lens's optical flaws or correct them away.
How it works
Each lens profile encodes three optical characteristics, measured from real glass (the author's README says the profiles come from real optical characteristics, not invented numbers):
- Distortion - barrel or pincushion geometry, modeled with the standard Brown-Conrady coefficients.
- Chromatic aberration - lateral CA, the red/blue fringing that shows up toward the edges, applied per-channel.
- Vignetting - the light falloff toward the corners.
The mode dropdown flips the whole thing:
- Add Aberrations - simulates the lens's flaws. Great for giving a too-clean AI render the optical character of a real lens.
- Correct Aberrations - inverts the profile and removes the flaws. This is the "fix my photo that was shot on this lens" mode, the same idea as Lightroom's lens corrections.
The strength slider goes 0–2, which is the interesting bit - the tooltip says "overall profile strength. 0.5 = half effect." Most Darkroom nodes cap strength at 1.0; going to 2.0 lets you overshoot, which is genuinely useful for both directions: crank it to exaggerate a lens look on purpose, or push correction past 100% to stomp out stubborn aberrations.
The input that matters
lens- the dropdown with 102 entries, named like "Canon / Canon EF 135mm f/2L USM" or "Canon / Canon RF 28-70mm f/2L USM". The sample list shows the breadth: primes, zooms, L-series, RF glass.mode- Add or Correct.strength- 0–2 as above.
Output is a single image.
When you'd reach for it
Two genuinely different use cases, and both are good:
- Correcting real photos. If you shoot on a lens in the list, Correct mode is a one-dropdown Lightroom-style fix for distortion, fringing, and vignetting in one node.
- Giving AI output optical honesty. A generated image that's too geometrically perfect reads as "rendered." Adding a real lens's vignette and CA - subtly, at strength 0.3–0.5 - grounds it. This is the same instinct as the photorealism crowd adding film grain: the imperfections are what sell the photograph.
The pack also has standalone nodes for each effect (Lens Distortion, Chromatic Aberration, Vignette) if you want to control them separately - Lens Profile is the "all three at once, from a real lens" option.
One honest caveat: it's a spatial transform, so it's on the README's not-in-LUT-bake-chain list. Apply it to the photo after LUT extraction. And like any single-lens profile, it's an approximation - the profile can't know your aperture, focus distance, or focal length on a zoom, so "the lens character" is a generalization. It's close enough to be convincing, not close enough to be a lab measurement.
Installing it
Part of the full ComfyUI-Darkroom pack:
cd ComfyUI/custom_nodes
git clone https://github.com/jeremieLouvaert/ComfyUI-Darkroom.git
pip install -r ComfyUI-Darkroom/requirements.txt
Or search "Darkroom" in ComfyUI Manager. Needs scipy, opensimplex, rawpy, exifread, Pillow. Restart and it's under AKURATE/Darkroom/Lens. No GPU, no model downloads, no API - the 102 profiles ship in the repo.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| lens | COMBO | Canon / Canon EF 135mm f/2L USM | Select a lens to simulate or correct its optical characteristics |
| mode | COMBO | Add Aberrations | 'Add' simulates lens flaws. 'Correct' removes them (inverts the profile) |
| strengthopt | FLOAT | 1.00–2 | Overall profile strength. 0.5 = half effect |
| maskopt | MASK | Where the lens character applies, 0 to 1, vignette included. Mask 0 leaves pixels untouched. In Correct mode, corrections that clip to white are unaffected by the mask where they clip. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |