File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ class CLIPTextEncodeHunyuanDiT :
2+ @classmethod
3+ def INPUT_TYPES (s ):
4+ return {"required" : {
5+ "clip" : ("CLIP" , ),
6+ "bert" : ("STRING" , {"multiline" : True , "dynamicPrompts" : True }),
7+ "mt5xl" : ("STRING" , {"multiline" : True , "dynamicPrompts" : True }),
8+ }}
9+ RETURN_TYPES = ("CONDITIONING" ,)
10+ FUNCTION = "encode"
11+
12+ CATEGORY = "advanced/conditioning"
13+
14+ def encode (self , clip , bert , mt5xl ):
15+ tokens = clip .tokenize (bert )
16+ tokens ["mt5xl" ] = clip .tokenize (mt5xl )["mt5xl" ]
17+
18+ output = clip .encode_from_tokens (tokens , return_pooled = True , return_dict = True )
19+ cond = output .pop ("cond" )
20+ return ([[cond , output ]], )
21+
22+ NODE_CLASS_MAPPINGS = {
23+ "CLIPTextEncodeHunyuanDiT" : CLIPTextEncodeHunyuanDiT ,
24+ }
Original file line number Diff line number Diff line change @@ -2037,6 +2037,7 @@ def init_builtin_extra_nodes():
20372037 "nodes_sd3.py" ,
20382038 "nodes_gits.py" ,
20392039 "nodes_controlnet.py" ,
2040+ "nodes_hunyuan.py" ,
20402041 ]
20412042
20422043 import_failed = []
You can’t perform that action at this time.
0 commit comments