🟣Model → Dict🗂️
Your Checkpoint, Packed Into the Bus
- dict
- value
- dict
This is the "put it in" half of the pack's most common pair. You wire a checkpoint into DictAddModel, give it a name, and now your whole workflow - prompts, seeds, denoise values, the model itself - rides around inside one dict connection instead of a tangle of wires. DictExtractModel pulls it back out at the sampling end.
It sounds like a party trick, but it's the mechanism behind the "bus" workflow that keeps big graphs readable. ComfyUI graphs have a habit of turning into spaghetti the moment you add a second sampler or a multi-stage upscale; bundling related data into a single connection is how people keep them sane, and the README is explicit that this pack exists so you decide what goes in the bus rather than some node author deciding for you.
How it works
The node takes a value of type MODEL (a ModelPatcher - the checkpoint object from your loader), validates it, and stores it under your key in a new dict. The stored dict is a frozendict, and each Add returns a new dict: nothing gets mutated in place, so you can chain Add nodes in a row and each one hands you a fresh updated dict. Keys get sorted alphabetically on every update, which is by design.
The inputs that matter
- key (STRING) - the name you'll use to fetch this model later. Make it match exactly what you'll type in DictExtractModel.
- cleanup_key (BOOL, default on) - trims whitespace and extra newlines from the key. Leave it on.
- dict (DICT, optional) - the dict to extend. Leave it empty for a fresh one, or feed in another dict to build a chain.
- value (MODEL, optional) - the checkpoint itself. Wire it from CheckpointLoader, or from a model you've already patched.
Output is dict (DICT), which you pass on or wire straight into an Extract node.
Install
Via ComfyUI Manager: search Dict Tools, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Lex-DRL/ComfyUI-DictTools
Then restart ComfyUI. Only real dependency is frozendict, auto-installed by Manager.
Gotchas
The pack requires ComfyUI 0.18.0+ (it's built on the newer node API). If Manager reports it as failed to load, update ComfyUI before you debug anything else.
One behavior people bump into: the value input is optional, so it's easy to wire the wrong port and get a TypeError at runtime - the node is strict about the value being a real model object, not an image or a latent. And remember the dict is immutable: if an upstream node also uses the same dict, neither of you is corrupting the other's copy, which is exactly why the author froze 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 | MODEL | The actual Model-type item to add into the Dict. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| dict | DICT | — |