ConvIR Defocus Deblur
ConvIR Defocus Deblur
- src_img
- res_img
Out-of-focus blur is a different animal from motion blur. Motion blur smears the frame along a direction you can estimate; defocus blur is a lens doing its thing, and "fixing" it is really asking the model to invent what the lens refused to capture. That's exactly what ConvIR DefocusDeblur tries to do, and it's the most honest-to-goodness restoration job in the FM_nodes pack - you're reconstructing information that never quite got recorded.
What it does
This is the ConvIR restoration backbone - the redundant-feature-pruned U-net encoder-decoder from the Revitalizing Convolutional Network for Image Restoration paper - trained on the DPDD dataset (Dual-Pixel Defocus Deblurring). Unlike the dehaze and desnow variants that give you a menu of datasets, this one trains on a single defocus-blur benchmark, so your only real choice is how big a model you want to run.
The one input that matters
src_img- the blurry IMAGE. Batch-friendly, so video frames work (with a progress bar), but see the speed warning below.model_size-small,base, orlarge, defaultbase. This is the only knob.smallis fast and fine for a quick test;baseis the reasonable default;largesqueezes out more detail at a real cost in time and VRAM.
The res_img output is the deblurred IMAGE, same resolution as the input, ready for a Save node or an upscaler.
Installing it
FM_nodes installs like any custom pack - ComfyUI Manager, search FM_nodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/FuouM/FM_nodes
then restart ComfyUI. The pack's requirements are just torch and einops; nothing exotic, no keys. The model is the chore: it's not auto-downloaded. Get dpdd-small.pkl / dpdd-base.pkl / dpdd-large.pkl from the ConvIR Google Drive and put them in custom_nodes/FM_nodes/models/convir/defocus/. The code looks up dpdd-<size>.pkl inside that folder, so a file-not-found on queue almost always means it landed in the wrong spot.
Where people get burned
Two traps. First, expectations: defocus deblur works best on slightly soft images - a portrait that missed focus by a hair, a macro shot that's mushy. Truly shallow depth-of-field bokeh isn't "blur to remove," it's a compositional choice, and running this on a bokeh-heavy image will produce something unnaturally sharp that nobody asked for. Second, the large model on video: it's a per-frame loop, and asking the big model to chew through a few hundred frames is a quick way to spend your evening waiting. Test on a single frame with base first.
It's a niche node - that's why almost nobody's landed on its page yet - but if you shoot video with a lens that front-focuses, or you've got a drawer of soft portraits, this is the cheapest way to un-soften them without a diffusion rewrite.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| src_img | IMAGE | — | |
| model_size | COMBO | base | 3 options: small, base, large |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| res_img | IMAGE | — |