Nodes/ComfyUI-DPIR/Denoise with DRUNet
ComfyUI Node

Denoise with DRUNet

The DRUNet pre-step for old, noisy photos

By perckle·Created 11 months ago·Updated 11 months ago· 1
Denoise with DRUNet
  • upscale_model
  • image
  • IMAGE
strength5.00
tilesize512

The name says it all and it's not hiding anything: this node removes noise from an image. It is not an upscaler, it will not add detail, and that's exactly why you want it in the pipeline in front of one.

Here's the situation where it shines: you have an old scan, a low-bitrate webrip, or a JPEG re-saved a dozen times. Grain and compression artifacts are baked into every pixel. Feed that straight to a generative upscaler and it treats the noise as detail, cheerfully amplifying it - smearing, haloing, sometimes inventing whole textures out of static. The old-school fix is to clean the source first, then upscale; the community consensus literally reads "fix defects at native resolution before you make them bigger." Denoise with DRUNet is that pre-step.

How it works

The model is DRUNet, the denoiser from the DPIR restoration project (cszn/DPIR, which the README links to). DPIR's idea was a plug-and-play scheme that drops a strong standalone denoiser into iterative restoration; this node just runs the denoiser itself, in one pass - the right tool for pure denoising anyway.

DRUNet takes a noise-level map as an extra input channel. The node builds that map for you: strength / 255 becomes a constant sigma across the whole image, it gets concatenated onto the image, and the network does its thing. That's why strength exists - it's telling the model how noisy it should assume the image is, in the same 0–255 scale the pixels live on. Feed a clean image a strength of 5 and it barely moves. Feed it grain at strength 30 and it smooths aggressively. Because it's a denoiser prior, it removes noise without hallucinating a face. That's the honest difference between this and SUPIR, and why this corner of the ladder stays useful while SUPIR's stock falls.

Under the hood it tiles the image with a 32px overlap so it runs on modest VRAM, pads to a multiple of 8, and if it hits an out-of-memory error it automatically halves the tile size and retries (down to a floor of 128) before giving up.

The inputs that matter

There are only four, and a beginner changes two of them:

  • upscale_model - the DRUNet weights, loaded with ComfyUI's built-in Load Upscale Model node (this is the one thing that trips people up: it's a denoise, but the models load through the upscale loader).
  • strength - default 5, range 0–1000. The noise level in 8-bit space. Start at 5–10 for light grain; heavy film noise or JPEG artifacts want 20–40. Too high and you get that smeared "plastic" look.
  • tilesize - default 512. Lower it if VRAM complains; the node will bail you out on OOM anyway.
  • image - whatever IMAGE tensor you're cleaning.

Output is a single IMAGE, same resolution as the input, ready to feed into a SeedVR2 or ESRGAN pass, a KSampler, or straight to the VAE. The node also sorts out channel mismatches itself: a color model gets grayscale repeated to three channels, and a gray model gets your RGB image luma-converted, so you don't have to think about which of the four models matches your source.

Install

The pack is one node, MIT-licensed, and has zero Python dependencies - no requirements.txt, nothing to compile. Install it the ComfyUI way:

cd ComfyUI/custom_nodes
git clone https://github.com/perckle/comfyui_dpir

then restart ComfyUI. Or open ComfyUI Manager and search "ComfyUI-DPIR" (the node shows up as "Denoise with DRUNet" in the node picker).

The actual work is the models. Grab the safetensor conversions from huggingface.co/perckle/DPIR (or the raw weights from the KAIR releases page) and drop them in ComfyUI/models/upscale_models:

drunet_color.safetensors          # color photos
drunet_gray.safetensors           # B&W / scans
drunet_deblocking_color.safetensors       # JPEG artifacts
drunet_deblocking_grayscale.safetensors   # JPEG artifacts, B&W

Load the right one with Load Upscale Model, wire it into upscale_model, and run the pack's example workflow if you want the downloads scripted for you.

Common issues

  • "The model doesn't show in Load Upscale Model" - you put it in the wrong folder. It must be ComfyUI/models/upscale_models, not unet or checkpoints, and ComfyUI needs a restart to see new files.
  • Image comes back blurry - strength too high for the source. Back it off; denoising is a trade, not a slider to max.
  • VRAM pressure on big scans - lower tilesize to 256 or 384. The auto-halving saves you, but it's slower.
  • Disappointed there's no upscaling - not a bug. Pair it with SeedVR2 and you have the standard 2026 chain: clean, then detail.

One honest note: the internet barely talks about DRUNet by name - roughly one Reddit mention a year. It's the quiet front-end of the ladder, not the showpiece, and quiet is what you want in a pre-processor.

Categoryimage/denoising

Inputs (4)

NameTypeDefaultDescription
upscale_modelUPSCALE_MODEL
imageIMAGE
strengthFLOAT5.000–1000
tilesizeINT512

Outputs (1)

NameTypeDescription
IMAGEIMAGE