IF LLM List Models 📚
List What Your LLM Provider Actually Has
- model_list
The main IF_LLM node has a dirty little secret: its llm_model field is a plain text box, and it validates your answer against what the provider actually reports. Type llama3.2 when the server calls it llama3.2:latest and you'll get bounced with an "Invalid LLM model selected" error mid-workflow. That's exactly the problem this node exists to kill. IF_LLM_ListModels asks any of the pack's 13 providers "what do you have?" and prints the answer, numbered, in the order the provider hands it over.
It's a tiny node, but it's the kind of thing you'll reach for every time you set up a new machine or point the pack at a new backend. It saves you from the guess-and-check loop.
How it works
Under the hood it's a thin wrapper around the same model-listing code the main node uses for validation. You pick a provider - ollama, llamacpp, kobold, lmstudio, textgen, groq, gemini, openai, anthropic, mistral, transformers, xai, or deepseek - and it hits that provider's list endpoint. For local servers that means an HTTP call to base_ip:port (the default localhost:11434 is Ollama's port, which tells you what the author expects you to run). For API providers it needs a key, pulled from the environment or from the external_api_key field you can type in.
Two things it does beyond the output:
- It writes the list to disk at
ComfyUI/model_lists/<provider>_models.txt, so you get a file record, not just a widget you have to wire up. - The
refreshboolean forces a fresh query. That matters: if youollama pulla new model mid-session and the list looks stale, fliprefreshand re-run.
The inputs that matter
Honestly, three:
llm_provider- which backend to interrogate.base_ip/port- only touch these for local servers on another machine or a non-default port.external_api_key- fill this for hosted APIs if your key isn't in the environment or.env.
The output is a single model_list STRING that looks like === Available Models for OLLAMA ===\n1. llama3.2\n2. .... Wire it into a text display node - this pack ships IF_LLM_DisplayText - or just read the file it writes. Copy the exact names into the main node's llm_model field and the validation error disappears.
Installing it
It ships with the whole pack, so install once:
cd ComfyUI/custom_nodes
git clone https://github.com/if-ai/ComfyUI-IF_LLM
then restart ComfyUI - or just search "IF_LLM" in ComfyUI Manager and hit install. One real gotcha before you do: the README warns this pack conflicts with IF_AI_tools, so remove that if you have it, or the two fight over the same node names. The requirements file pulls in a lot - torch, transformers, triton, decord, moviepy - so the first install takes a while.
Troubleshooting
- You see
No models available or provider requires valid API key/connection. That string is literally in the code, and it means one of three things: Ollama (or whatever server) isn't running, thebase_ip/portare wrong, or the API key is missing. Check the last one first - the pack reads keys from env vars with exact names likeOPENAI_API_KEYor from a.envfile. - The list is empty but Ollama is clearly running. Check the port.
ollama servelistens on 11434 by default, but a second instance or a Docker container will happily squat on something else. - The main node still rejects a name the list showed. Some servers report the model with a
:tagsuffix (llama3.2:latest), and that's the string you have to paste in.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| llm_provider | COMBO | ollama | 13 options: ollama, llamacpp, kobold, lmstudio, textgen, groq, +7 |
| base_ip | STRING | localhost | — |
| port | STRING | 11434 | — |
| external_api_key | STRING | — | |
| refresh | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model_list | STRING | — |