From bf7af541fc12d582815f4327e5fda145acd5705f Mon Sep 17 00:00:00 2001 From: HermitCrabe Date: Thu, 17 Aug 2023 18:56:44 -0500 Subject: [PATCH] Allow WAS_Image_Batch to combine individual images with sets of images Does not affect error handling for different image dimensions --- WAS_Node_Suite.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WAS_Node_Suite.py b/WAS_Node_Suite.py index 6c08098..3a58d59 100644 --- a/WAS_Node_Suite.py +++ b/WAS_Node_Suite.py @@ -4561,9 +4561,10 @@ class WAS_Image_Batch: def _check_image_dimensions(self, tensors, names): dimensions = [tensor.shape for tensor in tensors] if len(set(dimensions)) > 1: - mismatched_indices = [i for i, dim in enumerate(dimensions) if dim != dimensions[0]] + mismatched_indices = [i for i, dim in enumerate(dimensions) if dim[1:] != dimensions[0][1:]] mismatched_images = [names[i] for i in mismatched_indices] - raise ValueError(f"WAS Image Batch Warning: Input image dimensions do not match for images: {mismatched_images}") + if mismatched_images: + raise ValueError(f"WAS Image Batch Warning: Input image dimensions do not match for images: {mismatched_images}") def image_batch(self, **kwargs): batched_tensors = [kwargs[key] for key in kwargs if kwargs[key] is not None]