This commit is contained in:
NumZ
2025-05-17 23:35:04 +02:00
parent 5b1fd9a875
commit 13ea032207
3 changed files with 16 additions and 10 deletions
+7 -1
View File
@@ -134,8 +134,14 @@ class Workflow(SaveImage):
if "default" not in value["inputs"]:
workflow[key]["inputs"]["default"] = torch.tensor([])
else:
if value["inputs"]["default"].numel() == 0:
if isinstance(value["inputs"]["default"], list):
# Si c'est une liste, on la laisse telle quelle
workflow[key]["inputs"]["default"] = torch.tensor([])
else:
# Si c'est un tensor, on vérifie s'il est vide
if value["inputs"]["default"].numel() == 0:
workflow[key]["inputs"]["default"] = torch.tensor([])
return workflow
def treat_switch(workflow):