Nodes/FM_nodes/ConvIR Defocus Deblur
ComfyUI Node

ConvIR Defocus Deblur

ConvIR Defocus Deblur

By FuouM·Created 2 years ago·Updated about a year ago· 9
ConvIR Defocus Deblur
  • src_img
  • res_img
model_sizebase

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, or large, default base. This is the only knob. small is fast and fine for a quick test; base is the reasonable default; large squeezes 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.

CategoryFM_nodes/ConvIR

Inputs (2)

NameTypeDefaultDescription
src_imgIMAGE
model_sizeCOMBObase3 options: small, base, large

Outputs (1)

NameTypeDescription
res_imgIMAGE