Ignore tensors in optional arg checks, they are not falsey

This commit is contained in:
Paul
2024-07-22 10:54:47 +00:00
parent f3b74e2d3e
commit 6a61a5b9bb
+5 -2
View File
@@ -196,8 +196,11 @@ def create_comfyui_node(schema):
def remove_falsey_optional_inputs(self, kwargs):
optional_inputs = self.INPUT_TYPES().get("optional", {})
for key in list(kwargs.keys()):
if key in optional_inputs and not kwargs[key]:
del kwargs[key]
if key in optional_inputs:
if isinstance(kwargs[key], torch.Tensor):
continue
elif not kwargs[key]:
del kwargs[key]
def run_replicate_model(self, **kwargs):
self.handle_array_inputs(kwargs)