The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Add CLIPTextEncodeFlux.
comfyanonymousa531001cc772
diff --git a/comfy_extras/nodes_flux.py b/comfy_extras/nodes_flux.pynew file mode 100644index 000000000..6c1e8b0e0--- /dev/null+++ b/comfy_extras/nodes_flux.py@@ -0,0 +1,27 @@++class CLIPTextEncodeFlux:+ @classmethod+ def INPUT_TYPES(s):+ return {"required": {+ "clip": ("CLIP", ),+ "clip_l": ("STRING", {"multiline": True, "dynamicPrompts": True}),+ "t5xxl": ("STRING", {"multiline": True, "dynamicPrompts": True}),+ "guidance": ("FLOAT", {"default": 3.5, "min": 0.0, "max": 100.0, "step": 0.1}),+ }}+ RETURN_TYPES = ("CONDITIONING",)+ FUNCTION = "encode"++ CATEGORY = "advanced/conditioning"++ def encode(self, clip, clip_l, t5xxl, guidance):+ tokens = clip.tokenize(clip_l)+ tokens["t5xxl"] = clip.tokenize(t5xxl)["t5xxl"]++ output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True)+ cond = output.pop("cond")+ output["guidance"] = guidance+ return ([[cond, output]], )++NODE_CLASS_MAPPINGS = {+ "CLIPTextEncodeFlux": CLIPTextEncodeFlux,+}diff --git a/nodes.py b/nodes.pyindex 5b6321b69..1994f1190 100644--- a/nodes.py+++ b/nodes.py@@ -2043,6 +2043,7 @@ def init_builtin_extra_nodes():"nodes_gits.py","nodes_controlnet.py","nodes_hunyuan.py",+ "nodes_flux.py",]import_failed = []