Nodes/Eric_Image_Processing_Nodes/DiffBIR Restoration (Eric)
ComfyUI Node

DiffBIR Restoration (Eric)

The diffusion-powered restorer in a mostly non-generative pack

By EricRollei·Created 9 months ago·Updated 8 months ago· 9
DiffBIR Restoration (Eric)
  • image
  • restored_image
tasksr
versionv2.1
sampleredm_dpm++_3m_sde
steps12
upscale4.0
cfg_scale6.00
captionernone
noise_aug0
start_point_typenoise
rescale_cfgfalse
strength1.00
cleaner_tiledfalse
cleaner_tile_size512
cleaner_tile_stride256
cldm_tiledfalse
cldm_tile_size512
cldm_tile_stride256
guidancefalse
guidance_scale0.00
guidance_lossw_mse
guidance_spacergb
guidance_start0.00
guidance_stop1.00
seed231
device_preferenceauto
precisionfp16
positive_prompt_override
negative_prompt_override

Every other restorer in this pack repairs an image. DiffBIR regenerates parts of it. That's a real distinction the wider ComfyUI community draws constantly between "more pixels" tools like ESRGAN and "more detail" tools like SUPIR or SeedVR2 - the second category can invent plausible content that was never actually in the source, and DiffBIR sits firmly in that camp. It's the heaviest, most parameter-dense node in this pack by a wide margin, and it's the one to reach for only once SwinIR, Restormer, and the classical filters have genuinely failed you.

How it works

DiffBIR is a two-stage pipeline. Stage one is a "cleaner" network that strips out obvious degradation - compression, noise, blur - the same job a non-generative restorer does. Stage two hands that cleaned image to a diffusion model, conditioned via ControlNet on the stage-one output, and lets it regenerate detail through the normal denoising-diffusion sampling process. That's why this node's parameter list looks like a Stable Diffusion sampler rather than a restoration filter: it is one, wired into a restoration pipeline. version picks between DiffBIR's checkpoint generations (v1 through v2.1, with real quality/speed differences between them), and sampler offers a long list of diffusion samplers because stage two is genuinely sampling from noise, not doing a single forward pass.

The inputs and outputs that matter

Beginners should focus on a handful and leave the rest at defaults:

  • image - required.
  • task - sr, denoise, face, or unaligned_face. The face tasks matter enough to flag on their own: this is a generative model regenerating detail, and the KB-documented "face problem" that follows every generative restorer applies here too - it can shift identity, not just clean up a photo. Don't run face/unaligned_face on something where getting the actual person's likeness right matters, without checking the result carefully.
  • version (default v2.1) - the newest checkpoint family; older versions exist for compatibility but v2.1 is the one to start with.
  • upscale (0.5 steps, default 4) and steps (4–200, default 12) - output scale and diffusion step count. More steps generally means better quality at the cost of time; 12 is already a reasonable default.
  • cfg_scale (default 6) - standard diffusion classifier-free guidance. Higher pushes harder toward the conditioning, lower gives the model more freedom.
  • captioner (optional, default none) - an automatic image captioner (llava or ram) that can improve results by giving the diffusion stage a text description of what it's looking at, but it needs its own extra weights.
  • Everything else - noise_aug, start_point_type, rescale_cfg, strength, the cleaner_tiled/cldm_tiled tiling pairs, the guidance* loss-guided sampling fields, seed, device_preference, precision, and the prompt overrides - are there for when you need fine control, not for a first run.
  • Output: restored_image.

How to install it

Search Eric_Image_Processing_Nodes in ComfyUI Manager, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Eric_Image_Processing_Nodes
cd Eric_Image_Processing_Nodes
pip install -r requirements.txt

Restart ComfyUI. This is the node in the pack where the download and VRAM story is genuinely different from the rest: under the hood it's running a Stable-Diffusion-scale pipeline (stage-one cleaner plus a ControlNet-conditioned diffusion model), so expect several gigabytes of checkpoint downloads the first time you run it - not the couple-hundred-MB downloads the pack's other AI nodes need - and meaningfully more VRAM and time per image than SwinIR or Restormer. If you also want the optional captioner, that's yet another model download (llava or ram) on top.

Common issues & troubleshooting

First run is very slow or seems stuck. That's the checkpoint downloads, plural - stage-one cleaner plus the diffusion weights, and the captioner if you enabled one. Give it real time and disk space before assuming it's hung.

Out of memory even after the other nodes in this pack ran fine. This is a genuinely heavier pipeline than anything else here. Enable cleaner_tiled and cldm_tiled and bring their tile sizes down before you give up on the image size - the two stages tile independently, so you may need to tune both.

Result looks like a different image, not a restored one. That's the generative-restoration trade-off, not a malfunction - at high cfg_scale/steps with a heavily degraded source, the diffusion stage has more freedom to invent. Drop cfg_scale, use fewer steps, or reduce strength if you want the output to stay closer to the input.

Face task changed who the person looks like. Expected behavior for this class of model, not a bug specific to this node - every generative restorer in the community carries this risk. If identity fidelity matters, prefer real_denoise-style non-generative restoration elsewhere in this pack, or treat DiffBIR's face output as a starting point to compare against the original rather than a final answer.

sampler choice doesn't seem to matter much. For most images the differences between the DPM++ variants here are subtle; it's more of a quality/speed lever than a correctness one. Don't spend too much tuning time here before adjusting steps and cfg_scale first.

CategoryEric's Image Processing/Transformer Enhancements

Inputs (29)

NameTypeDefaultDescription
imageIMAGE
taskCOMBOsrSelect DiffBIR task
versionCOMBOv2.1Choose DiffBIR checkpoint family
samplerCOMBOedm_dpm++_3m_sdeSampling strategy for the diffusion stage
stepsINT124–200Number of diffusion steps
upscaleFLOAT4.01–8Output scaling factor (used for SR and face modes)
cfg_scaleFLOAT6.000–12Classifier-free guidance scale
captioneroptCOMBOnoneAutomatic captioner (requires extra weights for llava/ram)
noise_augoptINT00–40Noise augmentation level
start_point_typeoptCOMBOnoiseInitial latent for sampling (cond recommended for v1/v2 when stability is needed)
rescale_cfgoptBOOLEANfalseGradually ramp the CFG scale
strengthoptFLOAT1.000.1–1.5ControlNet conditioning strength
cleaner_tiledoptBOOLEANfalseEnable tiling for the stage-1 cleaner
cleaner_tile_sizeoptINT512128–1024Tile size for cleaner when tiling is enabled
cleaner_tile_strideoptINT25664–512Overlap between cleaner tiles
cldm_tiledoptBOOLEANfalseEnable tiling for the diffusion U-Net
cldm_tile_sizeoptINT512256–1024Tile size for diffusion tiles
cldm_tile_strideoptINT25664–512Overlap between diffusion tiles
guidanceoptBOOLEANfalseEnable restoration guidance loss
guidance_scaleoptFLOAT0.000–1Strength of restoration guidance
guidance_lossoptCOMBOw_mseGuidance loss variant
guidance_spaceoptCOMBOrgbColor space for guidance loss
guidance_startoptFLOAT0.000–1Fraction of steps before guidance activates
guidance_stopoptFLOAT1.000–1Fraction of steps after which guidance stops
seedoptINT2310–2147483647Random seed
device_preferenceoptCOMBOautoDevice override
precisionoptCOMBOfp16Computation precision
positive_prompt_overrideoptSTRINGOptional positive prompt override
negative_prompt_overrideoptSTRINGOptional negative prompt override

Outputs (1)

NameTypeDescription
restored_imageIMAGE