Skip to content

Commit

Permalink
Update controlnet-aux to 0.0.6 and add LeReS
Browse files Browse the repository at this point in the history
  • Loading branch information
hipsterusername committed Jun 28, 2023
1 parent 862bfa2 commit fc322aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
44 changes: 22 additions & 22 deletions invokeai/app/invocations/controlnet_image_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
ZoeDetector,
MediapipeFaceDetector,
SamDetector,
# LeresDetector,
LeresDetector,
)

from controlnet_aux.util import HWC3, ade_palette
Expand Down Expand Up @@ -470,27 +470,27 @@ def run_processor(self, image):
processed_image = mediapipe_face_processor(image, max_faces=self.max_faces, min_confidence=self.min_confidence)
return processed_image

# class LeresImageProcessorInvocation(ImageProcessorInvocation, PILInvocationConfig):
# """Applies leres processing to image"""
# # fmt: off
# type: Literal["leres_image_processor"] = "leres_image_processor"
# # Inputs
# thr_a: float = Field(default=0, description="Leres parameter `thr_a`")
# thr_b: float = Field(default=0, description="Leres parameter `thr_b`")
# boost: bool = Field(default=False, description="Whether to use boost mode")
# detect_resolution: int = Field(default=512, ge=0, description="The pixel resolution for detection")
# image_resolution: int = Field(default=512, ge=0, description="The pixel resolution for the output image")
# # fmt: on
#
# def run_processor(self, image):
# leres_processor = LeresDetector.from_pretrained("lllyasviel/Annotators")
# processed_image = leres_processor(image,
# thr_a=self.thr_a,
# thr_b=self.thr_b,
# boost=self.boost,
# detect_resolution=self.detect_resolution,
# image_resolution=self.image_resolution)
# return processed_image
class LeresImageProcessorInvocation(ImageProcessorInvocation, PILInvocationConfig):
"""Applies leres processing to image"""
# fmt: off
type: Literal["leres_image_processor"] = "leres_image_processor"
# Inputs
thr_a: float = Field(default=0, description="Leres parameter `thr_a`")
thr_b: float = Field(default=0, description="Leres parameter `thr_b`")
boost: bool = Field(default=False, description="Whether to use boost mode")
detect_resolution: int = Field(default=512, ge=0, description="The pixel resolution for detection")
image_resolution: int = Field(default=512, ge=0, description="The pixel resolution for the output image")
# fmt: on

def run_processor(self, image):
leres_processor = LeresDetector.from_pretrained("lllyasviel/Annotators")
processed_image = leres_processor(image,
thr_a=self.thr_a,
thr_b=self.thr_b,
boost=self.boost,
detect_resolution=self.detect_resolution,
image_resolution=self.image_resolution)
return processed_image


class TileResamplerProcessorInvocation(ImageProcessorInvocation, PILInvocationConfig):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies = [
"click",
"clip_anytorch", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip",
"compel>=1.2.1",
"controlnet-aux>=0.0.5",
"controlnet-aux>=0.0.6",
"timm==0.6.13", # needed to override timm latest in controlnet_aux, see https://github.com/isl-org/ZoeDepth/issues/26
"datasets",
"diffusers[torch]~=0.17.1",
Expand Down

0 comments on commit fc322aa

Please sign in to comment.