From 10b7a588878ac5bc9d59ec281b2333cbb318e2bd Mon Sep 17 00:00:00 2001 From: user1 Date: Sat, 29 Apr 2023 19:40:22 -0700 Subject: [PATCH] Added first controlnet preprocessor node for canny edge detection. --- invokeai/app/invocations/controlnet_image_processors.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/invokeai/app/invocations/controlnet_image_processors.py b/invokeai/app/invocations/controlnet_image_processors.py index 4eee4d7222..51784134b5 100644 --- a/invokeai/app/invocations/controlnet_image_processors.py +++ b/invokeai/app/invocations/controlnet_image_processors.py @@ -1,9 +1,10 @@ # InvokeAI nodes for ControlNet image preprocessors # initial implementation by Gregg Helt, 2023 # heavily leverages controlnet_aux package: https://github.com/patrickvonplaten/controlnet_aux -import numpy as np +import numpy as np from typing import Literal, Optional, Union, List +from PIL import Image, ImageFilter, ImageOps from pydantic import BaseModel, Field from ..models.image import ImageField, ImageType @@ -125,7 +126,7 @@ class ImageProcessorInvocation(BaseInvocation, PILInvocationConfig): width=processed_image.width, height=processed_image.height, mode=processed_image.mode, - ) + ) class CannyImageProcessorInvocation(ImageProcessorInvocation, PILInvocationConfig): @@ -334,3 +335,4 @@ class ZoeDepthImageProcessorInvocation(ImageProcessorInvocation, PILInvocationCo zoe_depth_processor = ZoeDetector.from_pretrained("lllyasviel/Annotators") processed_image = zoe_depth_processor(image) return processed_image +