Nodes/ComfyUI AstroCorp Nodes/Load Upscale Model+
ComfyUI Node

Load Upscale Model+

ComfyUI's stock loader can't see ONNX upscalers. This one can.

By AstroCorp·Created about a year ago·Updated 8 days ago· 1
Load Upscale Model+
    • UPSCALE_MODEL
    model_name

    The name undersells it. "Load Upscale Model+" is not a cosmetic tweak of ComfyUI's stock loader - the "+" is an entire feature ComfyUI doesn't have. Drop a .pth or .safetensors upscaler in models/upscale_models and both loaders see it. Add a .onnx file, and the stock Load Upscale Model node won't even list it in the dropdown, while this one will. That's the whole reason to install a pack you'd otherwise skim past.

    Why the stock node misses ONNX files

    This is a real quirk, not a bug you can fix with settings. ComfyUI's native loader pulls its file list from folder_paths.get_filename_list(), which gets cached early - before custom nodes are registered - and that cache never includes .onnx extensions. The AstroCorp node sidesteps it by walking models/upscale_models directly and filtering for .pth, .pt, .safetensors, and .onnx itself. Same folder, same models, plus the format the stock node can't see.

    Why would you even want ONNX upscalers? Because that's where a chunk of the classic ESRGAN family lives - sites like OpenModelDB ship many models as .onnx or offer converters. If you've ever grabbed a 4x model and found it won't load, this is the loader that fixes it.

    How it actually works

    For PyTorch weights it follows the exact same path as ComfyUI's native node: load the state dict (with a check for the module. prefix some checkpoints store from DataParallel training), hand it to Spandrel, and wrap it in a model patcher. Nothing exotic.

    For .onnx it gets clever. If TensorRT is installed and you have CUDA, the first run compiles a TensorRT engine from the ONNX and caches it under models/tensorrt/upscaler - the cache filename bakes in the TensorRT version and the 256–512px tile range it was built for. Later runs load the engine directly, and it rebuilds automatically if the ONNX file is newer than the cached engine. No TensorRT? It falls back to onnxruntime, preferring its TensorRT/CUDA execution providers before CPU. One caveat: the TensorRT path requires NCHW (channel-first) ONNX, so an NHWC export will error rather than silently run wrong.

    The node reads the model's scale factor by probing it - and if that doesn't line up, it falls back to parsing the filename. So the naming convention matters: call it 4x_Foo.onnx, not Foo.onnx, or you may hit a "couldn't deduce scale factor" error.

    The inputs that matter

    There's exactly one: model_name, a dropdown of every upscale file in models/upscale_models, now including ONNX. That's it. The output is a single UPSCALE_MODEL, which you wire into an Upscale Image (using Model) node - ideally the AstroCorp one, since the stock upscale node doesn't know how to run a TensorRT/ONNX model (see the companion article for why).

    Installing it

    This is the easy part. It's a small personal pack (one Spanish-speaking dev, a handful of utility nodes) and it's in ComfyUI Manager:

    # ComfyUI Manager → Install Custom Nodes → search "ComfyUI AstroCorp Nodes"
    # or manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/AstroCorp/ComfyUI-AstroCorp-Nodes
    # restart ComfyUI
    

    One gotcha worth knowing: the pack's own README shows a placeholder clone URL (your-username/comfyui_astro_nodes.git) - use the real repo above or Manager. The pack's requirements.txt lists only tensorrt, which is optional (the code guards for it). If you don't have TensorRT and want ONNX models, the README tells you to install onnxruntime-gpu (or onnxruntime) into your ComfyUI Python env:

    # into the Python environment ComfyUI runs in (the embedded python on Windows,
    # or your venv on Linux):
    python -m pip install onnxruntime-gpu
    

    Common issues

    • First ONNX run is slow. That's the engine compile - it can take minutes and needs VRAM. It's one-time per model; the cache under models/tensorrt/upscaler is why the second run is fast.
    • "ONNX upscale models need TensorRT (NVIDIA) or onnxruntime." You're on a machine with neither. Install one of the two above.
    • Model not in the dropdown. Wrong folder, wrong extension, or a .onnx with a weird extension - the loader filters by extension explicitly.
    • Confusing scale-factor error on a .onnx. Rename the file with the factor in it, e.g. 4x_Remacri.onnx.

    For the "more pixels, not more detail" job, a 4x ESRGAN class model loaded here is still the right, free, hallucination-free answer - this node just removes the wall that kept half of those models out of ComfyUI.

    Category🚀🌍 AstroCorp 🌍🚀/upscaling

    Inputs (1)

    NameTypeDefaultDescription
    model_nameCOMBO1 options:

    Outputs (1)

    NameTypeDescription
    UPSCALE_MODELUPSCALE_MODEL