Pyobjects/Dict Set
Write a key/value pair into a dict
- py_dict
- value
- DICT
Once you've got a dict in your graph - from DictCreateNode, or converted from something else - you need a way to actually put data into it. DictSetNode is that: give it a dict, a key, and a value, and it hands back a dict with that key/value pair set.
It's part of the Dict* family in ComfyUI-LogicUtils, alongside DictGetNode, DictMergeNode, DictRemoveKeyNode and friends - Python dict operations exposed as ComfyUI nodes. The pack is by GitHub user aria1th, publicly known as AngelBottomless, the trainer behind Illustrious XL - though this data-manipulation corner of LogicUtils is unrelated to that training work directly. It reads like tooling built for programmatic, config-driven, or loop-based graphs, where you're assembling and passing around structured data rather than just chaining image-generation nodes. As with the rest of the pack, don't expect exhaustive documentation - the README itself says "proper documentation is being prepared, however there are too many nodes."
How it works
You wire in py_dict (the dict to modify), type a key, and connect a value - that last input is typed *, ComfyUI's wildcard, so it accepts a connection from any other node's output, not just strings or numbers. The node sets that key to that value and returns the resulting dict as its output.
The node is flagged as an output node in ComfyUI's execution model, which means it runs even if you don't wire its output to anything downstream. That matters here specifically because the interesting part of this node is the side effect - writing the key - not necessarily consuming the returned dict immediately. If you're chaining several DictSetNode calls to build up one dict across multiple keys, being an output node is what keeps each one from getting silently pruned out of execution.
The inputs and outputs that matter
py_dict(DICT, required) - the dict to write into.key(STRING, default"some_key") - the key to set. Type your own value in; the default is just a placeholder.value(*, default"some_value") - what to store at that key. Accepts a wired connection of any type, or you can leave it at the placeholder text to test the node in isolation.- Output: a single
DICT- the dict with the new key/value pair set, ready to chain into anotherDict*node or out toDictGetNodelater.
How to install it
Through ComfyUI Manager: search ComfyUI-LogicUtils, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
Restart ComfyUI. No model downloads needed - this is pure Python data handling. The README's opt-in auto-install hook (COMFYUI_LOGICUTILS_AUTO_INSTALL=1, disable with COMFYUI_LOGICUTILS_SKIP_INSTALL=1) targets heavier parts of the pack elsewhere; the Dict* nodes don't need it.
Common issues & troubleshooting
Your key ended up literally set to "some_key" or "some_value". Those are just the default placeholder text - if you forget to type your own key, or leave value unconnected, that's exactly what gets written. Double-check both fields before assuming the node is broken.
You're chaining multiple sets and only the last one seems to matter. Make sure you're feeding each DictSetNode's output DICT into the next one's py_dict input in sequence, rather than wiring several DictSetNode calls to the same original dict independently - the latter gives you several separate dicts, each with only one key set, not one dict with all of them.
Not sure if a disconnected node actually ran. It will - this node is an output node, so ComfyUI executes it regardless of whether its result is wired anywhere. Useful when you're building the graph incrementally and haven't connected the final consumer yet.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| py_dict | DICT | — | |
| key | STRING | some_key | — |
| value | * | some_value | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DICT | DICT | — |