From 95dde802ea419fe9f87eaf7dee7d80d7ad1c3bcc Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Wed, 31 Jul 2024 23:22:01 +0530 Subject: [PATCH] fix: assert the return depth map to be a PIL image --- .../image_util/depth_anything/depth_anything_pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/backend/image_util/depth_anything/depth_anything_pipeline.py b/invokeai/backend/image_util/depth_anything/depth_anything_pipeline.py index 2217e0b285..a497486177 100644 --- a/invokeai/backend/image_util/depth_anything/depth_anything_pipeline.py +++ b/invokeai/backend/image_util/depth_anything/depth_anything_pipeline.py @@ -17,7 +17,7 @@ class DepthAnythingPipeline(RawModel): def generate_depth(self, image: Image.Image, resolution: int = 512): image_width, image_height = image.size depth_map = self.pipeline(image)["depth"] - depth_map = cast(Image.Image, depth_map) + assert isinstance(depth_map, Image.Image) new_height = int(image_height * (resolution / image_width)) depth_map = depth_map.resize((resolution, new_height))