Nodes/FM_nodes/ConvIR DeHaze
ComfyUI Node

ConvIR DeHaze

Dehazing photos without an SDXL sledgehammer

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

Atmospheric haze is the quiet killer of outdoor shots - that grey film that flattens distant mountains, city skylines, and any drone footage shot through humidity. You could reach for a diffusion-based restorer and gamble that it redraws the scene nicely, or you could use a dedicated dehazing model that just removes the fog layer. ConvIR DeHaze is the second option, and it's the one to pick when you want the original scene back, not a reinterpretation.

The mechanism

This is the same ConvIR restoration backbone as the rest of this family: a U-shaped convolutional encoder-decoder with redundant-feature pruning and multi-scale feature aggregation, from the Revitalizing Convolutional Network for Image Restoration paper (Cui et al., TPAMI). "Dehazing" is just the task it was trained for - instead of predicting a clean frame from a blurred one, it predicts the scene from a hazy one. Same-size in and out, deterministic, one pass per image. Feed it a batched video's frames and it'll work through them with a progress bar.

The two inputs that matter

This node has the most model choices of any ConvIR node, and the choices actually mean something:

  • src_img - the hazy IMAGE you want cleaned up. Batches work, so video frames are fine (just slow, being a per-frame pass).
  • model_name - nine datasets to choose from: its, ots, densehaze, haze4k, ihaze, nhhaze, ohaze, gta5, nhr. The distinction that matters is synthetic vs real. ITS, OTS, GTA5 and the like are trained on computer-generated haze - great on renders, occasionally stiff on real photos. nhhaze (natural haze), densehaze, and ohaze are trained on genuinely hazy real-world photos and handle real outdoor footage far better. The default haze4k is a solid middle ground for arbitrary input.
  • model_size - small, base, or large. More capacity, more cleanup, more VRAM and time. large is only actually available for haze4k; the code silently falls back to base if you ask for large on any other model, so don't be confused when it doesn't seem any slower.

Wire the res_img output into a Save Image or on into an upscaler.

Installing it

Same pack install as the rest of FM_nodes - ComfyUI Manager (search FM_nodes) or:

cd ComfyUI/custom_nodes
git clone https://github.com/FuouM/FM_nodes

then restart. Dependencies are just torch and einops; no API keys, no services. The model files are the real install step and they are not auto-downloaded. Grab the .pkl files from the ConvIR Google Drive and place them at custom_nodes/FM_nodes/models/convir/dehaze/<model_name>-<size>.pkl - e.g. haze4k-base.pkl for the default. Miss the folder and you get a file-not-found on the first queue.

Where people get burned

The most common mistake is picking a synthetic-haze model for real photos and then blaming the node. If your input is a real hazy shot, reach for nhhaze or ohaze first. The other gotcha is expectation: dehazing removes the fog layer, it doesn't sharpen what was already soft, and heavy haze with heavy compression can come back looking a bit waxy - same trade-off as every non-generative restorer. But for the 90% case - a hazy but otherwise decent photo - this is a one-node fix that won't rewrite the scene. That's worth a lot when you care what the original actually looked like.

CategoryFM_nodes/ConvIR

Inputs (3)

NameTypeDefaultDescription
src_imgIMAGE
model_nameCOMBOhaze4k9 options: its, ots, densehaze, haze4k, ihaze, nhhaze, +3
model_sizeCOMBObase3 options: small, base, large

Outputs (1)

NameTypeDescription
res_imgIMAGE