The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Turn on local_web_sso and partner_node_token by default (#17490)
Dante1f22ffd176c5
diff --git a/comfy_api/feature_flags.py b/comfy_api/feature_flags.pyindex 6bc29ba9c..569a77c99 100644--- a/comfy_api/feature_flags.py+++ b/comfy_api/feature_flags.py@@ -37,12 +37,12 @@ CLI_FEATURE_FLAG_REGISTRY: dict[str, FeatureFlagInfo] = {},"partner_node_token": {"type": "bool",- "default": False,+ "default": True,"description": "Queue Local API-node prompts with a renewable partner-node token instead of the workspace token",},"local_web_sso": {"type": "bool",- "default": False,+ "default": True,"description": "Offer Sign in with browser (Cloud OAuth + PKCE) on Local ComfyUI opened at localhost or 127.0.0.1",},}@@ -126,13 +126,17 @@ _CORE_FEATURE_FLAGS: dict[str, Any] = {# Owned by app.deploy_to_cloud, which sets it via set_server_feature._SERVER_SET_FEATURE_FLAGS = ("deploy_to_cloud",)-# CLI-provided flags cannot overwrite core or server-set flags. Startup code may: main.py sets "assets".-_cli_flags = {- k: v for k, v in _parse_cli_feature_flags().items()- if k not in _CORE_FEATURE_FLAGS and k not in _SERVER_SET_FEATURE_FLAGS-}+def _server_feature_flags() -> dict[str, Any]:+ """Registry defaults, then core flags, then CLI flags. CLI flags cannot overwrite core or server-set flags; main.py may still set "assets"."""+ registry_defaults = {k: info["default"] for k, info in CLI_FEATURE_FLAG_REGISTRY.items()}+ cli_flags = {+ k: v for k, v in _parse_cli_feature_flags().items()+ if k not in _CORE_FEATURE_FLAGS and k not in _SERVER_SET_FEATURE_FLAGS+ }+ return {**registry_defaults, **_CORE_FEATURE_FLAGS, **cli_flags}+-SERVER_FEATURE_FLAGS: dict[str, Any] = {**_CORE_FEATURE_FLAGS, **_cli_flags}+SERVER_FEATURE_FLAGS: dict[str, Any] = _server_feature_flags()def get_connection_feature(diff --git a/tests-unit/feature_flags_test.py b/tests-unit/feature_flags_test.pyindex d68b044e0..b483a1b9c 100644--- a/tests-unit/feature_flags_test.py+++ b/tests-unit/feature_flags_test.py@@ -10,6 +10,7 @@ from comfy_api.feature_flags import (SERVER_FEATURE_FLAGS,_coerce_flag_value,_parse_cli_feature_flags,+ _server_feature_flags,)from app.comfy_api_env import (environment_overrides_for_base,@@ -193,6 +194,25 @@ class TestParseCliFeatureFlags:class TestCliFeatureFlagRegistry:"""Test suite for the CLI feature flag registry."""+ @pytest.mark.parametrize("key", ["partner_node_token", "local_web_sso"])+ def test_local_sso_flags_are_on_by_default(self, key):+ assert CLI_FEATURE_FLAG_REGISTRY[key]["default"] is True++ def test_server_features_report_registry_defaults(self, monkeypatch):+ monkeypatch.setattr("comfy_api.feature_flags.args", type("Args", (), {"feature_flag": []})())+ features = _server_feature_flags()+ for key, info in CLI_FEATURE_FLAG_REGISTRY.items():+ assert features[key] == info["default"], key++ @pytest.mark.parametrize("key", ["partner_node_token", "local_web_sso"])+ def test_cli_flag_turns_a_default_on_flag_off(self, monkeypatch, key):+ monkeypatch.setattr("comfy_api.feature_flags.args", type("Args", (), {"feature_flag": [f"{key}=false"]})())+ assert _server_feature_flags()[key] is False++ def test_cli_flags_cannot_override_core_flags(self, monkeypatch):+ monkeypatch.setattr("comfy_api.feature_flags.args", type("Args", (), {"feature_flag": ["node_replacements=false"]})())+ assert _server_feature_flags()["node_replacements"] is True+def test_registry_entries_have_required_fields(self):for key, info in CLI_FEATURE_FLAG_REGISTRY.items():assert "type" in info, f"{key} missing 'type'"