Nodes/Orion4D_MetaNode/πŸ“‚ Model Selector
ComfyUI Node

πŸ“‚ Model Selector

A file picker that hands you a path, not a model β€” read that twice

By orion4dΒ·Created 5 months agoΒ·Updated 5 months agoΒ· 5
πŸ“‚ Model Selector
    • absolute_path
    • relative_path
    • filename_only
    • any_path
    • any_filename
    β—„categoryβ–Ύβ–Ί
    β—„file_nameβ–Ί

    The Model Selector is a two-level dropdown that lets you browse your models/ folder without typing a path by hand. First menu: the category (checkpoints, loras, upscale_models, whatever subfolders you have). Second menu: the file inside it. And here's the part that trips people up - it does not load the model. It returns paths. Strings. That's the entire output contract, and the sooner you internalize it, the less confused you'll be.

    This is worth being blunt about because a node called "Model Selector" sets expectations. A checkpoint loader loads a model into memory. This node reads your disk, filters for model-ish files, and hands you back where they live. If you wire its output into a checkpoint loader expecting magic, nothing will happen. You use it with something that accepts a path - which is exactly what makes it useful.

    How it works

    On load, and through a server route (/orion4d/get_models), the node walks folder_paths.models_dir and lists every subfolder that contains model files. The file filter is .safetensors, .gguf, .pth, .bin, .ckpt, and .pt - so it sees real model weights and ignores READMEs and configs. When you pick a file, it computes four views of the same path and a validation check blocks path traversal (trying to reach outside models/ gets refused).

    Inputs and outputs

    • Inputs:
      • category (enum) - a subfolder of models/, e.g. checkpoints.
      • file_name (STRING) - the chosen file, shown relative to the category.
    • Outputs:
      • absolute_path (STRING) - full path on disk.
      • relative_path (STRING) - category/file.ext, which is the portable form.
      • filename_only (STRING) - just the filename.
      • any_path () / any_filename () - untyped copies, so the node can feed into a * input that has its own typing.

    When it's the right tool

    Two situations. First, when a custom node in your graph takes a path string - model path, LoRA path, upscaler path - and you'd rather pick it from a real dropdown than retype a long absolute path that breaks the moment you move machines. Second, when you're building a dynamic workflow: use this pack's Model Selector to choose a category, then drive another node from the chosen relative_path. That portable relative_path form is the one to prefer for anything you plan to share.

    Troubleshooting

    • Dropdown is empty? A category only appears if it contains at least one file with an allowed extension. If your folder is all .gguf and it's not showing, check the extension is exactly right.
    • Wired it to a loader and nothing loaded? Yes - it outputs paths, not models. Look for a loader that accepts a path string, or combine the path with a script node.
    • "File not found on disk" validation error? The file was deleted or moved after the dropdown cached its list; re-open the node to rescan.

    Installing it

    It's part of Orion4D_MetaNode, one install for all of it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/orion4d/Orion4D_MetaNode
    

    Or via ComfyUI Manager (search "Orion4D_MetaNode") and restart. It appears under Orion4D_MetaNode β†’ UI Widgets. No extra dependencies, and it needs no models to download - it just reads the ones you already have. Honest context: young, single-developer pack, modest community footprint - useful utility, not a community standard.

    CategoryOrion4D_MetaNode/UI Widgets

    Inputs (2)

    NameTypeDefaultDescription
    categoryCOMBO1 options: (aucun)
    file_nameSTRINGβ€”

    Outputs (5)

    NameTypeDescription
    absolute_pathSTRINGβ€”
    relative_pathSTRINGβ€”
    filename_onlySTRINGβ€”
    any_path*β€”
    any_filename*β€”