From 6436b833f554744bee28b7e37035a6d76cde8413 Mon Sep 17 00:00:00 2001 From: vladmandic Date: Thu, 12 Mar 2026 14:16:51 +0100 Subject: [PATCH] merge: modules/control/proc/teed/__init__.py --- modules/control/proc/teed/__init__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/control/proc/teed/__init__.py diff --git a/modules/control/proc/teed/__init__.py b/modules/control/proc/teed/__init__.py new file mode 100644 index 000000000..2f0ab310b --- /dev/null +++ b/modules/control/proc/teed/__init__.py @@ -0,0 +1,21 @@ +import numpy as np +from PIL import Image + + +class TEEDDetector: + def __init__(self, model): + self.model = model + + @classmethod + def from_pretrained(cls, pretrained_model_or_path="fal/teed", cache_dir=None, local_files_only=False): + from installer import install + install('controlnet-aux', quiet=True) + from controlnet_aux import TEEDdetector as _TEEDdetector + model = _TEEDdetector.from_pretrained(pretrained_model_or_path, filename="5_model.pth", cache_dir=cache_dir) + return cls(model) + + def __call__(self, image, output_type="pil", **kwargs): + if isinstance(image, np.ndarray): + image = Image.fromarray(image) + result = self.model(image, output_type=output_type) + return result