Nodes/🗂️ Dict Tools/🗂️Dict → Cond🟠
ComfyUI Node

🗂️Dict → Cond🟠

Your conditioning, extracted on demand

By Lex-DRL·Created 4 months ago·Updated 4 months ago· 1
🗂️Dict → Cond🟠
  • dict
  • value
key
cleanup_keytrue

Conditioning is the payload every sampler actually eats: the encoded positive and negative prompts, plus any ControlNet or regional patches riding along. In a busy workflow you'll have several of these orange CONDITIONING wires - main pass, a second pass, an img2img variant - and they all terminate at a KSampler. DictExtractCond ("🗂️Dict → Cond🟠") is how you carry conditioning inside the dict bus and hand it to a sampler when it's time.

The pattern that makes this shine: build your conditioning up top, put each variant in the dict under a distinct key (cond_main, cond_neg, cond_pass2), pass the dict down through the graph, and extract the right one at each KSampler's positive/negative input. Your prompt-encoding section - usually a wall of CLIP Text Encode nodes - collapses into one tidy block whose outputs are just keys. Change the prompt in one place, and every sampler that reads cond_main follows.

What you set

  • dict (required) - the dictionary to read from (non-empty).
  • key - the conditioning slot you want.
  • cleanup_key (on by default) - normalizes the key.

Output: value as CONDITIONING, wired straight into a KSampler's positive or negative input, or into any node that takes conditioning.

Why you'd bother

Honestly, conditioning is heavier than a string, so the payoff is organization, not memory - the dict bus is about taming spaghetti, not saving RAM. Where it genuinely wins: workflows with several sampling passes that share the same encoded prompts. Instead of duplicating the entire CLIP-encode stack for each pass, you encode once, key each output, and let every KSampler extract what it needs. Fewer nodes, fewer chances for two branches to drift out of sync with different prompts.

The extractor validates that what comes back is real conditioning - if you stored something else under the key, you get a clear type error instead of a sampler failing cryptically. And because the dicts are immutable frozendicts, handing the same conditioning wire to two samplers is safe; nobody can mutate it out from under you.

Install

Same for the whole pack - small, one lightweight dependency (frozendict), no model downloads. ComfyUI Manager: search "Dict Tools". Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools

Restart ComfyUI. Needs 0.18.0+ (newer extension API) - if the nodes don't appear, update ComfyUI first. And yes: a missing key raises "No such key in Dict" rather than returning nothing, so keep your key names consistent or the sampler will know before you do.

Category🗂️ Dict Tools/Extract

Inputs (3)

NameTypeDefaultDescription
dictDICTA Dictionary to work with.
keySTRINGKey (name) of the item extracted from the dict.
cleanup_keyBOOLEANtrueAutomatically remove leading/trailing spaces and extra newlines from the key.

Outputs (1)

NameTypeDescription
valueCONDITIONINGThe actual Cond-type item extracted from the Dict.