fix: 🐛 add rgb/rgba toggle to stack images

now defaulting to rgb (too many nodes don't properly support rgba)
This commit is contained in:
Mel Massadian
2025-06-24 17:02:41 +02:00
parent 7e89e96e9d
commit e98f3f626f
+9 -2
View File
@@ -21,7 +21,11 @@ class MTB_StackImages:
"match_method": (
["error", "smallest", "largest"],
{"default": "error"},
)
),
"output_rgb": (
"BOOLEAN",
{"default": True, "tooltip": "Output RGB instead of RGBA"},
),
},
}
@@ -29,7 +33,7 @@ class MTB_StackImages:
FUNCTION = "stack"
CATEGORY = "mtb/image utils"
def stack(self, vertical, match_method="error", **kwargs):
def stack(self, vertical, match_method="error", output_rgb=True, **kwargs):
if not kwargs:
raise ValueError("At least one tensor must be provided.")
@@ -98,6 +102,9 @@ class MTB_StackImages:
stacked_tensor = torch.cat(normalized_tensors, dim=dim)
if output_rgb:
stacked_tensor = stacked_tensor[:, :, :, :3]
return (stacked_tensor,)
def normalize_to_rgba(self, tensor):