Allow WAS_Image_Batch to combine individual images with sets of images

Does not affect error handling for different image dimensions
This commit is contained in:
HermitCrabe
2023-08-17 18:56:44 -05:00
parent 6c859ff240
commit bf7af541fc
+3 -2
View File
@@ -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]