Nodes/Refocus - Generative Refocusing/Apply DeblurNet (Utility)
ComfyUI Node

Apply DeblurNet (Utility)

The deblur node that works with the FLUX model you already own

By EricRollei·Created 8 months ago·Updated 4 months ago· 19
Apply DeblurNet (Utility)
  • model
  • clip
  • vae
  • genfocus_loras
  • image
  • deblurred_image
  • latents
prompta sharp photo with everything in focus
steps28
guidance_scale3.5
seed42
lora_strength1.00
tile_size512

DeblurNetApply takes a blurry or out-of-focus photo and hands you back a sharp, everything-in-focus version. It's the first stage of the Refocus pipeline - the one that gives BokehNet a clean, sharp base to work from, because the bokeh network expects a sharp input and produces mush if you feed it a soft one.

The genuinely useful part: this is the "utility" path, which means it runs inside ComfyUI's own sampler machinery with whatever FLUX model you already have loaded via a plain Load Checkpoint node. No diffusers, no separate 23GB download, no HuggingFace login. You wire up model, clip, and vae, and it just works.

The mechanism, and the honest caveat

Under the hood it's img2img with a partial denoise. Your image gets VAE-encoded to latent, then run through ComfyUI's euler/normal sampler at a denoise strength of 0.7, with the prompt "a sharp photo with everything in focus" against a negative of "blurry, out of focus, soft, bokeh, shallow depth of field". The defocus is lifted, structure is preserved.

And now the part you deserve to know before you get excited: it doesn't actually apply the DeblurNet LoRA yet. The code is explicit - "custom LoRA application not yet implemented" - so the genfocus_loras input is wired, accepted, and then ignored in favor of the base model plus prompt. What you get is a solid prompt-guided deblur, which does real work on optical blur, but it is not the trained Genfocus DeblurNet. That's the Genfocus Deblur (Native) node's job, and it needs the diffusers pipeline. If you want the actual paper-quality result, use the native node; if you want a fast deblur that reuses your existing FLUX checkpoint, this is your node.

Inputs and outputs that matter

Required: model, clip, vae (any FLUX checkpoint), genfocus_loras (from GenfocusLoRALoader), and image.

  • steps (28) - more gives marginally better sharpening; the README notes quality gains flatten out quickly.
  • guidance_scale (3.5) - the FLUX convention. Drop toward 2.5–3.0 for a more natural look.
  • tile_size (512) - tiles high-res images to keep VRAM down. Set 0 to disable tiling.
  • lora_strength (1.0) - currently inert, as noted above. Leave it.

Outputs are deblurred_image (the sharp result) and latents - the latent is the one worth keeping: it lets you chain or reuse the exact denoised state for a consistency pass.

Install and models

Install via ComfyUI Manager (search "Refocus") or git clone https://github.com/EricRollei/comfyui-refocus into custom_nodes/, then restart. This particular node needs no extra pip packages - the base requirements (torch, safetensors, matplotlib) ship with ComfyUI. You do need the Genfocus LoRAs in models/loras/ for the loader, but they're ~35MB total from nycu-cplab/Genfocus-Model on HuggingFace.

Tips

Deblur first, then refocus - that ordering is the whole point of the pipeline. Keep dimensions multiples of 16 (the node pads automatically anyway). And if you want extra crispness after upscaling, the README suggests a Richardson-Lucy deconvolution node as a final pass.

CategoryRefocus/Deblur

Inputs (11)

NameTypeDefaultDescription
modelMODEL
clipCLIP
vaeVAE
genfocus_lorasGENFOCUS_LORAS
imageIMAGE
promptoptSTRINGa sharp photo with everything in focusText prompt to guide deblurring
stepsoptINT281–100Number of denoising steps
guidance_scaleoptFLOAT3.51–20Classifier-free guidance scale
seedoptINT420–18446744073709550000Random seed for reproducibility
lora_strengthoptFLOAT1.000–2LoRA adapter strength
tile_sizeoptINT512256–1024Tile size for high-res processing (0 = no tiling)

Outputs (2)

NameTypeDescription
deblurred_imageIMAGE
latentsLATENT