🗂️Dict → Model🟣
Pull the Checkpoint Back Out of the Bus
- dict
- value
This is the "get it back out" end of a bus. You stuff a model into a dict with DictAddModel, drag the dict across half your graph, and when you actually need to sample, this node hands you the checkpoint again. That single wire replacing four or five others is the whole point of the Dict Tools pack - and of the 40-odd nodes in it, this one gets the most Google traffic. Makes sense: you add the model once and extract it in five places.
It's the destination for any workflow that wants to keep the checkpoint in one "container" alongside its seeds, prompts, and settings. Think of the dict as a bus running through your graph: build it once at the top, pass it around, and pull values off where they're needed instead of dragging wires from the loader to every consumer.
How it works
Dict Tools stores everything in a frozendict - an immutable dict. That matters here because it means extraction is read-only: pulling a value out never changes the dict, so the same dict can keep feeding other Extract nodes downstream. The node validates the value against the MODEL type (a ModelPatcher, i.e. the checkpoint you loaded) and raises a TypeError if the key holds something else.
The inputs that matter
Three inputs, all on the left:
- dict (DICT, required) - the dict you built upstream. Wire it from a DictAdd* node or any other dict-producing node in the pack.
- key (STRING) - the name you gave the model when you added it. This is the one you'll actually type.
- cleanup_key (BOOL, default on) - strips leading/trailing spaces and collapses extra newlines in the key. Leave it on; it's the author's safety net for sloppy typing.
Output is value (MODEL), which wires straight into KSampler, the model input of any sampler, or a LoRA stacker.
Install
ComfyUI Manager is the easy route: search for Dict Tools and hit install, then restart. Or clone by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Restart either way. The only Python dependency is frozendict, which Manager pulls automatically.
Gotchas
The big one is the "failed to load" state: the pack is built on ComfyUI's newer node API and declares requires-comfyui >= 0.18.0. If it won't load, update ComfyUI first - that's the fix nine times out of ten, not a problem in this repo.
The most common runtime error is a KeyError on extraction: the key you typed isn't in the dict. Check the spelling, and remember keys get sorted alphabetically inside the dict - but that only matters for reading the stored order, never for lookup by name. Also, this node is strict: if you stored an image under that key and ask for a model, you get a type error, not a shrug. If you're not sure what's in the dict, use DictExtractAny to peek first.
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 | MODEL | The actual Model-type item extracted from the Dict. |