bbbboiwow's picture
Upload folder using huggingface_hub
edb09f2 verified
Raw
History Blame Contribute Delete
828 Bytes
class ConditionText:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"clip": ("CLIP",),
"text": (
"STRING",
{"forceInput": True},
),
}
}
RETURN_TYPES = (
"CLIP",
"CONDITIONING",
)
FUNCTION = "conditiontext"
CATEGORY = "Chibi-Nodes/Text"
def conditiontext(self, clip, text=None):
if text is not None:
tokens = clip.tokenize(text)
else:
tokens = clip.tokenize("")
cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True)
return (
clip,
[[cond, {"pooled_output": pooled}]],
)