ComfyUI Node

IRN Downscale

IRN Downscale

By alibof96·Created 10 months ago·Updated 10 months ago· 1
IRN Downscale
  • image
  • image
  • meta
model_keyauto_best_match
scale4
deviceauto
precisionfp16
tile_size0
tile_overlap16
not_divisible_modepad
builtin_modebicubic
keep_alphatrue
auto_download_selectedtrue
auto_download_allfalse
use_google_drivetrue
models_dir_override
verbosetrue

Let's get the elephant in the name out of the way first: this is a downscale-only node. There is no matching upscale half in this pack. That sounds backwards for a tool built around Invertible Image Rescaling (IRN), but the pitch is simple - a smarter downscale is the half of the equation that keeps more of your image alive, so whatever upscaler you feed later has more to work with.

The idea behind IRN comes from the "Invertible Image Rescaling" paper (ECCV 2020, the BasicSR lineage). A normal bicubic or area downscale just throws away the high-frequency detail that doesn't fit. IRN instead uses an invertible neural network - Haar downsampling plus a stack of invertible blocks, which is exactly what the vendored InvRescaleNet in this pack is - to learn a downscale that hides the lost detail inside extra latent channels. Because the operation is mathematically invertible, the downscaled image keeps more recoverable information than any fixed filter can. The visible result: a downscale that looks sharper and less "mushy" than bicubic at the same size.

So who actually reaches for this? Two real camps. First, anyone doing the "downscale a soft source before upscaling it" trick - the one Comfy Org's own SeedVR2 handbook recommends, where you drop a soft 4K image to ~0.35 megapixels so the upscaler rebuilds from a sharper-relative base. If you're already pre-downscaling, IRN is a strictly better way to pick what survives that step. Second, people shaving VRAM: feeding a batch of big images through a limited card at reduced size is a classic, and doing it with IRN instead of ImageScale costs you less of the frame.

The inputs that actually matter

Only three are required:

  • image - a standard IMAGE tensor. Wire it from your loader, VAE decode, or whatever produced the frame.
  • model_key - leave it on auto_best_match and it picks IRN_x{scale} for you (downloading it if missing), falling back to the builtin filter if the model can't be found. The dropdown also lists IRN_x2, IRN_x3, IRN_x4, any .pt/.pth you drop in ~/ComfyUI/models/invertible_rescale, and builtin_bicubic.
  • scale - 2, 3, or 4. Don't set it to 5: only 2/3/4 have official models, so anything else silently resolves to the builtin.

The optional stack is mostly "set and forget." tile_size (default 0 = off) tiles the inference so low-VRAM cards can run x4 without dying; crank it down to 512–1024 if you're on 4–6GB. not_divisible_mode handles widths that don't divide cleanly - pad is the safe default, and it's why you never get the "shape mismatch" error bicubic paths love to throw. precision defaults to fp16, device to auto. keep_alpha (default on) downscales the alpha channel with area and reattaches it, which is a thoughtful touch if you're running RGBA through the pipeline.

Outputs are image and a meta DICT. Check meta when something looks off: it reports which model was actually used, whether it fell back to builtin, and any load error. That last bit is the entire troubleshooting story, honestly.

Install

Through ComfyUI Manager, search ComfyUI-DownscaleIRN and install. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/alibof96/ComfyUI-DownscaleIRN
# then restart ComfyUI

Its requirements.txt is just torch, torchvision, gdown. The first two you already have; gdown is the only real dependency and the node will try to pip-install it on its own if it's missing. Models auto-download from the official Google Drive folder to ~/ComfyUI/models/invertible_rescale - no manual model hunt.

Where people get burned

Google Drive quota. The auto-download relies on gdown pulling from a shared Drive folder, and Drive throttles popular files ("Too many users have viewed…"). The node degrades gracefully - it just falls back to builtin bicubic - but it'll do that silently, so check meta.model_used if your "IRN" downscale looks suspiciously like plain bicubic. The fix is in model_registry.json: set a direct URL (plus SHA256) for each model and the node downloads from there instead.

The import-error dead end. If the node shows up as a "load error" node telling you to check the console, it's almost always one of three things: the folder got moved mid-install, requirements.txt was installed into the wrong Python env, or the repo is stale. pip install -r requirements.txt into the same environment ComfyUI uses, restart, and it clears.

The honest framing: this is a niche, research-grade utility - barely on the community's radar compared to the SeedVR2s of the world, and most people do the same job with bicubic without noticing. But if you're already downscaling and want the last few percent of detail retention, it's a one-node upgrade that never hard-fails. There are worse things to spend a custom node on.

Categoryimage/resize

Inputs (15)

NameTypeDefaultDescription
imageIMAGE
model_keyCOMBOauto_best_match5 options: builtin_bicubic, auto_best_match, IRN_x2, IRN_x3, IRN_x4
scaleINT42–8
deviceoptCOMBOauto4 options: auto, cuda, cpu, mps
precisionoptCOMBOfp163 options: fp16, bf16, fp32
tile_sizeoptINT00–8192
tile_overlapoptINT160–512
not_divisible_modeoptCOMBOpad3 options: pad, crop, resize_to_multiple
builtin_modeoptCOMBObicubic2 options: bicubic, area
keep_alphaoptBOOLEANtrue
auto_download_selectedoptBOOLEANtrue
auto_download_alloptBOOLEANfalse
use_google_driveoptBOOLEANtrue
models_dir_overrideoptSTRING
verboseoptBOOLEANtrue

Outputs (2)

NameTypeDescription
imageIMAGE
metaDICT