diff --git a/comfy_extras/nodes_clip_sdxl.py b/comfy_extras/nodes_clip_sdxl.py index 4ed4352b2..b8e241578 100644 --- a/comfy_extras/nodes_clip_sdxl.py +++ b/comfy_extras/nodes_clip_sdxl.py @@ -17,10 +17,7 @@ class CLIPTextEncodeSDXLRefiner: def encode(self, clip, ascore, width, height, text): tokens = clip.tokenize(text) - if clip.use_clip_schedule: - return (clip.encode_from_tokens_scheduled(tokens, add_dict={"aesthetic_score": ascore, "width": width, "height": height}), ) - cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True) - return ([[cond, clip.add_hooks_to_dict({"pooled_output": pooled, "aesthetic_score": ascore, "width": width,"height": height})]], ) + return (clip.encode_from_tokens_scheduled(tokens, add_dict={"aesthetic_score": ascore, "width": width, "height": height}), ) class CLIPTextEncodeSDXL: @classmethod @@ -49,10 +46,7 @@ class CLIPTextEncodeSDXL: tokens["l"] += empty["l"] while len(tokens["l"]) > len(tokens["g"]): tokens["g"] += empty["g"] - if clip.use_clip_schedule: - return (clip.encode_from_tokens_scheduled(tokens, add_dict={"width": width, "height": height, "crop_w": crop_w, "crop_h": crop_h, "target_width": target_width, "target_height": target_height}), ) - cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True) - return ([[cond, clip.add_hooks_to_dict({"pooled_output": pooled, "width": width, "height": height, "crop_w": crop_w, "crop_h": crop_h, "target_width": target_width, "target_height": target_height})]], ) + return (clip.encode_from_tokens_scheduled(tokens, add_dict={"width": width, "height": height, "crop_w": crop_w, "crop_h": crop_h, "target_width": target_width, "target_height": target_height}), ) NODE_CLASS_MAPPINGS = { "CLIPTextEncodeSDXLRefiner": CLIPTextEncodeSDXLRefiner, diff --git a/comfy_extras/nodes_flux.py b/comfy_extras/nodes_flux.py index 1c5c3b0cf..2ae23f735 100644 --- a/comfy_extras/nodes_flux.py +++ b/comfy_extras/nodes_flux.py @@ -18,12 +18,7 @@ class CLIPTextEncodeFlux: tokens = clip.tokenize(clip_l) tokens["t5xxl"] = clip.tokenize(t5xxl)["t5xxl"] - if clip.use_clip_schedule: - return (clip.encode_from_tokens_scheduled(tokens, add_dict={"guidance": guidance}), ) - output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True) - cond = output.pop("cond") - output["guidance"] = guidance - return ([[cond, output]], ) + return (clip.encode_from_tokens_scheduled(tokens, add_dict={"guidance": guidance}), ) class FluxGuidance: @classmethod diff --git a/comfy_extras/nodes_hunyuan.py b/comfy_extras/nodes_hunyuan.py index 38988aaa6..2bd295e24 100644 --- a/comfy_extras/nodes_hunyuan.py +++ b/comfy_extras/nodes_hunyuan.py @@ -15,11 +15,7 @@ class CLIPTextEncodeHunyuanDiT: tokens = clip.tokenize(bert) tokens["mt5xl"] = clip.tokenize(mt5xl)["mt5xl"] - if clip.use_clip_schedule: - return (clip.encode_from_tokens_scheduled(tokens), ) - output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True) - cond = output.pop("cond") - return ([[cond, output]], ) + return (clip.encode_from_tokens_scheduled(tokens), ) NODE_CLASS_MAPPINGS = { diff --git a/comfy_extras/nodes_sd3.py b/comfy_extras/nodes_sd3.py index 11168c7ae..d75b29e60 100644 --- a/comfy_extras/nodes_sd3.py +++ b/comfy_extras/nodes_sd3.py @@ -82,10 +82,7 @@ class CLIPTextEncodeSD3: tokens["l"] += empty["l"] while len(tokens["l"]) > len(tokens["g"]): tokens["g"] += empty["g"] - if clip.use_clip_schedule: - return (clip.encode_from_tokens_scheduled(tokens), ) - cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True) - return ([[cond, clip.add_hooks_to_dict({"pooled_output": pooled})]], ) + return (clip.encode_from_tokens_scheduled(tokens), ) class ControlNetApplySD3(nodes.ControlNetApplyAdvanced): diff --git a/nodes.py b/nodes.py index 26f64e305..c658156ad 100644 --- a/nodes.py +++ b/nodes.py @@ -62,11 +62,7 @@ class CLIPTextEncode: def encode(self, clip, text): tokens = clip.tokenize(text) - if clip.use_clip_schedule: - return (clip.encode_from_tokens_scheduled(tokens), ) - output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True) - cond = output.pop("cond") - return ([[cond, output]], ) + return (clip.encode_from_tokens_scheduled(tokens), ) class ConditioningCombine: