Download comfy_extras/nodes_cond.py from fotographerai/Zen-Style-Shape: direct link, hf CLI and curl.
- Browser
- Download file 806 Bytes
-
https://huggingface.co/spaces/fotographerai/Zen-Style-Shape/resolve/a8e42f9c629cb3adc0232d23fc09d1e375af4f5b/comfy_extras/nodes_cond.py
- Command line
-
hf download hf://spaces/fotographerai/Zen-Style-Shape@a8e42f9c629cb3adc0232d23fc09d1e375af4f5b/comfy_extras/nodes_cond.py
-
curl -L -o nodes_cond.py https://huggingface.co/spaces/fotographerai/Zen-Style-Shape/resolve/a8e42f9c629cb3adc0232d23fc09d1e375af4f5b/comfy_extras/nodes_cond.py
806 Bytes
| class CLIPTextEncodeControlnet: | |
| def INPUT_TYPES(s): | |
| return {"required": {"clip": ("CLIP", ), "conditioning": ("CONDITIONING", ), "text": ("STRING", {"multiline": True, "dynamicPrompts": True})}} | |
| RETURN_TYPES = ("CONDITIONING",) | |
| FUNCTION = "encode" | |
| CATEGORY = "_for_testing/conditioning" | |
| def encode(self, clip, conditioning, text): | |
| tokens = clip.tokenize(text) | |
| cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True) | |
| c = [] | |
| for t in conditioning: | |
| n = [t[0], t[1].copy()] | |
| n[1]['cross_attn_controlnet'] = cond | |
| n[1]['pooled_output_controlnet'] = pooled | |
| c.append(n) | |
| return (c, ) | |
| NODE_CLASS_MAPPINGS = { | |
| "CLIPTextEncodeControlnet": CLIPTextEncodeControlnet | |
| } | |