Nodes/ComfyUI Level Pixel/Get JSON Value [LP]
ComfyUI Node

Get JSON Value [LP]

Get JSON Value [LP] — ComfyUI Node Guide

By LevelPixel·Created 2 years ago·Updated 6 months ago· 31
Get JSON Value [LP]
  • json_object
  • string
keymy_key

The plainest of LevelPixel's JSON nodes: give it a JSON object and a key, get the value back as a string. If you've ever had a node upstream spit out structured data - an API response, a config blob, metadata attached to a batch job - and you just needed one field out of it without writing Python, this is that node.

What it does and why it matters here

ComfyUI workflows that touch JSON usually come from automation: an API node returns a response object, or you're threading config through a pipeline as JSON so one text box can carry several settings at once. Digging a single value out of that without a scripting node used to mean either a Python-eval-style node or manual string surgery. GetJSONValue is the boring, reliable version - one key in, one string out.

It's part of a small family in this pack (Get JSON Value, Check JSON Key, Get JSON Length, Stringify JSON, Merge JSON Node) added in a fairly recent update - the pack's changelog lists JSON nodes as new as of v1.3.4. Some of this group's functionality is credited in the README to Comfyui-Simple-Json-Node by Q-Bug4, so if a couple of these feel like they came from the same lineage as nodes you've seen in other packs, that's why.

Inputs and outputs

  • json_object (JSON) - this takes ComfyUI's JSON socket type, meaning it's expecting an already-parsed JSON object coming from another node, not a raw string. That's a meaningfully different input type from this pack's other JSON nodes (Check JSON Key, Get JSON Length, etc.), which take a json_string STRING instead - so don't expect this one to accept a text box of raw JSON directly wired from a Text node without something upstream that outputs the proper JSON type.
  • key (STRING, default my_key) - the key you want the value for.

Output: string - the value at that key, as a string.

Installing it

Through ComfyUI Manager: search "ComfyUI-LevelPixel" and install (it lists under "Level Pixel"). Manually: cd ComfyUI/custom_nodes && git clone https://github.com/LevelPixel/ComfyUI-LevelPixel.git, then restart ComfyUI. Nothing to download, no GPU dependency - this is pure Python dict lookup dressed up as a node.

Common issues

The most likely first snag: this node wants the JSON type, not a string. If you're holding raw JSON text (say, from a Text multiline box or an API response you pasted in manually), you'll need something upstream that parses it into the actual JSON socket type first - wiring a plain STRING output straight into json_object won't connect. This trips people up specifically because this pack's other JSON nodes (JSONKeyCheckerNode, JSONLengthNode) go the opposite way and expect json_string as plain text - it's easy to grab the wrong one for what you're holding.

If key doesn't exist in the object, expect this to fail or come back empty rather than silently succeed - check spelling and case exactly against what your upstream JSON actually contains; JSON keys are case-sensitive and there's no fuzzy matching here. And since the output is always a string, if the value at that key was originally a number, boolean, or nested object, you're getting its string representation back, not the original type - if you need it back as an INT or FLOAT for math downstream, you'll need a conversion node after this one.

CategoryLevelPixel/JSON

Inputs (2)

NameTypeDefaultDescription
json_objectJSON
keySTRINGmy_key

Outputs (1)

NameTypeDescription
stringSTRING