Nodes/ComfyUi_zaknak_nodes/Compatible Model Selector
ComfyUI Node

Compatible Model Selector

Pick your LLM by index, no dropdown required

By zaknak·Created 6 months ago·Updated 6 months ago· 0
Compatible Model Selector
    • model_name
    models_json
    model_index0

    Once Compatible Endpoint has fetched your model list, this tiny node lets you pick one of them by number. You give it the same models_json your endpoint produced and an model_index (0 for the first entry), and it returns that model's name as a plain string. That's the entire job, and it's exactly as boring as it should be.

    The reason it exists is the same one that spawned its sibling Compatible Model List View: ComfyUI has no dynamic dropdown for "models on your server." So the pack splits selection into a reader (List View) and a picker (this). Check the list once, type the index, move on with your life.

    How it works

    It parses models_json the same way the List View does - data[].id first, name as fallback, plain string arrays accepted - then returns models[index]. Out-of-range index, empty JSON, or invalid JSON all yield an empty string rather than a crash.

    The workflow that makes it useful

    The interesting bit is what you do with the model_name output: wire it back into Compatible Endpoint's model_name input. That lets you switch models mid-workflow - say, from a fast general model to a bigger reasoning one for a specific branch - just by changing one integer. The pack's own docs describe exactly this: List View to find the index, Selector to extract the name, and the name flows back into the endpoint, which then passes it along to Chat Once / Vision Chat Once.

    That feedback loop is the one genuinely clever use of an otherwise obvious node, and it's worth setting up if you juggle several local models.

    Install

    Part of ComfyUi_zaknak_nodes - ComfyUI Manager, or git clone https://github.com/zaknak/ComfyUi_zaknak_nodes into ComfyUI/custom_nodes, then restart. No extra dependencies.

    Troubleshooting

    • Empty model_name output: either the index is out of range, or models_json didn't contain a usable list. Check Compatible Endpoint's status_text - a failed /models fetch means the Selector has nothing to work with, and you're better off typing model_name manually in the endpoint.
    • Wrong model selected: the index is 0-based and the list follows your server's response order, not alphabetical. Re-read it with the List View before assuming the picker is broken.
    • You changed models but the chat still used the old one: trace the wire. The selector only feeds model_name back if you actually connected the output to the endpoint's input - it doesn't mutate anything by itself.
    Categoryzaknak/llm

    Inputs (2)

    NameTypeDefaultDescription
    models_jsonSTRING
    model_indexINT00–65535

    Outputs (1)

    NameTypeDescription
    model_nameSTRING