diff --git a/connect_node.py b/connect_node.py index 97105fc..e0bad45 100644 --- a/connect_node.py +++ b/connect_node.py @@ -1,5 +1,7 @@ from __future__ import annotations +from typing import Any + from comfy_api.latest import io, ui from .client import ( @@ -115,7 +117,13 @@ class LMStudioConnect(io.ComfyNode): ) @classmethod - def validate_inputs(cls, server_url: str, timeout_seconds: int, max_tokens: int) -> bool | str: + def validate_inputs( + cls, + server_url: str, + timeout_seconds: int, + max_tokens: int, + **_: Any, + ) -> bool | str: try: normalize_server_url(server_url) except ValueError as exc: diff --git a/tests/test_connect_node.py b/tests/test_connect_node.py index 08be62b..9f482c3 100644 --- a/tests/test_connect_node.py +++ b/tests/test_connect_node.py @@ -49,6 +49,27 @@ def test_validate_inputs() -> None: assert cls.validate_inputs("http://127.0.0.1:1234", 10, 0) == "max_tokens must be >= 1" +def test_validate_inputs_accepts_extra_kwargs() -> None: + connect_node = _connect_module() + cls = connect_node.LMStudioConnect + + # ComfyUI may pass any of the schema inputs by name; the method must tolerate them. + assert ( + cls.validate_inputs( + "http://127.0.0.1:1234", + 10, + 128, + api_token="-", + model="placeholder", + reasoning_enabled=False, + use_tooling_mcp=False, + temperature=0.7, + test_connectivity=True, + ) + is True + ) + + def test_execute_with_placeholder_model_uses_discovered_default( monkeypatch: pytest.MonkeyPatch, ) -> None: