mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Make GroundedSAMInvocation work with any input image mode (RGB, RGBA, grayscale).
This commit is contained in:
parent
918f77bce0
commit
6b10b59abe
@ -60,7 +60,8 @@ class GroundedSAMInvocation(BaseInvocation):
|
||||
|
||||
@torch.no_grad()
|
||||
def invoke(self, context: InvocationContext) -> ImageOutput:
|
||||
image_pil = context.images.get_pil(self.image.image_name)
|
||||
# The models expect a 3-channel RGB image.
|
||||
image_pil = context.images.get_pil(self.image.image_name, mode="RGB")
|
||||
|
||||
detections = self._detect(
|
||||
context=context, image=image_pil, labels=[self.prompt], threshold=self.detection_threshold
|
||||
|
Loading…
Reference in New Issue
Block a user