😺NKD Field Blur
Fake a shallow depth of field with pins, no depth map required
- image
- mask
- IMAGE
Getting a shallow depth of field out of a diffusion image used to mean a depth map, a ControlNet, or a lot of hand-painted masks. 😺NKD Field Blur skips all three: drop pins on the image, set how much blur each one wants, and everywhere in between is interpolated smoothly. One pin blurs the whole frame evenly. Two pins give you a gradient - which is the usual way to push a background back while keeping a subject sharp. It's a variable gaussian, not bokeh (no iris shape, no highlight bloom), and it's honest about that.
Where this earns its keep: the "AI look" has a lot to do with everything being in focus at once, and community post-processing wisdom is that adding subtle blur + grain is the cheapest realism you can buy after the fact. This is the blur half of that move, done by hand, visually.
How it works
The editor lives in the node and previews the real result - the geometry goes to the backend and comes back rendered by the same code the graph runs, so what you tune is what you get. Key moves:
- Drag the ring around a pin to set its blur; pins are relative, and
max_blursets what a fully-turned-up pin means in pixels. - Ctrl-drag a pin to widen its reach (shown as a dashed ellipse) so one sharp pin can hold a whole subject in focus instead of being dragged blurry by the pins around it.
falloffis how tightly each pin holds its own area - low values blend every pin across the whole frame for a soft gradient, high values keep the change close to the pins.- V cycles to the blur field as a grey map, which is the view that actually shows you where the transition falls.
- The optional
maskinput keeps the original image wherever the mask is white, so you can protect a subject without a second composite node.
The inputs that matter
pins is the JSON the editor writes - you won't type it. The two you'll actually set are max_blur (default 48; how many pixels a maxed pin means) and falloff (default 2). That's the whole tuning surface, plus the editor. Output is a single IMAGE.
One real warning
Blur destroys grain, and a plastic-smooth area butted against a grainy sharp one is exactly what makes a fake depth of field read as fake. The author's own advice is the right one: put grain back with 😺NKD Film Grain after this node, masked so it only lands where you blurred. And because the node is an output node that previews, it terminates its branch - keep that in mind if you're feeding the result onward.
Install and gotchas
Install via ComfyUI Manager (search ComfyUI-NKD-Basic-Tools) or:
cd ComfyUI/custom_nodes
git clone https://github.com/Nekodificador/ComfyUI-NKD-Basic-Tools
Restart after. Pack dependencies are onnxruntime and huggingface_hub; neither is needed here, so this one loads on a bare install. The node has to have run once before there's a frame to preview - that trips people up. And don't expect bokeh circles or anamorphic streaks; for those you're in a different tool entirely.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| pins | STRING | {"v":1,"pins":[]} | — |
| max_blur | INT | 480–512 | How many pixels of blur a pin turned all the way up means. Every pin's strength is a fraction of this. |
| falloff | FLOAT | 2.00.5–8 | How tightly each pin holds its own area. Low values blend every pin across the whole frame for a soft gradient; high values keep the change close to the pins, which is what stops a sharp pin on a subject from being dragged blurry by the ones around it. |
| maskopt | MASK | Optional. Where the mask is white the original image is kept, so you can protect a subject from the blur without a second composite node. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |