More flexibility with text encoder return values.

Text encoders can now return other values to the CONDITIONING than the cond
and pooled output.
This commit is contained in:
comfyanonymous
2024-07-10 20:06:50 -04:00
parent e44fa5667f
commit 391c1046cf
3 changed files with 30 additions and 8 deletions

View File

@@ -55,8 +55,9 @@ class CLIPTextEncode:
def encode(self, clip, text):
tokens = clip.tokenize(text)
cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True)
return ([[cond, {"pooled_output": pooled}]], )
output = clip.encode_from_tokens(tokens, return_pooled=True, return_dict=True)
cond = output.pop("cond")
return ([[cond, output]], )
class ConditioningCombine:
@classmethod