Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
6225a782
Commit
6225a782
authored
Jul 26, 2024
by
comfyanonymous
Browse files
Add CLIPTextEncodeHunyuanDiT.
Useful for testing what each text encoder does.
parent
b6779d8d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
comfy_extras/nodes_hunyuan.py
comfy_extras/nodes_hunyuan.py
+24
-0
nodes.py
nodes.py
+1
-0
No files found.
comfy_extras/nodes_hunyuan.py
0 → 100644
View file @
6225a782
class
CLIPTextEncodeHunyuanDiT
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"clip"
:
(
"CLIP"
,
),
"bert"
:
(
"STRING"
,
{
"multiline"
:
True
,
"dynamicPrompts"
:
True
}),
"mt5xl"
:
(
"STRING"
,
{
"multiline"
:
True
,
"dynamicPrompts"
:
True
}),
}}
RETURN_TYPES
=
(
"CONDITIONING"
,)
FUNCTION
=
"encode"
CATEGORY
=
"advanced/conditioning"
def
encode
(
self
,
clip
,
bert
,
mt5xl
):
tokens
=
clip
.
tokenize
(
bert
)
tokens
[
"mt5xl"
]
=
clip
.
tokenize
(
mt5xl
)[
"mt5xl"
]
output
=
clip
.
encode_from_tokens
(
tokens
,
return_pooled
=
True
,
return_dict
=
True
)
cond
=
output
.
pop
(
"cond"
)
return
([[
cond
,
output
]],
)
NODE_CLASS_MAPPINGS
=
{
"CLIPTextEncodeHunyuanDiT"
:
CLIPTextEncodeHunyuanDiT
,
}
nodes.py
View file @
6225a782
...
@@ -2037,6 +2037,7 @@ def init_builtin_extra_nodes():
...
@@ -2037,6 +2037,7 @@ def init_builtin_extra_nodes():
"nodes_sd3.py"
,
"nodes_sd3.py"
,
"nodes_gits.py"
,
"nodes_gits.py"
,
"nodes_controlnet.py"
,
"nodes_controlnet.py"
,
"nodes_hunyuan.py"
,
]
]
import_failed
=
[]
import_failed
=
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment