mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix: assert the return depth map to be a PIL image
This commit is contained in:
parent
b4cf78a95d
commit
95dde802ea
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user