Richardson-Lucy Deconvolution GPU
A 1970s deblurring algorithm, not a neural network
- image
- restored_image
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) ormotion(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_preferenceandprecision-precisionatfp16needs CUDA; fall back tofp32on 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 whicheverblur_typeyou picked.regularization(optional, default 0.0025) - turn this up if noise amplification is the problem before you cut backiterations.use_preset(optional, defaultnone) - 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 specifyingmotion_angle/motion_lengthmanually.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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| blur_type | COMBO | gaussian | Blur model to invert |
| iterations | INT | 151–100 | Number of Richardson-Lucy iterations |
| device_preference | COMBO | auto | Processing device (falls back to CPU when unavailable) |
| precision | COMBO | fp32 | Internal tensor precision (fp16 requires CUDA) |
| blur_sizeopt | FLOAT | 3.000.1–25 | Gaussian sigma when blur_type is gaussian |
| motion_angleopt | FLOAT | 00–180 | Motion blur direction in degrees |
| motion_lengthopt | FLOAT | 15.00.5–150 | Motion blur distance in pixels |
| regularizationopt | FLOAT | 0.00250–0.25 | Laplacian regularization strength |
| clip_outputopt | BOOLEAN | true | Clamp restored image to valid range |
| use_presetopt | COMBO | none | Preset parameter bundles |
| estimate_motionopt | BOOLEAN | false | Estimate motion parameters from the image |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| restored_image | IMAGE | — |