Griptape Create: Key Value Pair
The Building Block of {{ template }} Replacement
- DICT
Griptape Create: Key Value Pair makes one dictionary entry: a key, a value, bundled into a tiny {key: value} dict. On its own it does almost nothing. But it's the atomic unit behind the pack's template-replacement feature - the thing that turns prompts with {{ placeholders }} into prompts with real text. Almost every agent and task node in ComfyUI-Griptape has a key_value_replacement input, and this is the node that feeds it.
What it's for
Griptape prompts support Jinja-style placeholders. Write Describe {{ subject }} in the style of {{ artist }} in an agent's STRING field, and those keys get filled from a context dictionary. The workflow for doing that is:
- Create Key Value Pair per variable - one node with
key = subject,value = "a black cat", another withkey = artist,value = "Van Gogh". - Griptape Combine: Merge Dictionary merges them into one dict.
- That dict goes into
key_value_replacementon the agent/task node.
Result: a reusable template prompt where the variables come from nodes - which means they can be driven by other nodes, loaded from files, or changed without touching the prompt text. That's the entire appeal: prompts become templates, data stays data.
How it works
It's a two-field form that returns a one-entry dict:
return ({key: value},)
There's no validation, no type handling, no magic. Empty key? You get {"": "..."}. The value field is multiline, so multi-paragraph values work fine - useful when injecting whole passages into a prompt.
Inputs and output
key(STRING) - the placeholder name, minus the braces. Use the same word you put inside{{ }}in your prompt.value(STRING, multiline) - the text that replaces the placeholder.- Output:
DICT- a single key-value dict, for Merge Dictionary or straight into anyDICTinput.
Installation
Part of ComfyUI Griptape Nodes:
- ComfyUI Manager: search "Griptape" → install.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/griptape-ai/ComfyUI-Griptape, restart ComfyUI.
Pure data node - no API key, no LLM, no network. Installing the pack is the only setup.
Gotchas
- The key must match the placeholder exactly (case-sensitive).
{{ Subject }}won't be filled by a key ofsubject. This is the #1 way people think the feature is broken when it isn't. - One node = one pair. For several variables you'll want several of these plus a Merge Dictionary - that's the intended pattern, not a workaround.
- Values are strings. If you want a number or a list injected, you're stringifying it - fine for prompts, wrong for data you need typed.
Small, boring, and quietly essential. Every "prompt template with variables" workflow in this pack runs on these nodes.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| keyopt | STRING | — | |
| valueopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DICT | DICT | — |