diff --git a/gemini_nodes.py b/gemini_nodes.py index f26e33e..3c55a2d 100644 --- a/gemini_nodes.py +++ b/gemini_nodes.py @@ -117,7 +117,7 @@ class SSL_GeminiAPIKeyConfig(IO.ComfyNode): IO.String.Input("google_application_credentials", default="", optional=True, multiline=False, tooltip="Optional absolute path to an application default credentials JSON file for Vertex AI."), IO.Boolean.Input("use_cache", default=False, optional=True, tooltip="Reuse unchanged Gemini input context through the API cache after a local result-cache miss."), IO.Int.Input("cache_ttl_minutes", default=60, min=1, step=1, optional=True, tooltip="How long Gemini keeps explicitly cached context."), - IO.Int.Input("cache_seed", default=0, min=0, max=2147483647, optional=True, tooltip="Gemini generation seed used when context caching is enabled."), + IO.Int.Input("cache_seed", default=0, min=0, max=2147483647, control_after_generate=True, optional=True, tooltip="Gemini generation seed used when context caching is enabled."), ], outputs=[ cls.GemConfig.Output("config") diff --git a/tests/test_gemini_nodes.py b/tests/test_gemini_nodes.py index 68e506b..8ec580a 100644 --- a/tests/test_gemini_nodes.py +++ b/tests/test_gemini_nodes.py @@ -11,6 +11,15 @@ from PIL import Image from custom_nodes.ComfyUI_Gemini_Expanded_API import gemini_nodes +def test_cache_seed_explicitly_enables_seed_widget_control(): + inputs = gemini_nodes.SSL_GeminiAPIKeyConfig.INPUT_TYPES() + kind, options = inputs["optional"]["cache_seed"] + assert kind == "INT" + assert options["control_after_generate"] is True + assert options["min"] == 0 + assert options["max"] == 2147483647 + + def _execute_kwargs(config): return { "config": config,