Nodes/🗂️ Dict Tools/🔴VAE → Dict🗂️
ComfyUI Node

🔴VAE → Dict🗂️

Keep your VAE from being the wildcard

By Lex-DRL·Created 4 months ago·Updated 4 months ago· 1
🔴VAE → Dict🗂️
  • dict
  • value
  • dict
◄key—►
â—„cleanup_keytrueâ–ş

The VAE is the quiet troublemaker of ComfyUI workflows. It lives on the decode side, it changes how colors come out, and it's easy to end up with two different VAEs feeding different save branches - usually by accident, and usually right when you're chasing a weird tint. DictAddVae ("🔴VAE → Dict🗂️") is the fix for that: load your VAE once, put it in a dictionary under a key, and let every decode in the graph pull from the same slot.

Think of it as the models-bus pattern, applied to the one model that's easiest to forget. A typical setup: one DictAddVae near the top of the workflow, key vae, value from a VAE Loader. Downstream, each VAE Decode gets its VAE from a DictExtractVae node reading that same key. Change the loader once, every decode follows. No more hunting through the graph for the second VAE Loader you added three months ago.

What you set

  • key - the slot name, e.g. vae or vae_main.
  • cleanup_key (on by default) - strips stray spaces and newlines, so the key is normalized.
  • value - the VAE. An optional input of type VAE, fed from a VAE Loader or a checkpoint that carries one.
  • dict (optional) - an existing dictionary to merge into.

One dict output, chainable with other DictAdd* nodes so you can build one bus that carries the VAE, the CLIP, the model, and the seed all at once.

How it works

The value gets type-checked before it's stored - a real VAE goes in, and anything that isn't one gets refused. The dict comes back immutable (a frozendict) with keys kept in alphabetical order. Both of those are deliberate and both make the bus safer to share: no downstream node can mutate the dict out from under its siblings, and the ordering never matters because you address slots by name.

Honest caveat: if your workflow has exactly one VAE Decode and you never touch it, this node is overhead. It starts paying rent when you have multiple encode/decode branches, img2img passes, or an upscale stage that re-decodes - anywhere the same VAE has to be threaded through several consumers.

Install

Standard for this pack. It's a small pack by Lex Darlog with a single lightweight dependency (frozendict), no model downloads - you bring your own VAE. ComfyUI Manager: search "Dict Tools". Or by hand:

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

Restart ComfyUI. The pack uses the newer ComfyUI extension API, so it needs 0.18.0+; if you install and see nothing in the node menu, update ComfyUI and restart before troubleshooting anything else.

Common issues

The one bug you'll hit eventually is a key mismatch on extraction - extract vae from a dict where you stored it as vae_main and you get a hard "No such key in Dict" error. That's intentional, not a crash bug: it forces you to notice the mismatch instead of silently decoding with a wrong or absent VAE. Keep your slot names in one place in your head (or a note node) and you'll be fine. There's no built-in dict inspector, so if you need to confirm what's inside, extract the value and preview it, or pair the pack with Basic Data Handling for full dict tooling. It's a small node with a small job - keeping the one thing everyone forgets consistent.

Category🗂️ Dict Tools/Add/Models

Inputs (4)

NameTypeDefaultDescription
keySTRINGKey (name) of the item inserted into the dict.
cleanup_keyBOOLEANtrueAutomatically remove leading/trailing spaces and extra newlines from the key.
dictoptDICTAn (optional) Dictionary to work with.
valueoptVAEThe actual VAE-type item to add into the Dict.

Outputs (1)

NameTypeDescription
dictDICT—