f"If image batch size is not 1, image batch size must be same as prompt batch size. image batch size: {controlnet_cond_image_batch_size}, prompt batch size: {prompt_batch_size}"
)
ifisinstance(image,torch.Tensor):
ifimage.ndim!=3andimage.ndim!=4:
raiseValueError("`image` must have 3 or 4 dimensions")
# if mask_image.ndim != 2 and mask_image.ndim != 3 and mask_image.ndim != 4:
# raise ValueError("`mask_image` must have 2, 3, or 4 dimensions")