Nodes/Photography Nodes/Lens Distortion
ComfyUI Node

Lens Distortion

Bend the frame like a real wide-angle lens

By TrophiHunter·Created about a year ago·Updated about a year ago· 5
Lens Distortion
  • image
  • IMAGE
strength0.020
methodbarrel
croptrue

Straight edges are a dead giveaway of rendered geometry - real wide-angle shots bow outward at the frame edges. This node applies classic barrel and pincushion distortion, the two ways a lens bends a frame: barrel pushes the image outward (edges bow out, wide-angle feel) and pincushion pulls it inward (telephoto compression, edges bow in). It's a tiny node with three inputs, and it's the kind of optical grounding that makes an otherwise clean render feel like it came out of a camera body.

How it works

It remaps the image through a radial distortion model - for each pixel, the distance from the frame center is recomputed with a distortion term, and the image is resampled onto that warped grid. strength (default 0.02, max 1) controls how much bow; even small values are visibly lens-like, which is why the default is low - barrel distortion at strength 0.02 is already a noticeable wide-angle character. The method switch picks the direction: barrel or pincushion.

crop (default on) is the honest knob. Distortion pushes pixels beyond the frame, leaving empty crescents at the corners; cropping trims them so you get the bent look without the black borders. Turn it off if you want the raw warp to inspect or composite the edges yourself.

Inputs that matter

  • method - barrel (outward bow, wide-angle) vs. pincushion (inward, telephoto)
  • strength - the amount of bend; the author's default of 0.02 is telling you to go subtle
  • crop - trim the empty corners after warping

One IMAGE in, one IMAGE out.

Install

Ships in Photography Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/TrophiHunter/ComfyUI_Photography_Nodes

Restart, find it under TrophiHunter/Photography (ComfyUI Manager: "Photography Nodes"). Pure torch/PIL, no requirements.

Where people get burned

Two things. First, forgetting crop means the result has weird unpainted corners - with it off you're looking at a raw warp, and that's a debugging view, not a final image. Second, going heavy on strength turns the frame into a fisheye porthole; if that's the goal, great, but for "this was shot on a lens" keep it under ~0.1. The author pairs Lens Distortion with Chromatic Aberration right after it in the example workflow - geometry first, then the color fringing that a real lens would also show - and that pairing is the move if you want the optical degradation to hang together.

CategoryTrophiHunter/Photography

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
strengthFLOAT0.0200–1
methodCOMBObarrel2 options: barrel, pincushion
cropBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE