From 6a61a5b9bb1457b61e969c62ffd9edc1c19fe04d Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 22 Jul 2024 10:54:47 +0000 Subject: [PATCH] Ignore tensors in optional arg checks, they are not falsey --- node.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/node.py b/node.py index 3588199..faef57d 100644 --- a/node.py +++ b/node.py @@ -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)