🗂️Dict → CLIP🟡
One CLIP, shared across every text encoder
- dict
- value
In a serious workflow you rarely encode one prompt. Positive, negative, maybe a second pass with different text, a style prompt for an IPAdapter - each one needs a CLIP encoder, and if you're not careful you end up with a separate CLIP Loader per branch, all loading the same model into VRAM over and over. DictExtractClip ("🗂️Dict → CLIP🟡") is the tidy answer: load the CLIP once, store it in a dict, and extract it wherever a text encode needs it.
This is the models-bus pattern doing real work. The CLIP is a model, models are exactly what you want to load once and share, and the dict gives you a single wire to carry it. A typical layout: one Checkpoint Loader (or CLIP Loader) near the top, a DictAddClip putting it in the bus under key clip, and then a DictExtractClip at each CLIP Text Encode feeding it the same yellow wire. One load, many consumers, zero duplicate loaders.
What you set
- dict (required) - the dictionary to read from (non-empty).
- key - the slot where the CLIP lives.
- cleanup_key (on by default) - normalizes the key.
Output: value as the CLIP type, wired straight into CLIP Text Encode, CLIP Set Last Layer, or anything else that takes a CLIP.
Why it works
The extractor validates on the way out: what you pull must actually be a CLIP, so if you stored something else under clip you get a clear type error instead of a confusing failure two nodes later. Because the pack's dicts are immutable frozendicts, sharing the same CLIP wire across several text encoders is safe - no downstream node can clobber the shared reference out from under its siblings.
The honest limitation: this earns its keep with multiple text encodes or a genuinely modular workflow. A single prompt, single encode? A straight wire is clearer, and nobody will judge you for it. The moment you've got three CLIP Text Encode nodes all pulling the same model, this node is the difference between a clean graph and a wall of red "missing CLIP" wires.
Install
Same for the whole pack - small, one lightweight dependency (frozendict), no model downloads (the CLIP itself comes from your checkpoint or CLIP loader). ComfyUI Manager: search "Dict Tools". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart ComfyUI. The pack uses the newer extension API, so it needs 0.18.0+; if the nodes don't show up after install, update ComfyUI before anything else. And remember - extracting a key that doesn't exist raises "No such key in Dict" rather than silently returning nothing, so keep your slot names consistent.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| dict | DICT | A Dictionary to work with. | |
| key | STRING | Key (name) of the item extracted from the dict. | |
| cleanup_key | BOOLEAN | true | Automatically remove leading/trailing spaces and extra newlines from the key. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | CLIP | The actual CLIP-type item extracted from the Dict. |