From 6a5ca1b1cf36376c1074f0cdffd4f3714b9cafdb Mon Sep 17 00:00:00 2001 From: Jacob Segal Date: Wed, 4 Sep 2024 23:43:13 -0700 Subject: [PATCH] Nodes using UNIQUE_ID as input are NOT_IDEMPOTENT As suggested by @ltdrdata, we can automatically consider nodes that take the UNIQUE_ID hidden input to be NOT_IDEMPOTENT. --- comfy_execution/caching.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_execution/caching.py b/comfy_execution/caching.py index e67914a3fab..62311ed7f2a 100644 --- a/comfy_execution/caching.py +++ b/comfy_execution/caching.py @@ -98,7 +98,7 @@ def get_immediate_node_signature(self, dynprompt, node_id, ancestor_order_mappin class_type = node["class_type"] class_def = nodes.NODE_CLASS_MAPPINGS[class_type] signature = [class_type, self.is_changed_cache.get(node_id)] - if self.include_node_id_in_input() or (hasattr(class_def, "NOT_IDEMPOTENT") and class_def.NOT_IDEMPOTENT): + if self.include_node_id_in_input() or (hasattr(class_def, "NOT_IDEMPOTENT") and class_def.NOT_IDEMPOTENT) or "UNIQUE_ID" in class_def.INPUT_TYPES().get("hidden", {}).values(): signature.append(node_id) inputs = node["inputs"] for key in sorted(inputs.keys()):