diff --git a/comfy_execution/caching.py b/comfy_execution/caching.py index d4bd2dee1..02c9028af 100644 --- a/comfy_execution/caching.py +++ b/comfy_execution/caching.py @@ -52,6 +52,7 @@ class Unhashable: def _sanitized_sort_key(obj, depth=0, max_depth=32): + """Build a deterministic sort key from sanitized built-in container content.""" if depth >= max_depth: return ("MAX_DEPTH",) @@ -83,6 +84,7 @@ def _sanitized_sort_key(obj, depth=0, max_depth=32): def _sanitize_signature_input(obj, depth=0, max_depth=32): + """Sanitize prompt-signature inputs without recursing into opaque runtime objects.""" if depth >= max_depth: return Unhashable() @@ -120,6 +122,7 @@ def _sanitize_signature_input(obj, depth=0, max_depth=32): return Unhashable() def to_hashable(obj): + """Convert prompt-safe built-in values into a stable hashable representation.""" # Restrict recursion to plain built-in containers. Some custom nodes insert # runtime objects into prompt inputs for dynamic graph paths; walking those # objects as generic Mappings / Sequences is unsafe and can destabilize the diff --git a/comfy_execution/graph_utils.py b/comfy_execution/graph_utils.py index 28f53ad95..573645c7c 100644 --- a/comfy_execution/graph_utils.py +++ b/comfy_execution/graph_utils.py @@ -1,4 +1,5 @@ def is_link(obj): + """Return True if obj is a plain prompt link of the form [node_id, output_index].""" # Prompt links produced by the frontend / GraphBuilder are plain Python # lists in the form [node_id, output_index]. Some custom-node paths can # inject foreign runtime objects into prompt inputs during on-prompt graph