ComfyUI Node

Lens FX

Vignette, chromatic aberration, barrel, sharpen — baked to a file

By criskb·Created 7 months ago·Updated 5 months ago· 0
Lens FX
  • video
  • video
  • output_path
  • summary
vignette0.25
chromatic_aberration_px2
barrel0.00
sharpen0.00
fallback_fps24.0
output_formatauto
filename_prefixMKR_lens_fx
subfolder
overwritefalse
filename_label

AI video comes out looking too clean. Real footage has vignetting, chromatic aberration at the edges, subtle barrel distortion, a little softness. MKRLensFX is the pack's quick pass that fakes being shot on a lens: it decodes a video, applies the four classic lens artifacts, and bakes the result to a file. If your video looks sterile and you want it to feel like a camera was actually there, this is the one-stop shop.

How it works

It takes any video input, decodes it to frames, and processes each frame the same way. The four effects, in order:

  • Barrel distortion (barrel, −1 to 1) - a positive value scales the frame down from center, faking the outward-curving look of a wide lens; negative pushes the other way. It's a resize-and-center approximation, not a true warp, but at the subtle values people use (±0.05) it reads as lens-y.
  • Chromatic aberration (chromatic_aberration_px, default 2) - shifts the red channel right and the blue channel left by a few pixels. It's a faked edge fringing: the red/blue channels are rolled, green stays. Real CA is radial and varies across the frame; this is a constant horizontal offset, which looks right on high-contrast edges at low pixel counts and looks like misregistration at high ones. Keep it small - 2–4 px is the sweet spot.
  • Vignette (vignette, 0 to 1, default 0.25) - darkens the frame toward the corners with a radial falloff. This is the single highest-impact "cinematic" lever on the node; 0.25 is already noticeable, 0.4 is moody.
  • Sharpen (sharpen, 0 to 3) - an unsharp mask on the result, which you'll want because the other effects soften things. 0.3–0.8 is a typical correction.

fallback_fps (default 24) supplies the frame rate if the source doesn't declare one. output_format handles auto, gif, webp, mp4, mov, webm, and the file controls (filename_prefix, subfolder, overwrite, filename_label) decide where it lands.

Outputs

  • video (MKR_VIDEO) - the processed video payload.
  • output_path - where the baked file was saved.
  • summary - the effect values used and any warnings.

Installing it

Part of the pack:

# ComfyUI Manager: search "MKRShift Nodes", install, restart.
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
# restart ComfyUI

One real system dependency: ffmpeg. The README calls it out for the video/audio nodes. GIF and WebP can be written without it (Pillow handles those), but mp4/mov/webm encode through ffmpeg - without it, the node warns and drops to gif. So install ffmpeg if you want actual video files out.

The honest read

This is a bake, not a live effect, and it's a fast and simple bake. The effects are deterministic PIL/numpy operations - no fancy warping, no motion-aware anything. Where it earns its keep is the dead-simple "make my generated clip look shot on a camera" pass, especially on faces and skin where AI video tends to look plasticky and over-sharp; a touch of vignette and a hair of CA does a lot of free plausibility.

Two caveats. First, the frame decode can be expensive on long clips - this processes every frame in Python, so a 30-second 1080p clip is going to take a while, and that's just the nature of a per-frame PIL pipeline. Second, treat barrel and chromatic_aberration_px as seasoning, not main courses: too much and it stops reading as "lens" and starts reading as "broken." For an actual third-party-lens simulation you'd reach for a dedicated optical node; for making your AI video stop looking synthetic in thirty seconds, this is the one.

CategoryMKRShift Nodes/Media/Video/FX

Inputs (11)

NameTypeDefaultDescription
video*
vignetteFLOAT0.250–1
chromatic_aberration_pxINT20–32
barrelFLOAT0.00-1–1
sharpenFLOAT0.000–3
fallback_fpsFLOAT24.01–240
output_formatCOMBOauto6 options: auto, gif, webp, mp4, mov, webm
filename_prefixSTRINGMKR_lens_fx
subfolderSTRING
overwriteBOOLEANfalse
filename_labeloptSTRING

Outputs (3)

NameTypeDescription
videoMKR_VIDEO
output_pathSTRING
summarySTRING