Image Lens Distortion
Barrel, pincushion, and chromatic aberration in one bend
- images
- images
If you want a render to look shot rather than rendered, a tiny bit of lens distortion is doing half the work for you. The name is a lie-free description: this node bows the frame out or pinches it in, and it can split the colour channels apart while it's at it - the two tells of a real wide lens. It's one of the handful of WAS Node Suite image-transform nodes you'll reach for when a clean generated image feels too "flat" or too perfect.
The core knob is k1, the main radial term. Negative values barrel the frame - the outward bow you get from a wide lens or an action camera - and positive values pincushion it, which pulls corners inward and is exactly what you apply to remove a barrel from footage that already has it. The tooltip spells out the feel: -0.15 is a gentle barrel, -0.5 is a strong fisheye bow, 0.15 takes a barrel back out. Default is -0.15, a good starting "this came off a camera" amount.
k2 is the fiddly one you only touch when k1 isn't enough. It's a second radial term that acts furthest from the centre, and small positive values pull the very corners back after a strong k1 - which is how a real lens profile is written, with several terms, not one. Think of k1 as the main bend and k2 as tidying the edges.
Then scale. This is where people get burned: a barrel distortion leaves empty corners, and if you don't do something about them you've got black triangles. scale is a zoom applied with the bend - 1.2 zooms in far enough to fill the frame back out, 0.8 pulls back so everything the frame originally held stays visible. Dial scale with edge in mind: when the bend does open up space, edge decides what fills it. hold the edge smears the outermost pixel out (looks like a cheap vignette), mirror folds the frame back on itself (decent for textures), and empty leaves it black, which is what you want if this is heading into a composite anyway.
The last knob, dispersion, is the chromatic aberration. It scales red and blue apart from each other, growing toward the corners, the way a cheap lens fringes at the edges. 0.004 is a faint fringe most people will read as "photo-like"; 0.02 is an obvious one you'll notice before you notice the bend. If you only want the colour split without the geometry moving, there's a separate Image Chromatic Aberration node in the suite - this node does both at once, the way a real lens does.
Inputs are just images plus those five widgets; the output is images, the frames at the size they went in at, each frame getting the same distortion. So you can drop it on a whole batch and every frame matches.
Install
This is one of the 457 nodes in WAS Node Suite v3. The easy route is ComfyUI Manager - search for "WAS Node Suite" (v3) and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
Then restart ComfyUI. It needs ComfyUI 0.14.0+ and Python 3.10+. Unlike the old v2 pack, this one installs nothing and downloads no models - the image transform nodes run on what ComfyUI already has, so there's no pip step and no model files to chase. If you read old threads about WAS breaking your Python environment, that was v2's pile of pinned dependencies; v3 ships with none of it.
Common issues
- Black corners after applying a barrel. Raise
scaleuntil the bend is zoomed in past the empty space. - Looks like a pincushion, not a lens. You want negative
k1for the outward wide-lens bow. Positive goes the other way. - A fringe shows up where you didn't ask for one.
dispersiondefaults to 0, so if you're seeing colour fringing it came from elsewhere - this node only splits channels when you turn it up.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The frames to bend. Each one gets the same distortion and comes back at the size it went in at. | |
| k1 | FLOAT | -0.150-1–1 | The main radial term. 0.0 = straight, -0.15 = a gentle barrel, -0.5 = a strong fisheye bow, 0.15 = a pincushion that takes a barrel back out. |
| k2 | FLOAT | 0.000-1–1 | A second radial term acting furthest from the centre. 0.0 = none, 0.05 = pulls the very corners back after a strong k1, which is how a real lens profile is written. |
| scale | FLOAT | 1.000.25–4 | Zoom applied with the bend. 1.0 = none, so a barrel leaves empty corners; 1.2 = zoomed in far enough to fill them; 0.8 = pulled back to keep everything the frame held. |
| dispersion | FLOAT | 0.000-0.1–0.1 | How far red and blue are scaled apart, growing towards the corners. 0.0 = none, 0.004 = a faint colour fringe at the edges, 0.02 = an obvious one. |
| edge | COMBO | What fills the space the bend opens up. `hold the edge` smears the outermost pixel out; `mirror` folds the frame back on itself; `empty` leaves it black. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | The frames with the distortion applied. |