From 8515d963286550db1d7189fec229629acde5d6d3 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 6 Mar 2023 01:48:18 -0500 Subject: [PATCH] It's more logical for the StyleModelApply to append it directly. --- nodes.py | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/nodes.py b/nodes.py index 112c9ea8..84510a05 100644 --- a/nodes.py +++ b/nodes.py @@ -425,33 +425,20 @@ class StyleModelLoader: class StyleModelApply: @classmethod def INPUT_TYPES(s): - return {"required": {"clip_vision_output": ("CLIP_VISION_OUTPUT", ), - "style_model": ("STYLE_MODEL", ) + return {"required": {"conditioning": ("CONDITIONING", ), + "style_model": ("STYLE_MODEL", ), + "clip_vision_output": ("CLIP_VISION_OUTPUT", ), }} RETURN_TYPES = ("CONDITIONING",) FUNCTION = "apply_stylemodel" CATEGORY = "conditioning/style_model" - def apply_stylemodel(self, clip_vision_output, style_model): - c = style_model.get_cond(clip_vision_output) - return ([[c, {}]], ) - - -class ConditioningAppend: - @classmethod - def INPUT_TYPES(s): - return {"required": {"conditioning_to": ("CONDITIONING", ), "conditioning_from": ("CONDITIONING", )}} - RETURN_TYPES = ("CONDITIONING",) - FUNCTION = "append" - - CATEGORY = "conditioning/style_model" - - def append(self, conditioning_to, conditioning_from): + def apply_stylemodel(self, clip_vision_output, style_model, conditioning): + cond = style_model.get_cond(clip_vision_output) c = [] - to_append = conditioning_from[0][0] - for t in conditioning_to: - n = [torch.cat((t[0],to_append), dim=1), t[1].copy()] + for t in conditioning: + n = [torch.cat((t[0], cond), dim=1), t[1].copy()] c.append(n) return (c, ) @@ -952,8 +939,7 @@ NODE_CLASS_MAPPINGS = { "LoraLoader": LoraLoader, "CLIPLoader": CLIPLoader, "CLIPVisionEncode": CLIPVisionEncode, - "StyleModelApply":StyleModelApply, - "ConditioningAppend":ConditioningAppend, + "StyleModelApply": StyleModelApply, "ControlNetApply": ControlNetApply, "ControlNetLoader": ControlNetLoader, "DiffControlNetLoader": DiffControlNetLoader,