Nodes/Eric_Image_Processing_Nodes/Richardson-Lucy Deconvolution GPU
ComfyUI Node

Richardson-Lucy Deconvolution GPU

A 1970s deblurring algorithm, not a neural network

By EricRollei·Created 9 months ago·Updated 8 months ago· 9
Richardson-Lucy Deconvolution GPU
  • image
  • restored_image
blur_typegaussian
iterations15
device_preferenceauto
precisionfp32
blur_size3.00
motion_angle0
motion_length15.0
regularization0.0025
clip_outputtrue
use_presetnone
estimate_motionfalse

Everything else with "deblur" in its name in this pack is a trained network. This one isn't - Richardson-Lucy deconvolution is a statistical algorithm from the 1970s, originally built for astronomy, and it's still the standard tool in astrophotography and microscopy for undoing a blur when you actually know (or can estimate) what caused it. No training data, no checkpoint to download, just iterative math. That's a real strength when your blur is simple and well-defined, and a real limitation when it isn't.

How it works

If you know the point-spread function (PSF) that blurred your image - the shape the blur takes, like a Gaussian for defocus or a directional streak for motion - Richardson-Lucy iteratively refines an estimate of the original sharp image by repeatedly comparing a re-blurred version of its current guess against the actual blurry input, and nudging the guess to close that gap. Run it more iterations and it gets sharper; run it too many and it starts amplifying noise along with real detail, because at that point it's fitting to the noise, not the signal. regularization exists specifically to fight that - a Laplacian penalty that damps the noise amplification the algorithm is prone to at higher iteration counts. This node runs the whole thing on GPU (hence the name), which is what makes higher iteration counts and larger images practical instead of a CPU-bound wait.

The inputs and outputs that matter

  • image - required.
  • blur_type - gaussian (defocus-style blur) or motion (camera-shake or subject-motion streaking). Pick based on what actually caused the blur - they're different PSF shapes and using the wrong one won't undo the right thing.
  • iterations (1–100, default 15) - more sharpens further but amplifies noise faster past a point; this is the parameter most worth watching for diminishing (then negative) returns.
  • device_preference and precision - precision at fp16 needs CUDA; fall back to fp32 on CPU or if you hit numerical issues.
  • blur_size (optional, Gaussian sigma, default 3), motion_angle/motion_length (optional, motion blur direction and distance) - only relevant to whichever blur_type you picked.
  • regularization (optional, default 0.0025) - turn this up if noise amplification is the problem before you cut back iterations.
  • use_preset (optional, default none) - bundles of pre-tuned parameters for common scenarios: light_camera_shake, moderate_defocus, heavy_defocus, horizontal_motion, vertical_motion, diagonal_motion. Worth starting here instead of guessing raw numbers.
  • estimate_motion (optional, default false) - attempts to estimate the motion PSF from the image itself instead of you specifying motion_angle/motion_length manually.
  • clip_output (optional, default true) - clamps the result to a valid pixel range; leave this on.
  • Output: restored_image.

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. No pretrained weights here - this is math, not a model - so nothing downloads on first use. GPU acceleration for precision: fp16 needs CUDA available; the pack's core dependencies (numpy, opencv-python, scikit-image, scipy, PyWavelets) cover the rest.

Common issues & troubleshooting

Result looks grainy or has ringing artifacts, especially at higher iteration counts. That's the classic Richardson-Lucy failure mode - it's amplifying noise, not just sharpening. Reduce iterations, or raise regularization first before assuming the algorithm can't handle your image.

Barely any visible improvement. Either iterations is too low, or - more likely - your actual blur doesn't match a simple Gaussian or motion PSF. Real-world blur is often a mix of causes; this algorithm only undoes the specific PSF shape you tell it about.

Not sure whether the blur is motion or defocus. Try estimate_motion first, or start from one of the use_preset bundles closest to your situation and adjust from there rather than guessing raw motion_angle/motion_length values.

precision: fp16 errors or produces garbage on CPU. fp16 needs CUDA per the node's own tooltip - switch to fp32 if you're running on CPU or hit NaN-style output.

This isn't fixing a blur that's clearly more complex than simple motion or defocus. That's expected - for genuinely complex, unknown, or mixed blur, this pack's AI-based restorers (SwinIR, Restormer, DiffBIR) are the better tool; Richardson-Lucy shines specifically when the blur is simple and identifiable.

CategoryEric's Image Processing/Restoration

Inputs (12)

NameTypeDefaultDescription
imageIMAGE
blur_typeCOMBOgaussianBlur model to invert
iterationsINT151–100Number of Richardson-Lucy iterations
device_preferenceCOMBOautoProcessing device (falls back to CPU when unavailable)
precisionCOMBOfp32Internal tensor precision (fp16 requires CUDA)
blur_sizeoptFLOAT3.000.1–25Gaussian sigma when blur_type is gaussian
motion_angleoptFLOAT00–180Motion blur direction in degrees
motion_lengthoptFLOAT15.00.5–150Motion blur distance in pixels
regularizationoptFLOAT0.00250–0.25Laplacian regularization strength
clip_outputoptBOOLEANtrueClamp restored image to valid range
use_presetoptCOMBOnonePreset parameter bundles
estimate_motionoptBOOLEANfalseEstimate motion parameters from the image

Outputs (1)

NameTypeDescription
restored_imageIMAGE