Nodes/ComfyUI-LogicUtils/Pyobjects/Dict Keys
ComfyUI Node

Pyobjects/Dict Keys

List every key in a dict

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Pyobjects/Dict Keys
  • py_dict
  • LIST

When you're several steps into a graph that's been building up a dict through DictSetNode calls, or you've received one from ConvertAny2Dict and don't know exactly what's in it, the fastest way to check is to just list the keys. DictKeysNode does that one thing: dict in, list of keys out.

It's part of the Dict* family in ComfyUI-LogicUtils, a utility pack by GitHub user aria1th - publicly known as AngelBottomless, the trainer behind Illustrious XL, though this data-handling side of the pack is unrelated to his model training work. These nodes are Python dict operations - .keys(), .values(), .get(), dict[k] = v - wrapped as wireable ComfyUI nodes, mostly useful once you're building programmatic or loop-driven workflows rather than a linear generation pipeline. The pack doesn't pretend to be a fully documented product; its README says plainly, "proper documentation is being prepared, however there are too many nodes."

How it works

Wire in py_dict, and the node returns its keys as a LIST. That's the whole operation - it's the direct equivalent of calling .keys() on a Python dict and wrapping the result in a list. Useful for a quick sanity check mid-graph (did the earlier DictSetNode chain actually set what you think it did?), or for feeding the resulting list of keys into another node that needs to iterate over them.

The node is flagged as an output node in ComfyUI's execution model, so it runs even when nothing downstream consumes its result - which matters if you're using it purely to inspect a dict's contents while building the rest of the graph, rather than as a permanent step in the final pipeline.

The inputs and outputs that matter

  • py_dict (DICT, required) - the dict to inspect.
  • Output: a single LIST - every key currently in that dict.

How to install it

Through ComfyUI Manager: search ComfyUI-LogicUtils, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils

Restart ComfyUI. No model files to download - pure Python data handling, nothing GPU-related. The README's opt-in auto-install hook (COMFYUI_LOGICUTILS_AUTO_INSTALL=1, disabled with COMFYUI_LOGICUTILS_SKIP_INSTALL=1) is aimed at heavier parts of the pack; this node doesn't need it.

Common issues & troubleshooting

The list is empty. That means the dict genuinely has no keys yet - either you're inspecting a fresh DictCreateNode output before any DictSetNode calls have run, or the chain that was supposed to populate it isn't actually wired through in sequence. Trace back through your DictSetNode chain and confirm each one's output feeds the next one's input.

A key you expect isn't in the list. Almost always a chaining issue: if you wired several DictSetNode calls to the same original dict independently instead of threading each one's output into the next one's input, you end up with several separate dicts, each holding only its own key - not one dict with all of them.

You want values too, not just keys. Use DictValuesNode for the values alone, or DictItemsNode if you want key/value pairs together - this node is deliberately keys-only.

CategoryData

Inputs (1)

NameTypeDefaultDescription
py_dictDICT

Outputs (1)

NameTypeDescription
LISTLIST