From 7fa22d3ae97ee966bb2996fcac1f56118415f656 Mon Sep 17 00:00:00 2001 From: jessesep Date: Fri, 5 Dec 2025 02:06:05 +0100 Subject: [PATCH] Revert IS_CHANGED storage - trigger input required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IS_CHANGED doesn't have access to computed input values yet. The trigger input is required to ensure execution order. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- __init__.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/__init__.py b/__init__.py index 4ddd42c..a422160 100644 --- a/__init__.py +++ b/__init__.py @@ -61,10 +61,7 @@ class SetVariable: OUTPUT_NODE = True @classmethod - def IS_CHANGED(cls, variable_name, value=None): - # Store the value during IS_CHANGED phase (runs before all node execution) - # This ensures GetVariable nodes can find values even without trigger connection - _variable_storage[variable_name] = value + def IS_CHANGED(cls, **kwargs): return time.time() def set_var(self, variable_name, value=None): @@ -74,12 +71,18 @@ class SetVariable: class GetVariable: - """Retrieve data by variable name - shows preview on node""" + """Retrieve data by variable name - shows preview on node + + Connect SetVariable's output to 'trigger' to ensure proper execution order. + """ @classmethod def INPUT_TYPES(cls): return { "required": { "variable_name": ("STRING", {"default": "my_var"}), + }, + "optional": { + "trigger": (ANY,), } } RETURN_TYPES = (ANY,) @@ -90,10 +93,9 @@ class GetVariable: @classmethod def IS_CHANGED(cls, **kwargs): - # Always re-execute to get latest variable value return time.time() - def get_var(self, variable_name): + def get_var(self, variable_name, trigger=None): if variable_name not in _variable_storage: available = list(_variable_storage.keys()) preview = f"{variable_name} = NOT SET (available: {available})"