ComfyUI Extension: ComfyUI-DownscaleIRN
A single-node ComfyUI module for Invertible Image Rescaling (IRN) that includes: automatic model download and discovery, BasicSR-based IRN_x2/x3/x4 loading, device/precision control, low-VRAM tiling, safe handling of non-divisible sizes, alpha channel preservation, and built-in bicubic/area fallback.
Custom Nodes (0)
README
ComfyUI Invertible Rescale (Downscale only)
A single-node ComfyUI wrapper for Invertible Image Rescaling (IRN) downscaling with:
- Auto-download of models (selected or all) from the official Google Drive folder
- Automatic discovery of local
.pt/.pthmodels - BasicSR
.pthloader (vendored minimal IRN network) for IRN_x2/x3/x4 - Device and precision control
- Tiling for low VRAM
- Safe handling of sizes not divisible by the scale
- Alpha channel preservation
- Built-in bicubic/area fallback
Install
- Copy this folder to:
ComfyUI/custom_nodes/comfyui_invertible_rescale - Restart ComfyUI.
Optional dependencies:
pip install torch torchvision
pip install gdown # for Google Drive auto-download
Models
Official IRN pretrained models (IRN_x2.pth, IRN_x3.pth, IRN_x4.pth) are hosted at:
- https://drive.google.com/drive/folders/1ym6DvYNQegDrOy_4z733HxrULa1XIN92
This node will:
- Auto-download the selected model if
auto_download_selectedis ON and missing. - Optionally download all available models if
auto_download_allis ON. - Discover and list all
.pt/.pthfiles in:~/ComfyUI/models/invertible_rescale
You can also set direct URLs (and SHA256) in model_registry.json if you prefer non-GDrive hosting.
Node: IRN Downscale
Inputs:
image: an IMAGE tensormodel_key:auto_best_match: usesIRN_x{scale}if found (downloads if enabled), else builtin.builtin_bicubic: standard PyTorch downscale (bicubic/area).- Any discovered local/registered model (dropdown).
scale: 2 / 3 / 4device: auto / cuda / cpu / mpsprecision: fp16 / bf16 / fp32tile_size,tile_overlap: enable tiling to reduce memory loadnot_divisible_mode: pad / crop / resize_to_multiplebuiltin_mode: bicubic / area (only for builtin)keep_alpha: preserve alpha (downscaled with area)auto_download_selected,auto_download_all,use_google_drive,models_dir_override
Outputs:
image: downscaled imagemeta: model used, device, timing, available models, and any load error
License
MIT