diff --git a/invokeai/app/invocations/controlnet_image_processors.py b/invokeai/app/invocations/controlnet_image_processors.py index 9eba3acdca..610dbd433f 100644 --- a/invokeai/app/invocations/controlnet_image_processors.py +++ b/invokeai/app/invocations/controlnet_image_processors.py @@ -576,7 +576,7 @@ DEPTH_ANYTHING_MODEL_SIZES = Literal["large", "base", "small"] title="Depth Anything Processor", tags=["controlnet", "depth", "depth anything"], category="controlnet", - version="1.0.0", + version="1.0.1", ) class DepthAnythingImageProcessorInvocation(ImageProcessorInvocation): """Generates a depth map based on the Depth Anything algorithm""" @@ -585,13 +585,12 @@ class DepthAnythingImageProcessorInvocation(ImageProcessorInvocation): default="small", description="The size of the depth model to use" ) resolution: int = InputField(default=512, ge=64, multiple_of=64, description=FieldDescriptions.image_res) - offload: bool = InputField(default=False) def run_processor(self, image: Image.Image): depth_anything_detector = DepthAnythingDetector() depth_anything_detector.load_model(model_size=self.model_size) - processed_image = depth_anything_detector(image=image, resolution=self.resolution, offload=self.offload) + processed_image = depth_anything_detector(image=image, resolution=self.resolution) return processed_image diff --git a/invokeai/backend/image_util/depth_anything/__init__.py b/invokeai/backend/image_util/depth_anything/__init__.py index fcd600b99e..ddb0aaa0c4 100644 --- a/invokeai/backend/image_util/depth_anything/__init__.py +++ b/invokeai/backend/image_util/depth_anything/__init__.py @@ -84,7 +84,7 @@ class DepthAnythingDetector: self.model.to(device) return self - def __call__(self, image, resolution=512, offload=False): + def __call__(self, image, resolution=512): image = np.array(image, dtype=np.uint8) image = image[:, :, ::-1] / 255.0 @@ -103,7 +103,4 @@ class DepthAnythingDetector: new_height = int(image_height * (resolution / image_width)) depth_map = depth_map.resize((resolution, new_height)) - if offload: - del self.model - return depth_map