diff --git a/src/diffusers/image_processor.py b/src/diffusers/image_processor.py index 9893f7163853..843052c1adf3 100644 --- a/src/diffusers/image_processor.py +++ b/src/diffusers/image_processor.py @@ -33,14 +33,7 @@ List[torch.FloatTensor], ] -PipelineDepthInput = Union[ - PIL.Image.Image, - np.ndarray, - torch.FloatTensor, - List[PIL.Image.Image], - List[np.ndarray], - List[torch.FloatTensor], -] +PipelineDepthInput = PipelineImageInput class VaeImageProcessor(ConfigMixin): @@ -169,7 +162,7 @@ def convert_to_grayscale(image: PIL.Image.Image) -> PIL.Image.Image: @staticmethod def blur(image: PIL.Image.Image, blur_factor: int = 4) -> PIL.Image.Image: """ - Blurs an image. + Applies Gaussian blur to an image. """ image = image.filter(ImageFilter.GaussianBlur(blur_factor)) @@ -402,6 +395,7 @@ def binarize(self, image: PIL.Image.Image) -> PIL.Image.Image: """ image[image < 0.5] = 0 image[image >= 0.5] = 1 + return image def get_default_height_width(