Nodes/Upscaler Filename/Upscale Model Loader with Filename
ComfyUI Node

Upscale Model Loader with Filename

Upscale, and stop guessing which output came from which model

By giusparsifal·Created 2 months ago·Updated about a month ago· 0
Upscale Model Loader with Filename
    • upscale_model
    • model_name_clean
    • image_filename_prefix
    • video_filename_prefix
    model_name
    image_baseUpscalerFilename/Image
    video_baseUpscalerFilename/Video

    Upscale Model Loader with Filename is the boring ComfyUI UpscaleModelLoader you already know, with one addition that fixes a very real annoyance: it also hands you a ready-made filename prefix containing the upscaler's name.

    Here's the problem it solves. You're testing upscalers - the KB's upscaling guide is basically one long argument that "which upscaler" is three different questions, and everyone ends up side-by-side-ing a couple of ESRGAN variants like 4x-UltraSharp against RealESRGAN_x4plus_anime_6B. Do that for an afternoon with ComfyUI's default Save Image and you get forty files all named ComfyUI_00042_.png, and no way to tell which was which. This node names the output after the model, so the file literally tells you.

    How it works

    Peek at the source and it's honest work: model_name is a dropdown fed from models/upscale_models, the model loads through spandrel's ModelLoader exactly like the built-in node (including the module. prefix compatibility for weird checkpoints, and the CoreModelPatcher wrapper ComfyUI 0.30+ expects). So it's a drop-in swap - you lose nothing by replacing the stock loader with this one.

    Then it does three string operations. model_name_clean strips the extension and replaces anything outside A-Za-z0-9._- with an underscore. The two prefixes are just image_base + _ + clean name, and video_base + _ + clean name. Folder-style prefixes survive, so RealESRGAN_x4plus.pth becomes RealESRGAN_x4plus, UpscalerFilename/Image_RealESRGAN_x4plus, and UpscalerFilename/Video_RealESRGAN_x4plus. Empty names fall back to upscaler, so it can't crash on a weird filename.

    The inputs and outputs that matter

    You really only set one thing:

    • model_name - the upscaler, from your models/upscale_models folder. This is the whole point.
    • image_base and video_base - text prefixes, defaulting to UpscalerFilename/Image and UpscalerFilename/Video. The tooltip is the author's own word: the model name is appended automatically. Leave them unless you want a different folder structure.

    Outputs:

    • upscale_model - the UPSCALE_MODEL, wired into ImageUpscaleWithModel like any other loader.
    • model_name_clean - the sanitized model name, if you want it in a filename yourself.
    • image_filename_prefix / video_filename_prefix - the strings you feed into the filename_prefix inputs of Save Image and VHS Video Combine.

    Installing it

    Through ComfyUI Manager, search "Upscaler Filename" and install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/giusparsifal/ComfyUI-Upscaler-Filename.git
    

    Restart ComfyUI. The pyproject.toml declares zero dependencies - it rides on spandrel, which ComfyUI already ships - so there are no model files to download beyond the upscaler you're already using.

    Using it

    1. Add the node, pick your upscaler.
    2. Wire upscale_model into ImageUpscaleWithModel.
    3. Right-click the filename_prefix widget on Save Image (or VHS Video Combine) and choose Convert widget to input.
    4. Connect image_filename_prefix or video_filename_prefix to the new input.

    Change the upscaler in the dropdown and the saved filenames change with it. No prompt edits, no remembering.

    Where people get bitten

    Two small traps. First, that slash in the default prefix is a subfolder, so your files land in output/UpscalerFilename/Image_RealESRGAN_x4plus_00001_.png. That's usually what you want for A/B testing - change image_base if it isn't. Second, converting the widget on Save Image removes the text box, so if you convert and don't actually wire the string, you're saving under an empty prefix. Convert only when you're ready to connect.

    One more honest note: the video prefix only pays off if you have VideoHelperSuite (VHS) installed to actually save video - this pack doesn't install it for you. And yes, a purist will point out that filename_prefix already supports %NodeName.widget% templating - but there's no stock node that exposes "the name of the loaded upscaler," which is exactly the gap this fills.

    For a single-purpose utility it's well-made, zero-risk, and the exact thing you want when the upscale comparison starts to blur. Reach for it.

    Categoryimage/upscaling

    Inputs (3)

    NameTypeDefaultDescription
    model_nameCOMBO0 options:
    image_baseSTRINGUpscalerFilename/ImageBase prefix for image outputs. The model name will be appended automatically.
    video_baseSTRINGUpscalerFilename/VideoBase prefix for video outputs. The model name will be appended automatically.

    Outputs (4)

    NameTypeDescription
    upscale_modelUPSCALE_MODEL
    model_name_cleanSTRING
    image_filename_prefixSTRING
    video_filename_prefixSTRING