Nodes/ER VFX Nodepack/ER Lens Camera Dirt
ComfyUI Node

ER Lens Camera Dirt

Dust that shows up exactly where the light is

By esperandoelrender·Created 2 days ago·Updated 2 days ago· 0
ER Lens Camera Dirt
  • images
  • images
  • dirt_layer
  • dirt_layer_alpha
params{}

Every photographer knows the annoyance: a speck of dust on the front element that's invisible in flat light and glaringly obvious whenever a bright light is in frame. That's not a bug - it's a look. Real footage shot on real lenses carries exactly that dirt-revealed-by-highlights texture, and its absence is one of the tells of AI-generated images.

ER Lens Camera Dirt is a procedural dirty-lens generator that reproduces the behavior, from the ER VFX Nodepack by Héctor Gallego (ER Academy). The important word is behavior: it doesn't just sprinkle a static dust texture on your image. It places dust specks and smudges on a virtual front element and lets your image's own bright areas reveal them - so the dirt sits mostly invisible in shadows and blooms into view where the sun or a lamp is. That dynamic reveal is what makes it read as a real lens instead of an Instagram overlay.

The controls that matter

It's deterministic - same seed, same dirt - so you can dial in a pattern you like and lock it. On the node's face the useful ones are:

  • amount / size / density - how much dirt, how big, how many specks.
  • smudges / softness - the blotchy fingerprint-shaped smears vs. crisp dust points, and how hard-edged they are.
  • seed - roll a new pattern.
  • base vis. / highlights / threshold - the balance that makes this node special: how visible the dirt is on its own versus how strongly the blurred highlights reveal it, and from what brightness level the reveal kicks in.
  • tint hue / sat - dirt color (warm by default, which looks right on most lenses).

You can see the reveal math live: the blurred highlights of your image become the mask that turns the otherwise-faint dust on. Preview loads automatically from an executed Load Image, and the A|B toggle shows before/after without a run.

The layer outputs

Like the other "light" nodes in the pack, it gives you three outputs:

  • images - your image with the dirt composited in.
  • dirt_layer - just the dirt over pure black (RGB, no alpha): additive, for add/screen in a compositor, or as a clean input to an edit model.
  • dirt_layer_alpha - dirt with alpha (alpha = brightness), for normal-blend compositing. Not for edit models.

When to reach for it (and when not)

Reach for it when you want a shot to feel shot - a car commercial, a night street scene with sodium lamps flaring through a slightly grimy windshield, a portrait against window light. That's the honest use case from the KB's photorealism playbook: light behaving like it passed through something physical is worth more than another quality tag.

Skip it if your image has no bright highlights - the whole effect is the reveal, and without lights in frame you just get a dusty image. And as with flares, restraint is the difference between "grungy real lens" and "did you drop my camera in the sand": start with density low and base visibility lower.

Inputs & install

Graph input is images plus a params string the UI writes the controls into. It's part of the ER VFX Nodepack, which installs via ComfyUI Manager (search "ER VFX Nodepack") or:

cd ComfyUI/custom_nodes
git clone https://github.com/esperandoelrender/ComfyUI-ER-VFX-Nodepack.git

Restart and search "ER" (image/adjust). No extra dependencies or downloads. If you have the old standalone er_lens_fx pack installed, delete it first - this supersedes it.

Categoryimage/adjust

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
paramsoptSTRING{}

Outputs (3)

NameTypeDescription
imagesIMAGEThe image with the camera dirt revealed by its highlights.
dirt_layerIMAGEDirt only over pure black (RGB): additive, for Add/Screen or as a CLEAN edit-model input (no alpha).
dirt_layer_alphaIMAGEDirt only with alpha (RGBA, alpha = brightness): for normal-blend compositing. Do NOT feed this one to edit models.