Compatible Model Selector
Pick your LLM by index, no dropdown required
- model_name
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_nameoutput: either the index is out of range, ormodels_jsondidn't contain a usable list. CheckCompatible Endpoint'sstatus_text- a failed/modelsfetch means the Selector has nothing to work with, and you're better off typingmodel_namemanually 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_nameback if you actually connected the output to the endpoint's input - it doesn't mutate anything by itself.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| models_json | STRING | — | |
| model_index | INT | 00–65535 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model_name | STRING | — |