ConvIR DeHaze
Dehazing photos without an SDXL sledgehammer
- src_img
- res_img
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, andohazeare trained on genuinely hazy real-world photos and handle real outdoor footage far better. The defaulthaze4kis a solid middle ground for arbitrary input.model_size-small,base, orlarge. More capacity, more cleanup, more VRAM and time.largeis only actually available forhaze4k; the code silently falls back tobaseif you ask forlargeon 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.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| src_img | IMAGE | — | |
| model_name | COMBO | haze4k | 9 options: its, ots, densehaze, haze4k, ihaze, nhhaze, +3 |
| model_size | COMBO | base | 3 options: small, base, large |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| res_img | IMAGE | — |