Nodes/KJNodes for ComfyUI/Diffusion Model Selector
ComfyUI Node Runs on cloud

Diffusion Model Selector

Getting a model's filename as text, not as a loaded model

By kijai·Created 3 years ago·Updated about 7 hours ago· 2,930
Diffusion Model Selector
    • model_path
    model_name

    Most model-loading nodes in ComfyUI do two things at once: let you pick a checkpoint from a dropdown, and immediately load it into memory as a usable MODEL object. Diffusion Model Selector splits those apart - it gives you the dropdown, but the output is just the path, as a plain string, with nothing loaded.

    Why you'd want this

    Sometimes you don't want a loaded model, you want the name of one. Maybe you're building a label to display which checkpoint a workflow used, logging it for a batch of runs, constructing an output filename that includes the model name, or feeding a path string into some other node or custom loader that expects text rather than an already-loaded MODEL object. Any place downstream in your graph wants "which model, as text" rather than "the model, ready to run inference with," this is the smaller, cheaper node for the job - it doesn't touch VRAM or trigger a load at all.

    It's a small utility, and it stays in its lane: it doesn't resolve anything about the model's architecture, doesn't validate compatibility with anything else in your graph, and doesn't load weights. It just reads the picked filename back out as a string.

    How it works

    The model_name dropdown is populated dynamically from whatever diffusion models ComfyUI can see in your install at graph-build time - it's not a fixed list baked into the node, it reflects your actual local setup. Pick one, and the node hands back that same value as plain text through model_path.

    The inputs and outputs that matter

    • model_name - an enum populated from your local model files. What shows up here depends entirely on what's actually present in your ComfyUI install; there's no fixed set of choices baked into the node itself.

    One output: model_path - the selected entry, as a STRING, unchanged.

    How to install it

    • ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt (portable: python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KJNodes\requirements.txt), then restart.

    No downloads triggered by this node itself - it only reads what's already in your models folder, it doesn't fetch anything.

    Common issues & troubleshooting

    Dropdown is empty, or missing a model you know you have. Since the choice list is populated from your local install rather than fixed, an empty or incomplete dropdown almost always means ComfyUI isn't finding your model files where it expects them - check your models directory path/config rather than assuming the node is broken.

    Expected a loaded model, got an error instead. If you wire model_path's string output into a slot that actually wants a MODEL object, that's a type mismatch - this node deliberately doesn't load anything. If you need the model loaded, use a normal checkpoint/diffusion model loader node instead, and reach for this one only when text is genuinely what you need.

    New model file doesn't show up until restart. Like most dropdown-from-disk nodes in ComfyUI, this list is typically built when the graph loads, not live-refreshed as files change on disk - if you just added a new model, a restart (or at least a fresh page load) is usually needed before it appears as an option.

    CategoryKJNodes/model_loaders

    Inputs (1)

    NameTypeDefaultDescription
    model_nameCOMBOThe name of the checkpoint (model) to load.

    Outputs (1)

    NameTypeDescription
    model_pathSTRING