Add IS_CHANGED to force re-execution on every run

- 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 <noreply@anthropic.com>
This commit is contained in:
jessesep
2025-12-05 01:57:05 +01:00
co-authored by Claude
parent 42d994649e
commit df51777e38
+11
View File
@@ -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: