ComfyUI Node

Bokeh

Bokeh orbs from your actual highlights, no lens required

By criskb·Created 7 months ago·Updated 5 months ago· 0
Bokeh
  • image
  • mask
  • image
  • mask
  • bokeh_info
settings_json{"bokeh_strength":0.0,"bokeh_radius":10.0,"bokeh_threshold":0.72,"bokeh_softness":0.5,"bokeh_warmth":0.0,"mask_feather":12.0,"invert_mask":false}

Bokeh is what happens when a bright point of light is out of focus, and it's one of the fastest tells of a fake depth-of-field. x1Bokeh fakes it convincingly by turning the highlights already in your image into soft, warm orbs - same family as x1Bloom in MKRShift Nodes' VFX/Photo branch, but where bloom glows, bokeh separates the light into shapes.

Like the rest of this young pack (no impressions yet, no community footprint that I could find), it's deterministic and model-free: pure threshold + blur math on the CPU. For a pack this fresh, that's a feature - the behavior is predictable and easy to reason about.

How it works

Read the source and it's two steps. First, isolate a luminance-based highlight pass using bokeh_threshold with a soft rolloff (bokeh_softness). Then blur that pass with a Gaussian at bokeh_radius - and, like the pack's bloom, it actually blends two blurs, one tighter (~75%) and one wider (~25%), which is what gives the orbs their soft falloff instead of a hard-edged glow. bokeh_warmth tints the orbs warm or cool, matching how real lens elements warm the light they smear. The result is added back to the frame scaled by bokeh_strength.

Outputs are the standard MKRShift triple: image (processed frame), mask (matte of where the bokeh landed), and bokeh_info (settings log + mask coverage). An optional mask input restricts the effect to a region, with mask_feather and invert_mask on tap.

The inputs that matter

  • bokeh_strength - defaults to 0.0, same as bloom, so the node starts as a pass-through. That's the pattern across this pack's photo VFX: deliberate, but easy to misread as broken.
  • bokeh_threshold - decides which pixels count as light points. 0.72 default keeps it to speculars and practicals.
  • bokeh_radius - the size of the orbs. This one does most of the look.
  • bokeh_warmth - push it slightly positive for the classic "city lights at night" glow.

Installing

ComfyUI Manager → search MKRShift Nodes, or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart ComfyUI. No model downloads, no requirements.txt - it uses the numpy/PIL stack ComfyUI already ships. Video/audio exports in the same pack need ffmpeg, but this node doesn't.

Where people get burned

  • Off by default - if nothing changes, it's bokeh_strength still at 0.0.
  • The mask output is the bokeh matte, not your input mask. Easy to miswire, annoying to debug.
  • A malformed settings_json silently resets to defaults; the parser swallows the error. If the panel stops responding to your sliders, that's the smell.
  • CPU-only, per-frame cost. One frame or a hero shot, fine; a full video render, think twice.

The honest comparison: if you want the lens-like orbs, this does it with two blurs and a warmth tint. If you need actual depth-driven bokeh (far lights softer than near ones), that's a depth-map job - this is the fast stylized version, and it knows it.

CategoryMKRShift Nodes/VFX/Photo

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
settings_jsonSTRING{"bokeh_strength":0.0,"bokeh_radius":10.0,"bokeh_threshold":0.72,"bokeh_softness":0.5,"bokeh_warmth":0.0,"mask_feather":12.0,"invert_mask":false}
maskoptMASK

Outputs (3)

NameTypeDescription
imageIMAGE
maskMASK
bokeh_infoSTRING