Nodes/ComfyUI Griptape Nodes/Griptape Create: CLIP Text Encode
ComfyUI Node

Griptape Create: CLIP Text Encode

Type a prompt, get conditioning — with Griptape's {{variable}} templating

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Create: CLIP Text Encode
  • key_value_replacement
  • clip
  • OUTPUT
STRING
input_string

Griptape Create: CLIP Text Encode is the all-in-one text-to-conditioning node from the Griptape pack. You type a prompt, it tokenizes it with your CLIP model, and hands you ready-to-use CONDITIONING for the KSampler. Where the sibling Convert: Text to CLIP Encode demands text come in over a wire, this one lets you write inline - or mix both.

So when do you pick this over ComfyUI's built-in CLIPTextEncode? Two reasons. The first is the {{key}} template replacement: the node accepts a dictionary and swaps placeholder keys in your prompt for values. That turns a single prompt node into a reusable template - drop a character name, an art style, or a seed-derived token into the text at run time instead of hand-editing. The second is that it composes naturally with the rest of the Griptape graph, which is handy when your "prompt" is half-typed, half-generated.

How it works

The node merges two text sources into one prompt, then encodes it. In the source it calls get_prompt_text(STRING, input_string) to build the final string, applies the key-value replacement, then runs the standard encode:

tokens = clip.tokenize(prompt_text)
cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True)
return ([[cond, {"pooled_output": pooled}]],)

The key_value_replacement input is where the templating happens - a dictionary where each key maps to a value, and any {{ key }} in your prompt text gets replaced with that value. This is the same mechanism the pack uses across its merge and agent-prompting nodes, so once you get the hang of it, it's everywhere.

Inputs that matter

  • STRING - required, multiline; your main prompt text. Supports {{key}} placeholders.
  • input_string - optional second text input, also multiline, that gets merged into the final prompt. Useful for splicing in text from another node.
  • key_value_replacement - optional DICT; the key→value map for template substitution. Feed it the output of Griptape Create: Key Value Pair or Griptape Combine: Merge Dictionary.
  • clip - optional CLIP input. If you leave it unwired, the node has no encoder and won't produce conditioning, so in practice you always connect your checkpoint's CLIP here.

Output is CONDITIONING, straight into the sampler's positive or negative input. No API key, no network, no Griptape agent required - it's pure ComfyUI-side encoding.

Install

Same pack as everything else here - ComfyUI Manager, search "Griptape", or:

cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape

The pack's requirements.txt installs griptape[all] and python-dotenv, plus an openai pin. If you hit torch errors afterward on Nvidia, reinstall torch from the cu121 index per the README.

Common gotchas

The templating only triggers on exact {{ key }} syntax - if your dictionary says name but the prompt says {{name}} without braces, nothing gets swapped. And the clip input being "optional" in the schema is a lie in practice: without it you get no output. Finally, remember the conditioning is CLIP conditioning - for flow-matching models with LLM text encoders (the newer generation), this node is aimed at classic CLIP pipelines, not those.

CategoryGriptape/Text

Inputs (4)

NameTypeDefaultDescription
STRINGSTRING
input_stringoptSTRING
key_value_replacementoptDICTThe will replace the {{ key }} with a value.
clipoptCLIP

Outputs (1)

NameTypeDescription
OUTPUTCONDITIONING