|
|
|
@ -232,6 +232,24 @@ class ControlNetLoader:
|
|
|
|
|
controlnet = comfy.sd.load_controlnet(controlnet_path) |
|
|
|
|
return (controlnet,) |
|
|
|
|
|
|
|
|
|
class DiffControlNetLoader: |
|
|
|
|
models_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "models") |
|
|
|
|
controlnet_dir = os.path.join(models_dir, "controlnet") |
|
|
|
|
@classmethod |
|
|
|
|
def INPUT_TYPES(s): |
|
|
|
|
return {"required": { "model": ("MODEL",), |
|
|
|
|
"control_net_name": (filter_files_extensions(recursive_search(s.controlnet_dir), supported_pt_extensions), )}} |
|
|
|
|
|
|
|
|
|
RETURN_TYPES = ("CONTROL_NET",) |
|
|
|
|
FUNCTION = "load_controlnet" |
|
|
|
|
|
|
|
|
|
CATEGORY = "loaders" |
|
|
|
|
|
|
|
|
|
def load_controlnet(self, model, control_net_name): |
|
|
|
|
controlnet_path = os.path.join(self.controlnet_dir, control_net_name) |
|
|
|
|
controlnet = comfy.sd.load_controlnet(controlnet_path, model) |
|
|
|
|
return (controlnet,) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ControlNetApply: |
|
|
|
|
@classmethod |
|
|
|
@ -770,6 +788,7 @@ NODE_CLASS_MAPPINGS = {
|
|
|
|
|
"CLIPLoader": CLIPLoader, |
|
|
|
|
"ControlNetApply": ControlNetApply, |
|
|
|
|
"ControlNetLoader": ControlNetLoader, |
|
|
|
|
"DiffControlNetLoader": DiffControlNetLoader, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CUSTOM_NODE_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "custom_nodes") |
|
|
|
|