π€ Leon Model Selector
One dropdown for every LLM your endpoint serves β the pack's model picker
- model_name
Leon Model Selector is the pack's answer to the "which model am I even talking to?" problem. It's a tiny node with a single output - model_name, a STRING - that you wire into the model input of the pack's LLM Chat and LLM JSON nodes. Instead of typing a model ID into a text box every time (and typo-ing gpt-4o as gpt-4O), you pick from a dropdown populated from a live model list. It's the ComfyUI equivalent of a model picker in an API playground, and it keeps your graphs from breaking when an endpoint's model list changes under you.
The clever bit is the caching. The dropdown isn't hardcoded - it's loaded from a cached models_config.json the pack ships, and when you flip fetch_from_endpoint to True, the node hits the api_url (default https://api.hyprlab.io/v1/models) with your key, pulls the live model list, saves it to the cache, and refreshes the dropdown. So the node stays useful even when the endpoint is unreachable: it falls back to the cached list instead of failing the whole workflow.
How it works
Three inputs you'll touch:
model_choice- the dropdown itself. Defaultgemini-flash-latest. The list it shows is whatever's in the cache (the choices array in the schema is intentionally empty/dynamic - it's built at runtime from the cache).api_url/api_key- used only whenfetch_from_endpointis on. The default endpoint is HyprLab's/v1/models.custom_model- a free-text override that replaces the dropdown selection when filled in. This is the escape hatch: if the model you want isn't in the cached list, type it here.
Output: model_name (STRING) - wire it into Leon_LLM_Chat_API_Node.model or Leon_LLM_JSON_API_Node.model.
The node also prints a warning (not an error) if the model you selected isn't in the fetched list - you can still run it, but you've been told.
Installing it
Pack-wide install:
cd ComfyUI/custom_nodes
git clone https://github.com/l3ony2k/comfyui-leon-nodes
pip install -r requirements.txt
Restart ComfyUI, or install "ComfyUI Leon Nodes" via ComfyUI Manager.
Where people get burned
The cache is a double-edged sword. The dropdown reflects the cached list, which may be stale - a model that exists at the endpoint won't show up until you flip fetch_from_endpoint on and refresh. And since this is a pure model-chooser, it's easy to forget it doesn't validate against anything at runtime; custom_model lets you type nonsense and it'll happily pass it along (the LLM node is where the error finally lands). The HyprLab defaults assume you're using HyprLab's endpoint - point api_url at whatever OpenAI-compatible service you actually use. For keeping model IDs consistent across a graph, it's a small node that removes a whole class of typo bugs.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model_choice | COMBO | gemini-flash-latest | Select a model from available options |
| api_url | STRING | https://api.hyprlab.io/v1/models | API URL to fetch models list |
| api_key | STRING | YOUR_HYPRLAB_API_KEY | Your HyprLab API key |
| fetch_from_endpointopt | BOOLEAN | false | Fetch fresh model list from API endpoint and save to cache |
| custom_modelopt | STRING | Enter custom model name (overrides dropdown selection) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model_name | STRING | β |