Nodes/Realistic Bokeh and Dreamy Look/Easy Bokeh (plug & play)
ComfyUI Node

Easy Bokeh (plug & play)

Real background bokeh on an image you already like

By marcsole96·Created 2 days ago·Updated 2 days ago· 0
Easy Bokeh (plug & play)
  • image
  • depth_map
  • focus_mask
  • image
  • focus_preview
bokeh_shapedisk
focus_x0.50
focus_y0.50
blur_amount0.50
keep_in_focus0.35
subject_is_bright_in_depthtrue
keep_foreground_sharpfalse
focus_falloff1.00
mask_portrait_modefalse
mask_bg_blur_floor0.45
bloomtrue
bloom_strength0.50
bloom_threshold0.60
bloom_only_in_blurtrue
chromatic_aberrationfalse
chromatic_strength0.50
catseyefalse
catseye_strength0.50
qualitybalanced

Here's the situation: you generated a portrait you love, but the model gave you that default look where everything is sharp and the background might as well be a backdrop. Or worse, it faked a shallow depth of field and the bokeh is uniform mush - the community's own photorealism tell, since real lenses produce shaped, graded blur and models mostly don't - wrong, uniform bokeh falloff is literally on the shortlist of what gives AI photos away. Easy Bokeh is the plug-and-play fix from ComfyUI-RealisticBokeh: keep the image, blur the background for real, with actual aperture shapes.

No lens math, no unit conversions. You give it the image plus a depth map, pick roughly where your subject is, and dial two sliders. That's the entire pitch, and it mostly delivers.

How it works

Depth-driven DOF needs to know what's near and what's far, so it takes a depth_map - grab one from a Depth Anything or MiDaS node (or any ControlNet depth preprocessor) run on the same image; the pack's README explicitly suggests Depth Anything V2. Inside, it uses the "artistic" blur model: each pixel's blur comes from how far its depth sits from the focus plane, normalised across the whole image so it always spans the full range no matter how your depth map is scaled. That normalisation is why focus "just works" here where it fights you in other tools - the blur gradient is computed from depth distance, not from trusting the map's absolute values.

It blurs in layers (roughly depth-sliced), composites foreground over the sharp subject so you get real occlusion edges, and runs the whole thing on the GPU.

The inputs that actually matter

Required: image, depth_map, bokeh_shape, focus_x/focus_y, blur_amount, keep_in_focus, and subject_is_bright_in_depth.

  • focus_x / focus_y (0–1, 0.5/0.5 = centre) - put this on the subject. Think "tap to focus".
  • blur_amount - how strong the background blur is.
  • keep_in_focus - how much depth around the subject stays sharp. This is the slider you'll live on: raise it until the green in the focus_preview output covers your whole subject.
  • subject_is_bright_in_depth - on by default. Leave it on if your subject is bright/white in the depth map (typical for Depth Anything / MiDaS); flip it if the focus preview lands on the background.

Wire the second output, focus_preview, into a Preview node. It's your whole workflow: set focus, watch the green, raise keep_in_focus until the subject is covered. If the green never covers a subject that spans a wide depth range - legs much closer than the face, or a subject sharing depth with the wall behind it - depth alone can't save you. Connect a focus_mask (SAM or rembg will do) and set mask_portrait_mode on to force the masked subject perfectly sharp while everything else blurs, with mask_bg_blur_floor as the minimum background blur.

Beyond that: bokeh_shape picks disk, polygon, anamorphic, star, heart or ring; keep_foreground_sharp switches from a focus band to a one-sided depth cap (turn it on when your subject is the closest thing and the background is behind it - e.g. a cat in the foreground, landscape behind); and there are optional toggles for bloom (on by default - bright out-of-focus highlights become proper glowing bokeh balls; bloom_only_in_blur keeps the sharp subject from glowing), chromatic_aberration and catseye. Worth knowing on the latter: cat's-eye only reshapes large out-of-focus highlights near the frame edges - that's real optical vignetting, so don't expect it on centre bokeh.

Install

Manager search for ComfyUI-RealisticBokeh, or:

cd ComfyUI/custom_nodes
git clone https://github.com/marcsole96/ComfyUI-RealisticBokeh.git

Restart ComfyUI. Zero extra runtime dependencies - everything runs on the torch/numpy ComfyUI already ships, so the depth-estimation node you add is the only real install weight.

Where it fits

It's a post-processing pass, so it works on anything you can produce a depth map for - generated stills, and honestly real photos too. The trap is depth quality: a mushy depth map gives you blur with no edge respect, so if the subject's outline blurs into the background, suspect the depth map before the node. And if you find yourself fighting the two sliders, the advanced sibling (Realistic Bokeh / Depth of Field) trades the simplicity for real f-stop control - but for "subject sharp, background bokeh" this is the one you'll actually use every day.

Categoryimage/postprocessing

Inputs (22)

NameTypeDefaultDescription
imageIMAGE
depth_mapIMAGE
bokeh_shapeCOMBOdisk6 options: disk, polygon, anamorphic, star, heart, ring
focus_xFLOAT0.500–1
focus_yFLOAT0.500–1
blur_amountFLOAT0.500–1
keep_in_focusFLOAT0.350–1
subject_is_bright_in_depthBOOLEANtrue
keep_foreground_sharpoptBOOLEANfalse
focus_falloffoptFLOAT1.000.1–4
focus_maskoptMASK
mask_portrait_modeoptBOOLEANfalse
mask_bg_blur_flooroptFLOAT0.450–1
bloomoptBOOLEANtrue
bloom_strengthoptFLOAT0.500–1
bloom_thresholdoptFLOAT0.600–1
bloom_only_in_bluroptBOOLEANtrue
chromatic_aberrationoptBOOLEANfalse
chromatic_strengthoptFLOAT0.500–1
catseyeoptBOOLEANfalse
catseye_strengthoptFLOAT0.500–1
qualityoptCOMBObalanced3 options: fast, balanced, high

Outputs (2)

NameTypeDescription
imageIMAGE
focus_previewIMAGE