Nodes/ComfyUI-YogurtNodes/DictKeys (Yogurt Nodes)
ComfyUI Node

DictKeys (Yogurt Nodes)

See what a dict actually contains — the debugging node you'll use constantly

By yogurt7771·Created 2 years ago·Updated 9 days ago· 1
DictKeys (Yogurt Nodes)
  • dict_data
  • keys
as_listtrue

DictKeys is the "show me the keys" node, and in practice it's the debugging workhorse of the whole dict family. You feed it any dict-like object and it hands you the list of keys. That sounds trivial until you're staring at a workflow where an LLM returned a JSON object with fields you didn't expect, and you have no idea what keys actually exist. This node answers that question in one glance.

Its real job is recon. Before you call DictGet on a field, wire the dict through DictKeys and check the output - you'll immediately see whether the key is width or Width or "width": with a sneaky space. Pair it with DictLength and you get both "what's in here" and "how much is in here." And because the output is a list, you can pipe it into DictFilter patterns, feed it to ListContains, or iterate over it in batch logic. It's the node you use when something downstream isn't behaving and you need to know what the data actually looks like.

How it works

Under the hood it calls .keys() on the dict and - because the as_list toggle defaults to true - converts the result to a plain Python list. Flip as_list off and you get the raw keys view instead, which is a lighter-weight object but won't behave like a list everywhere (no len() guarantees, no indexing). For ComfyUI plumbing, leave it on: you want a list.

Inputs

  • dict_data - any dict-like object supporting .keys().
  • as_list - default true; converts the keys view to a list.

Output

  • keys - the list (or view) of keys, *-typed.

Install

Part of ComfyUI-YogurtNodes:

cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt

Or search "YogurtNodes" in ComfyUI Manager and restart. Under "Yogurt Nodes" → Logic.

Common issues

  • "It doesn't show values" - that's the sibling YogurtDictValues. Keys are keys.
  • "The output doesn't look like a list" - you probably flipped as_list off. Turn it back on for normal use.
  • "I still can't find my key" - check the list output for whitespace, case, or characters you didn't expect. This is exactly the case this node exists to solve.

Between DictKeys, DictValues, and DictLength, this trio is the pack's dict inspector kit. If you're only going to add one of them to a workflow to debug something, make it this one.

CategoryYogurtNodes/Logic

Inputs (2)

NameTypeDefaultDescription
dict_data*Any dict-like object that supports .keys()
as_listoptBOOLEANtrueConvert keys to list, otherwise return keys view

Outputs (1)

NameTypeDescription
keys*