mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-17 15:15:00 +08:00
Fix sanitize_signature_input
This commit is contained in:
parent
2adde5a0e1
commit
39086890e2
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user