Nodes/ComfyUI LC123 Nodes/LC Depth FX 🌫️
ComfyUI Node

LC Depth FX 🌫️

Fixing the fake-bokeh problem with an actual depth map

By lonecatone23·Created 3 months ago·Updated a day ago· 46
LC Depth FX 🌫️
  • image
  • depth_map
  • focus_mask
  • image
◄lookNatural►
◄haze0.04►
◄haze_distance0.50►
◄haze_warmth0.00►
◄light_wrap0.10►
◄dof_blur0.10►
◄focus_range0.15►
◄bokeh0.20►
◄auto_focustrue►
◄focus_depth0.20►
◄depth_directionAuto►

Ask anyone why an AI image reads as AI and background blur is on the list. Not because AI blur is ugly - because it isn't lens blur: generated bokeh is too uniform or falls off wrong, while real lenses have a personality (circles, cat's-eye, swirly highlights) the model only approximates. LC Depth FX 🌫️ is the blunt fix. Give it your image plus a depth map and it applies the three things a camera does to a scene, in the order light actually travels - haze in the air, background light wrapping your subject's edges, then depth of field with real disc-shaped bokeh. It's deterministic: instant, free, and it doesn't touch your seed.

How it works

First, the depth map. Depth estimation gives you a grayscale image where brightness stands for distance - the convention is white = near, black = far, but relative-depth models don't promise which way any given node hands it over, and an inverted map is a classic one-click mistake. Depth Anything v2 Large is still the default preprocessor in mid-2026: Kijai's standalone pack, Fannovel16's preprocessor suite, or the author's own LC Vision nodes. LC Depth FX takes the map as an IMAGE and detects the direction itself, so no Invert node.

Inside, it works in linear light and normalises the map with its own 1st and 99th percentiles, so it's a relative map measured against that shot's range - a subject standing close to a wall still gets separation. "Auto" direction assumes a normal photograph: ground at the bottom and subject in the middle are nearer than sky at the top and the edges. Then three passes:

  • haze fades the far distance toward a colour sampled from the image's own far field (a median-weighted mix, not the brightest pixel), so a dark room stays dark instead of glowing grey. The in-focus subject is excluded.
  • light_wrap screens blurred background colour over a band at the subject's edges, width set by the slider. This is the one that kills the "pasted cut-out" look.
  • dof_blur blurs in five disc-shaped (lens-style) layers by distance from focus, keeping background and foreground apart: background levels only accept pixels genuinely that blurry, so the sharp subject never bleeds into them, and foreground blur spreads outward over what's behind it. bokeh then finds small, round, isolated bright points and blooms each into a disc. A handful of street lights blooms; a glittering skyline stays faint.

The controls that matter

Required inputs are image and depth_map; ten settings and one optional mask follow, with deliberately gentle defaults (haze 0.15, dof_blur 0.1) so wiring the node doesn't wreck an image.

  • look - Natural through B&W, plus Custom. Picking a name writes the whole slider set for you (Portrait pushes dof_blur to 0.35 with a tight focus_range; Landscape turns depth of field off and cranks haze to 0.6). Touch any slider and it flips to Custom, and Custom is never overwritten by look changes.
  • dof_blur and focus_range - how blurry the out-of-focus gets, and how much depth stays sharp. The tooltip's own translation: low focus_range is f/1.4, high is f/8.
  • auto_focus / focus_depth - auto finds the subject as the near part of the middle of the frame and focuses on the top of it (the head), so a body turned toward camera or a side railing doesn't steal focus. Off, and focus_depth is a manual 0-to-1 dial, 0 nearest.
  • focus_mask (optional) - a face or person mask. It beats auto-focus, and it's the one to use for portraits.
  • depth_direction - Auto / Bright = near / Bright = far.

Output is a single image. As an output node it gives you an on-node before/after wipe to hover over, and wires onward to Save Image. In the pack's documented light path it sits early: after sharpening, before colour, bloom and grain.

Installing it

No pip step anywhere in this pack - it runs on what ComfyUI already has.

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes.git

Manager users: search ComfyUI LC123 Nodes, install, restart. You'll see [LC123] loading from … and a total-node count in the console. The depth model itself is a separate install - the pack ships no models.

Common issues

Auto picked the wrong direction. The heuristic assumes sky-up, ground-down. A top-down flat-lay, a portrait that crops out the ground, or an ambiguous scene can flip it, and the symptom is subtle: haze on the foreground, focus on the background. Set depth_direction to Bright = near or Bright = far.

The sliders are relative to resolution. dof_blur scales against the frame's short side, so 0.35 at 1024px is a heavy blur and the same number at 4K is a light one.

Nothing happens at 0. With haze, light_wrap, dof_blur and bokeh all at zero the node returns the original untouched. Handy for A/B, confusing when you forget you switched presets.

Previews are not free. It keeps up to two preview bitmaps per run; on heavy graphs, half-resolution or hidden FX previews live under Settings → LC123 → Performance. Hard-refresh the browser after a pack update - the look dropdown and the wipe are frontend JavaScript.

CategoryLC123/image

Inputs (14)

NameTypeDefaultDescription
imageIMAGE—
depth_mapIMAGEDepth map of the same image (LC Depth Anything). Either direction works.
lookCOMBONaturalPick the same look on LC Depth FX, Bloom, Lens Profile, Vignette, Film Stock and Film Grain and they match. Custom = your own sliders. Moving a slider switches to Custom.
hazeFLOAT0.040–1How thick the air is. Distant areas fade toward the haze color. 0 = off. 0.03 - 0.08 for people, more only for wide landscapes.
haze_distanceFLOAT0.500–0.95Where the haze starts, measured across the background: 0 = right behind the subject, higher = only its farthest part.
haze_warmthFLOAT0.00-1–1The haze color comes from the image's own distance. This nudges it cooler (-) or warmer (+).
light_wrapFLOAT0.100–1Bright background light bleeding over the subject's edges. Kills the cut-out sticker look. 0 = off.
dof_blurFLOAT0.100–1Depth of field. How blurry things get away from the focus. 0 = off. Scales with resolution.
focus_rangeFLOAT0.150–0.8How much depth stays sharp around the focus. Low = razor thin (like f/1.4), high = deep (like f/8).
bokehFLOAT0.200–1Bright out-of-focus lights turn into glowing discs. 0 = plain blur.
auto_focusBOOLEANtrueFocus on the main subject in the middle of the frame. Off = use focus_depth.
focus_depthFLOAT0.200–1Used when auto_focus is off. 0 = nearest, 1 = farthest.
depth_directionCOMBOAutoLeave on Auto unless the effects land on the wrong part of the image.
focus_maskoptMASKOptional. Focus lands on whatever this mask covers (a face or person mask from LC MaskMaker). Beats auto_focus when connected.

Outputs (1)

NameTypeDescription
imageIMAGE—