ComfyUI Node

BM3D Deblurring

Block-matching filtering pulling double duty as a deblur tool

By EricRollei·Created 9 months ago·Updated 8 months ago· 9
BM3D Deblurring
  • image
  • deblurred_image
  • processing_info
profilehigh
psf_typegaussian
psf_size15
blur_sigma2.0
noise_sigma0.000
auto_estimatetrue

BM3D is old-school, pre-deep-learning image processing - from 2007 - and it's still one of the strongest denoisers around precisely because it doesn't need training data. This node applies it to deblurring specifically: you give it a PSF model of the blur (Gaussian or motion, same idea as RichardsonLucyGPUNode), and it combines that with BM3D's own denoising regularization to pull a sharper, cleaner image out the other side.

How it works

BM3D's core idea is collaborative filtering: it finds patches across the image that look similar to each other, stacks them into a 3D group, and filters that whole group together in a transform domain instead of filtering each patch alone. Similar patches reinforce each other's real structure while their independent noise averages out - which is why it beats most simple filters at preserving texture while still killing noise. For deblurring specifically, this node pairs that machinery with a PSF-based deconvolution step, then leans on BM3D's collaborative filtering to control the noise that deconvolution tends to amplify (the same problem RichardsonLucyGPUNode fights with its regularization parameter). The profile options here are the actual named parameter presets from the reference BM3D implementation - np (normal profile, balanced), refilter (a second, more careful pass), vn/vn_old (tuned for very noisy input), high (maximum quality, slower), deb (a debug/development profile) - not this pack's own invention.

The inputs and outputs that matter

  • image - required.
  • profile (default high) - the BM3D quality/speed preset. high is already the quality-leaning default here, not the fast one.
  • psf_type - gaussian or motion, matching the actual blur you're trying to undo.
  • psf_size (3–51, odd numbers only, default 15) - the kernel size for the blur model.
  • blur_sigma (0.1–10, default 2) - blur strength.
  • noise_sigma (optional, 0–1, default 0, meaning auto-estimate) - set this manually if you know your actual noise level; leave at 0 to let auto_estimate handle it.
  • auto_estimate (optional, default true) - automatically estimates the noise level rather than requiring you to guess noise_sigma.
  • Outputs: deblurred_image and processing_info.

How to install it

Search Eric_Image_Processing_Nodes in ComfyUI Manager, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Eric_Image_Processing_Nodes
cd Eric_Image_Processing_Nodes
pip install -r requirements.txt

Restart ComfyUI. BM3D is classical signal processing, not a neural network, so there's no checkpoint to download. Python BM3D implementations do sometimes rely on a compiled extension under the hood, so if this node fails to import specifically (rather than just failing to run), check that your Python environment has a working build toolchain - a source of friction that's specific to BM3D packages generally, not something this pack introduced.

Common issues & troubleshooting

Import error mentioning BM3D specifically. BM3D's Python implementations commonly ship as compiled extensions rather than pure Python. If installing the pack's requirements.txt succeeded but this particular node still fails to load, that's usually a missing compiled wheel for your platform/Python version - worth checking before assuming the pack itself is broken.

Result looks over-smoothed, texture is gone. You're likely on too aggressive a profile (high or vn) combined with a noise level that's being overestimated. Try np first, and if you set noise_sigma manually, double-check it against auto_estimate's guess rather than assuming higher is safer.

Deblurring barely did anything. Check psf_type and psf_size against your actual blur - this node still needs a roughly correct blur model to invert, same limitation as any PSF-based deconvolution. If you don't know the blur characteristics, RichardsonLucyGPUNode's use_preset bundles or estimate_motion option are worth trying first to get a sense of the right ballpark.

Slow on large images. high and vn profiles are the slower end of BM3D's presets by design - that's the trade for quality. Drop to np if speed matters more than squeezing out the last bit of quality.

CategoryEric's Image Processing/BM3D

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
profileCOMBOhigh6 options: np, refilter, vn, vn_old, high, deb
psf_typeCOMBOgaussianType of blur to remove: • gaussian: Gaussian blur • motion: Motion blur
psf_sizeINT153–51PSF kernel size (odd numbers only)
blur_sigmaFLOAT2.00.1–10Blur strength parameter
noise_sigmaoptFLOAT0.0000–1Noise standard deviation (0 = auto-estimate)
auto_estimateoptBOOLEANtrueAutomatically estimate noise level

Outputs (2)

NameTypeDescription
deblurred_imageIMAGE
processing_infoSTRING