🟠Cond → Dict🗂️
Bundle Your Conditioning Into the Bus
- dict
- value
- dict
Conditioning is the trickiest thing to keep track of in a big workflow: positive and negative prompts each produce a CONDITIONING object, and if you've got multiple sampler stages you end up with a pile of them. DictAddCond stashes one into your dict under a named key, so the conditioning for stage one and stage two ride along instead of sprawling across the canvas.
Where the bool/int/float Add nodes carry their value as a widget, this one works the way the media types do: the CONDITIONING value is a wired input. You feed it from your CLIP Text Encode (or from whatever produced the conditioning you care about), and it gets validated against the expected type before being stored.
How it works
Standard Dict Tools mechanics: the value is checked (a real CONDITIONING object - the list of token embeddings plus pooled output that ComfyUI samples against), stored under your key, and the node returns a new frozendict. Your input dict is never mutated, so chaining Add nodes is safe. Keys sort alphabetically on update.
The practical payoff is the "override" pattern: build a base dict with your default conditioning, then a second dict whose keys overwrite just the conditioning for one stage. Apply it downstream and you've swapped a whole stage's prompt behavior with one connection.
The inputs that matter
- key (STRING) - the name you'll fetch this conditioning 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 (CONDITIONING, optional) - the wired conditioning object from your text encoder.
Output is dict (DICT). Pair it with DictExtractCond when you need the conditioning back at a sampler.
Install
ComfyUI Manager: search Dict Tools, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart after. The only dependency is frozendict, handled by Manager.
Gotchas
Pack-wide: requires ComfyUI 0.18.0+ (newer node API). Failed to load means update ComfyUI.
The trap specific to conditioning: it's easy to wire the wrong thing because the input is optional and unlabeled visually beyond the type. If you get a TypeError ("Value isn't a <Cond> instance"), check that you're feeding the output of a text encoder, not, say, a string. And when you extract, remember the dict holds a snapshot - if you modify the conditioning later, the copy in the dict won't know about it.
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 | CONDITIONING | The actual Cond-type item to add into the Dict. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict | DICT | — |