Atlas Defocus (depth) π«
Depth-of-field you set in metres, not by hand-painting masks
- image
- depth
- image
- coc_preview
- report
Most ComfyUI defocus "solutions" are a blur node with a hand-painted mask, which means the blur never matches the geometry and drifts the moment your camera moves. AtlasDefocus takes a different route: it blurs by the same shared metric depth map the geometry is built from, so focus becomes a real distance in metres and the falloff tracks the scene instead of a paint job.
It's the "Look" half of the Atlas/08 folder, and it's aimed at exactly the person this pack serves - the matte painter or environment artist who wants a believable cinematic defocus on a projected plate without doing a fake post blur.
How it works
Under the hood it's a thin-lens model. The tooltip gives the formula away: the circle of confusion is strength_px * |1 - focus/z| for each pixel at depth z. In plain terms, pixels exactly at the focus distance stay sharp, everything in front of or behind it blurs, and the blur grows with distance from the focal plane - scaled in pixels so you can read "8px" as a real CoC. That's the same math a renderer would use, which is the whole point.
Two implementation details are worth knowing because they affect your results. The blur is applied in accumulated bands with hat weights rather than stacked blur passes - the author's measured note says stacking hit 2.39 GB of memory alone at 4K/12 levels while accumulation is bit-identical at 365 MB. And because the depth map is the shared ATLAS_DEPTH_MAP (metric, in metres), the focus_distance_m knob means something physical. The report loudly flags if you feed it a relative depth map - the knob is metric and a relative map will misbehave.
Inputs and outputs that matter
Required: image (the plate) and depth (an ATLAS_DEPTH_MAP - the same one your geometry derivation used, which is the whole point of the pack's shared-depth design).
focus_distance_m- the focal plane in metres. The trap-turned-feature:0means auto, which focuses on the median scene depth. That's a great starting point; you then dial in the real number you want the eye drawn to.strength_px- the circle of confusion at the infinity limit, in pixels. 0β64, default 8. This is your overall blur amount.levels- the blur band count, 2β12, default 6. More levels = smoother falloff, more memory.
Outputs: image (the defocused plate), coc_preview (a view of the circle-of-confusion field, so you can see where the focus plane sits), and a report string that tells you what it auto-focused on and warns about relative depth.
Where people get tripped up
- A relative depth map. If you fed it a normalized "white is near" preview instead of the shared metric map, the report calls it out loudly. Fix: use the
AtlasDepthMapnode (the one that emitsATLAS_DEPTH_MAP), not the preview node. - Strength reads small at 4K. CoC is in pixels, so a value that looks gentle at 1080p can vanish on a big plate. Scale it with resolution.
- Foreground edge bleed. The tooltip warns this is expected at strong settings - it's the gather-style artifact, and it's far preferable to the alternative.
Install
In the atlas-camera pack:
cd <ComfyUI>/custom_nodes
git clone https://github.com/mikejamesvfx/atlas-camera.git
Restart ComfyUI (or use Manager, search "atlas-camera"). This node needs the [neural] tier because it consumes a metric ATLAS_DEPTH_MAP, which comes from depth models - see the pack's INSTALL.md: torch + GeoCalib + transformers, with GeoCalib installed from GitHub. The depth models auto-download from HuggingFace on first run. One heads-up from the install docs: the neural extras pin kornia<0.8.3 specifically so they don't break ComfyUI-LTXVideo's import - if you run LTXVideo and see an ImportError about kornia.geometry.transform.pyramid, that's this pack's known interaction, and pip install "kornia==0.8.2" repairs it.
It's a new pack with no community folklore yet, so treat the report string as your friend - it's unusually honest about what it did.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| depth | ATLAS_DEPTH_MAP | β | |
| focus_distance_mopt | FLOAT | 0.00β10000 | 0 = auto (median scene depth). |
| strength_pxopt | FLOAT | 8.00β64 | CoC at the infinity limit, in pixels. |
| levelsopt | INT | 62β12 | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| coc_preview | IMAGE | β |
| report | STRING | β |