From 3dca9a0c67c50cfcb0e6558444f395248bf5bca7 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:37:24 +1100 Subject: [PATCH] Fix union type breaks existing type workarounds --- comfy_execution/validation.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/comfy_execution/validation.py b/comfy_execution/validation.py index 43fb6426d..cec105fc9 100644 --- a/comfy_execution/validation.py +++ b/comfy_execution/validation.py @@ -15,11 +15,18 @@ def validate_node_input( If strict is False, the input_type must have overlap with the received_type. For example, if received_type is "STRING,BOOLEAN" and input_type is "STRING,INT", this will return True. + + Supports pre-union type extension behaviour of ``__ne__`` overrides. """ # If the types are exactly the same, we can return immediately - if received_type == input_type: + # Use pre-union behaviour: inverse of `__ne__` + if not received_type != input_type: return True + # Not equal, and not strings + if not isinstance(received_type, str) or not isinstance(input_type, str): + return False + # Split the type strings into sets for comparison received_types = set(t.strip() for t in received_type.split(",")) input_types = set(t.strip() for t in input_type.split(","))