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

Text Dictionary Get

Pull one value out of a dictionary as a string

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

      You have a dictionary floating around your graph - a bag of key/value pairs - and you want one value out of it as plain text. That's this node. Give it the dictionary and a key, get the matching value back as a STRING. It's the dict["key"] of ComfyUI.

      On its own it's unremarkable. In context it's the piece that makes WAS's little text-and-dictionary toolkit actually useful, because a dictionary is only worth building if you can read individual values back out of it later.

      Where dictionaries come from, and why you'd want one

      WAS Node Suite has a whole family of dictionary nodes: Text Dictionary New (make one), Text Dictionary Convert (turn text into a dict), Text Dictionary Update (merge two), Text Dictionary Keys (list the keys), Text Dictionary To Text (dump it all back to text), and this one, Get, to pull a single value.

      The point of all this is structured prompt data. Instead of scattering a dozen loose text boxes around your canvas, you keep one dictionary - {"subject": "a fox", "style": "watercolor", "lighting": "golden hour"} - and pull the pieces you need where you need them. It's how you build a workflow that assembles prompts from labeled parts rather than one monolithic string. Load a text file and the pack can even hand you back a dictionary keyed by that file, so Text Dictionary Get becomes the way you read a specific line or field out of it.

      How it works

      A Python dict lookup, basically. The node takes the dictionary object and a key string, finds the entry with that key, and outputs its value coerced to a string. No transformation beyond the lookup and the string conversion.

      The inputs and outputs that matter

      • dictionary - the DICT object you're reading from, produced by one of the other Text Dictionary nodes.
      • key - the name of the entry you want. Must match a key that actually exists in the dictionary.

      The output is a STRING - the value at that key. It wires straight into a prompt encoder, a text concatenate node, a filename token, or anywhere else a string belongs.

      Installing it

      Comes with WAS Node Suite. ComfyUI Manager: search WAS Node Suite, install, restart. Or by hand:

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

      install requirements.txt against your ComfyUI Python, restart.

      Common issues

      Key not found / empty output. The key you asked for isn't in the dictionary, or it's spelled differently (keys are case-sensitive and whitespace counts). Use Text Dictionary Keys to print exactly what keys exist before assuming the node is broken - nine times out of ten it's a typo or a stray space.

      Everything comes out as a string, even numbers. By design - this node's whole contract is "get the value as a string." If you stored a number and need it back as a number downstream, run the result through one of WAS's Number conversion nodes.

      All the dictionary nodes vanished at once. That's the pack failing to load, not this node. WAS Node Suite is retired and no longer maintained; after a ComfyUI update its dependency pins can collide and the suite throws "Import Failed," which takes every WAS node offline until you reinstall the pack's requirements against the correct ComfyUI environment.

      This is a small, sharp utility - no drama, no models, no VRAM. If you're not already building prompts out of dictionaries, you probably don't need it. If you are, it's the node that reads them.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs