ER Camera Defocus
N-blade defocus with highlight boost
- images
- images
Blur is not bokeh. ComfyUI's stock blur smears everything into a soft soup; a camera's defocus turns bright speculars into shapes - discs or polygon apertures with their own character - while detail just softens. If you've ever wanted a real shallow depth-of-field look on a rendered image, ER Camera Defocus is the node that gets you the second thing.
It comes from the ER VFX Nodepack by Héctor Gallego (ER Academy), and it's the compact sibling of the pack's heavier lens tools: no flares, no dirt, just defocus done properly. The one trick it nails that generic blurs miss is highlight boost - speculars bloom into visible bokeh shapes instead of washing out into gray. That's the entire difference between "out of focus" and "shot wide open on a real lens."
What you set
Like the other image/adjust nodes in this pack, the graph inputs are just images plus a params string - the actual controls live as widgets on the node's face, and the live preview updates as you drag them. The ones that matter:
- Aperture shape - a clean disc, or an N-blade polygon bokeh with blade rotation. Real anamorphic and cinema lenses have characteristic blade counts; you can match the busy hexagonal shapes of a closed-down lens or the smooth discs of a wide-open one.
- Defocus radius, expressed as a % of image width rather than a pixel count. This is a bigger deal than it sounds: it makes the look resolution-independent, so the same settings survive a 512px test render and a 4K final without re-tuning.
- Highlight boost - how much bright points bloom into proper bokeh shapes.
- Chromatic fringe on the bokeh edges, for the slight color separation real lenses show at the shape boundary.
Because the preview mirrors the same math as the render, you can dial the aperture character live and run once for the full-quality result through the images output.
The workflow shape
The honest use case is depth-of-field finishing: you don't defocus a whole image uniformly (real shallow-DOF shots have sharp subjects), so pair this with a mask - feed your image through a depth-based or blur-mask setup and drive how much of the frame gets the defocus. A common pattern is to keep the subject crisp by using ER Camera Defocus on a background composite pass, or to fake a macro lens look by boosting the speculars (lights, water, glitter) so they bloom into the hexagons that sell the effect.
Installing
Ships in the ER VFX Nodepack alongside ER Lens Effects, ER Lens Flare and ER Lens Camera Dirt (all under image/adjust). ComfyUI Manager → search "ER VFX Nodepack" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/esperandoelrender/ComfyUI-ER-VFX-Nodepack.git
Restart and search "ER". No extra Python dependencies or model downloads. If you previously installed the standalone er_lens_fx pack, delete that folder first - this pack replaces it and you'd get duplicate registrations.
One honest note: this is a screen-space effect on an already-rendered image - it blurs, it doesn't re-focus. If you want genuine depth-of-field that diffuses a busy background during generation, that's a diffusion-model job (ControlNet depth or an edit model), not this node. But for taking a finished image and giving it that aperture-shaped optical character, it's the right tool, and the resolution-independent radius means you won't be re-tuning it when you upscale.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| paramsopt | STRING | {} | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |