From a613006f5a80ba618f2ba51af6955f8b877973af Mon Sep 17 00:00:00 2001 From: James Veitch <1722315+darth-veitcher@users.noreply.github.com> Date: Sat, 25 Jul 2026 23:45:02 +0100 Subject: [PATCH] fix(ollama): bypass stale combo validation for LLM model widgets (#33) LLMModelSelector and LLMLoadModel validated the model COMBO against _DEFAULT_MODELS, a list fetched once at ComfyUI startup. Models pulled into Ollama afterward showed up in the live-refreshed dropdown but failed prompt validation with "value ... is not available" until the server was restarted. VALIDATE_INPUTS now accepts any model string, deferring to Ollama itself to reject an actually-missing model. Claude-Session: https://claude.ai/code/session_01YArD9ZjBWKsAvazmS48amA Co-authored-by: Claude Sonnet 5 --- src/comfydv/ollama.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/comfydv/ollama.py b/src/comfydv/ollama.py index 98cd43a..b9b1e43 100644 --- a/src/comfydv/ollama.py +++ b/src/comfydv/ollama.py @@ -304,6 +304,18 @@ class LLMModelSelector: } } + @classmethod + def VALIDATE_INPUTS(cls, model): + """Bypass the frozen-at-startup combo list (see _load_default_models). + + The JS Refresh button keeps the widget's dropdown live, but + ``_DEFAULT_MODELS`` is only ever populated once, at server start-up. + Without this, models pulled into Ollama afterward validate in the + UI but fail prompt validation with "value ... is not available" + until ComfyUI is restarted. + """ + return True + RETURN_TYPES = ("STRING",) RETURN_NAMES = ("model_name",) FUNCTION = "select_model" @@ -328,6 +340,11 @@ class LLMLoadModel: } } + @classmethod + def VALIDATE_INPUTS(cls, model): + """See LLMModelSelector.VALIDATE_INPUTS for why this bypass exists.""" + return True + RETURN_TYPES = ("STRING",) RETURN_NAMES = ("model_name",) FUNCTION = "load_model"