Nodes/ComfyUI-RealESRGAN_Upscaler/πŸš€ Universal RealESRGAN Upscaler
ComfyUI Node

πŸš€ Universal RealESRGAN Upscaler

The plain, fast pixel upscaler for ComfyUI

By zentrocdotΒ·Created about a year agoΒ·Updated about a year agoΒ· 26
πŸš€ Universal RealESRGAN Upscaler
  • image
  • IMAGE
  • MASK
  • width
  • height
  • config_str
  • error_str
β—„scale_factor1.0β–Ί
β—„tile_number0β–Ί
β—„tile_pad10β–Ί
β—„pre_pad0β–Ί
β—„fp_formatβ–Ύβ–Ί
β—„denoise0.00β–Ί
β—„gpu_idβ–Ύβ–Ί
β—„netscale4β–Ί
β—„modelsβ–Ύβ–Ί

Before you touch this node, answer one question: is your image already sharp, and you just want it bigger? If yes, this is exactly the right tool. If your image is soft, tiny, or damaged and you want a model to invent detail that was never there - this is the wrong family, and you want SeedVR2 or SUPIR instead. Getting that distinction wrong is the single most common upscaling mistake, and it's worth 30 seconds up front.

RealESRGAN is the workhorse of the "more pixels" job. It's a classic ESRGAN-family super-resolution model (Real-ESRGAN, 2021, from xinntao) that adds no new content - it runs in milliseconds, sips VRAM, and cannot hallucinate a face or a texture that wasn't in the source. That last part sounds like a limitation and is actually the whole appeal. Generative upscalers rewrite identity by design; this one physically can't. On an already-clean image, "won't add pores or fabric weave" is what you want, not a downside. And despite the hype cycle, this cheap rung of upscaling is gaining share, not fading - people reach for the fancy generative models, hit the cases where they smear detail, and come back to a plain 4x pass.

How it works

You give it an image and a .pth upscale model. The node runs the image through that ESRGAN network at the model's trained scale - that's what netscale describes - then resamples to whatever final scale_factor you asked for. The pack bundles xinntao's stock weights (RealESRGAN_x4plus, RealESRNet_x4plus, RealESRGAN_x2plus, and an official ESRGAN x4), and it happily loads community models like 4x-UltraSharp or 4xNomos8kSC if you drop them in - those are the ones a lot of people actually prefer for photos.

The inputs that matter

Don't be scared by the nine parameters. For a normal 512px image you set two things and leave the rest:

  • models - pick your weight. RealESRGAN_x4plus is the sane general default.
  • scale_factor (FLOAT, step 0.1) - your final multiplier. It defaults to 1, meaning no scaling, so you have to change it or nothing happens. There's no real upper limit; the author has run 30x. 2–4x is normal.
  • netscale (INT, default 4) - this must match the model's scale. An x2plus model needs netscale 2; an x4plus needs 4. Mismatch it and you get an error, full stop. This is the #1 trap: grab RealESRGAN_x2plus while netscale is still on 4 and the node just errors out.
  • tile_number (INT, default 0) - leave it at 0 (whole image at once) for small images. Bump it up when you go past ~1024px or run out of VRAM; without tiling, big images throw an error.

tile_pad, pre_pad, fp_format (fp16/fp32), denoise, and gpu_id can all stay at their defaults until you have a specific reason.

The main output is IMAGE - wire it into a Save Image or Preview. You also get width / height (INT) and two STRING diagnostics, config_str (your local GPU/install info) and error_str (the human-readable error when something like a netscale mismatch fires). Feed those two into the 🧳 Show Data node from this same pack to actually read them. There's a MASK output as well if you need it.

Installing it

Easiest path: ComfyUI Manager, search for the pack (ComfyUI-RealESRGAN_Upscaler) or the author's nick, zentrocdot, install, restart. Or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/zentrocdot/ComfyUI-RealESRGAN_Upscaler

then restart ComfyUI. Some xinntao models download during install so you can start immediately. Heads up: the author develops on Linux with an NVIDIA card, and that's what the instructions assume.

The one gotcha that bites everyone

This pack depends on basicsr, and on any recent PyTorch/TorchVision it fails to import with something like ModuleNotFoundError: torchvision.transforms.functional_tensor. It's common enough that there are standalone reddit threads titled exactly "Fix for ComfyUI Real-ESRGAN Upscaler functional_tensor error" - the module got moved in newer torchvision and basicsr still points at the old path. The README flags it as a hard prerequisite, and the fix is a one-line edit: find basicsr/data/degradations.py and change

from torchvision.transforms.functional_tensor import rgb_to_grayscale

to

from torchvision.transforms.functional import rgb_to_grayscale

then restart. The pack ships a scripts/fix.bash that does this for you if ComfyUI is in a venv. If the node red-boxes on first load, this is almost certainly why - patch it and it runs.

CategoryπŸ’Š RealEsrganUpscaler

Inputs (10)

NameTypeDefaultDescription
imageIMAGEβ€”
scale_factorFLOAT1.00–1024β€”
tile_numberINT00–8192β€”
tile_padINT100–1024β€”
pre_padINT00–1024β€”
fp_formatCOMBO2 options: fp16, fp32
denoiseFLOAT0.000–1β€”
gpu_idCOMBO1 options: 0
netscaleINT41–64β€”
modelsCOMBO4 options: RealESRGAN_x2plus.pth, ESRGAN_SRx4_DF2KOST_official-ff704c30.pth, RealESRNet_x4plus.pth, RealESRGAN_x4plus.pth

Outputs (6)

NameTypeDescription
IMAGEIMAGEβ€”
MASKMASKβ€”
widthINTβ€”
heightINTβ€”
config_strSTRINGβ€”
error_strSTRINGβ€”