Nodes/was-node-suite-comfyui/Text Dictionary Keys
ComfyUI Node Runs on cloud

Text Dictionary Keys

See what's actually inside a WAS dictionary

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Text Dictionary Keys

      You built a dictionary three nodes ago - maybe with Text Dictionary New, maybe it fell out of Text Dictionary Convert or a loaded text file - and now you've forgotten exactly what's in it. Text Dictionary Keys is the fix: feed it a dictionary, it hands you back the list of keys as text, no values, just the labels. Per the README, it "returns the keys, as a list from a dictionary object." That's the whole node.

      Why you'd actually reach for it

      It's the debugging half of WAS's dictionary toolkit. Text Dictionary Get only works if you already know the exact key name - spelled right, cased right. On a dictionary you built yourself five minutes ago that's fine. On one assembled from a loaded text file, merged from two sources with Text Dictionary Update, or handed to you by someone else's workflow, you often don't. Keys gives you the ground truth before you go fishing for a value that doesn't exist.

      It's also handy just to sanity-check a merge. Run two dictionaries through Text Dictionary Update, then run the result through this node - if a key you expected isn't in the list, you know immediately something didn't combine the way you thought.

      How it works

      Nothing fancier than a Python dict's .keys() call under the hood, turned into text you can actually read on the canvas or pipe further downstream. No sorting, no filtering - just "here's every key currently in this dictionary object."

      The inputs and outputs that matter

      You wire in a dictionary - the DICT-type object produced by any of WAS's other Text Dictionary nodes - and get back a text list of its keys. That output is plain text, so it slots into a Text to Console node to eyeball it, a Text List node if you want to iterate the keys one at a time, or straight into Text Dictionary Get once you've confirmed the exact spelling of the key you actually need.

      How to install it

      It ships as part of WAS Node Suite, no separate download.

      ComfyUI Manager: search "WAS Node Suite," install, restart.

      Manually:

      cd ComfyUI/custom_nodes
      git clone https://github.com/WASasquatch/was-node-suite-comfyui
      

      then install requirements.txt against your ComfyUI Python (python_embeded\python.exe -s -m pip install -r requirements.txt on a portable build) and restart. Nothing here needs a model or GPU - it's string handling only.

      Common issues & troubleshooting

      Empty output. Either the dictionary you wired in is genuinely empty, or you connected the wrong node - double-check you're pulling from an actual Text Dictionary * output and not a plain string that only looks like a dictionary. This node can't parse raw text into keys; that's Text Dictionary Convert's job, upstream of this one.

      Keys look right but Get still can't find them. Whitespace is the usual culprit - a trailing space or a stray newline on a key you built from loaded text will look identical on screen but fail an exact match. Copy the key straight out of this node's output rather than retyping it by hand.

      The whole WAS dictionary family vanished at once. That's not this node - it's the pack failing to import. WAS Node Suite has been unmaintained since the author marked it retired in December 2023, and after a ComfyUI core update its pinned dependencies can collide, throwing "Import Failed" across every WAS node simultaneously. Reinstall requirements.txt against the correct, activated Python environment (or run the pack's install.bat) and restart - that clears it more often than not.

      This is a small, unglamorous node, but it's the one that turns "I think I have a key called subject_style" into a fact you can check instead of guess.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs