🟡CLIP → Dict🗂️
Carry the Text Encoder in Your Bus
- dict
- value
- dict
The CLIP model is the text encoder that turns your prompt into embeddings, and on a modern checkpoint it's one of several heavy objects that come out of the loader. DictAddCLIP - the pack spells the node DictAddClip - stores it in your dict under a named key, so the text encoder rides the bus alongside the model instead of being wired by hand to every text encoder node.
It's one of the "model type" Add nodes, grouped under Add/Models in the pack menu. The CLIP value is a wired input from your Checkpoint Loader (or a CLIP Loader), and it's validated against the actual CLIP type before storage. If you're building a reusable sub-graph that takes a dict in and produces a sampling result, this is how the encoder gets in.
How it works
Same Dict Tools engine as every Add node: validate the CLIP value, store under the key, return a new frozendict (your input is never mutated), and sort keys alphabetically on update. The heavy object is stored by reference, not copied - the dict just keeps a handle to the loaded encoder, so this costs you basically nothing in memory.
The inputs that matter
- key (STRING) - the name you'll fetch the encoder back by.
- cleanup_key (BOOL, default on) - trims spaces/newlines from the key.
- dict (DICT, optional) - an existing dict to extend, or empty to start one.
- value (CLIP, optional) - the wired CLIP from your checkpoint or CLIP loader.
Output is dict (DICT). Get it back with DictExtractClip.
Install
ComfyUI Manager: search Dict Tools, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart after. Only dependency is frozendict, handled by Manager.
Gotchas
Pack-wide: needs ComfyUI 0.18.0+ (newer node API). Failed to load → update ComfyUI.
Model-type gotcha worth knowing: if you extract the CLIP and then feed it through a LoRA or a different loader, the original encoder in the dict is unchanged - dicts hold snapshots of references. Re-add the patched version if the bus should carry it. And the type check is strict: pass a MODEL where a CLIP belongs and you'll get a loud "isn't a <CLIP> instance" error, which is at least unambiguous.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | Key (name) of the item inserted into the dict. | |
| cleanup_key | BOOLEAN | true | Automatically remove leading/trailing spaces and extra newlines from the key. |
| dictopt | DICT | An (optional) Dictionary to work with. | |
| valueopt | CLIP | The actual CLIP-type item to add into the Dict. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict | DICT | — |