From df51777e381aaad643497c4ee58a9936af24657f Mon Sep 17 00:00:00 2001 From: jessesep Date: Fri, 5 Dec 2025 01:57:05 +0100 Subject: [PATCH] Add IS_CHANGED to force re-execution on every run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SetVariable and GetVariable now always re-execute - Prevents ComfyUI from caching old variable values - Returns time.time() to signal change on every execution 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- __init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/__init__.py b/__init__.py index 44472f8..e52a3c1 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,7 @@ """ SimpleVariables - Set and Get nodes for storing/retrieving any data by name in ComfyUI """ +import time class AnyType(str): @@ -59,6 +60,11 @@ class SetVariable: CATEGORY = "variables" OUTPUT_NODE = True + @classmethod + def IS_CHANGED(cls, **kwargs): + # Always re-execute to capture new values + return time.time() + def set_var(self, variable_name, value=None): _variable_storage[variable_name] = value preview = get_preview_text(variable_name, value) @@ -87,6 +93,11 @@ class GetVariable: CATEGORY = "variables" OUTPUT_NODE = True + @classmethod + def IS_CHANGED(cls, **kwargs): + # Always re-execute to get latest variable value + return time.time() + def get_var(self, variable_name, trigger=None): # trigger input is just for execution ordering, not used if variable_name not in _variable_storage: