Nodes/Comfyui-PixNodes/JSON Object Extract (PixNodes)
ComfyUI Node

JSON Object Extract (PixNodes)

Pull fields out of a JSON object without fighting the key names

By pixixai·Created 8 months ago·Updated 6 months ago· 24
JSON Object Extract (PixNodes)
  • json_object
  • object_1
  • object_2
  • object_3
  • object_4
  • object_5
  • object_6
  • object_7
  • object_8
  • object_9
  • object_10
  • object_11
  • object_12
  • object_13
  • object_14
  • object_15
  • object_16
  • object_17
  • object_18
  • object_19
  • object_20
  • object_21
  • object_22
  • object_23
  • object_24
  • object_25
  • object_26
  • object_27
  • object_28
  • object_29
  • object_30
  • object_31
  • object_32
  • object_33
  • object_34
  • object_35
  • object_36
  • object_37
  • object_38
  • object_39
  • object_40
  • object_41
  • object_42
  • object_43
  • object_44
  • object_45
  • object_46
  • object_47
  • object_48
  • object_49
  • object_50
  • object_51
  • object_52
  • object_53
  • object_54
  • object_55
  • object_56
  • object_57
  • object_58
  • object_59
  • object_60
  • object_61
  • object_62
  • object_63
  • object_64
  • object_65
  • object_66
  • object_67
  • object_68
  • object_69
  • object_70
  • object_71
  • object_72
  • object_73
  • object_74
  • object_75
  • object_76
  • object_77
  • object_78
  • object_79
  • object_80
  • object_81
  • object_82
  • object_83
  • object_84
  • object_85
  • object_86
  • object_87
  • object_88
  • object_89
  • object_90
  • object_91
  • object_92
  • object_93
  • object_94
  • object_95
  • object_96
  • object_97
  • object_98
  • object_99
  • object_100
match_keysobject_1
merge_outputfalse

When an LLM node hands you a JSON object, the first thing you need is its fields out and onto separate wires - the prompt goes to the text encoder, the seed to the sampler, the image path to a loader. JSON Object Extract does exactly that: type the keys you want into match_keys and each one comes out its own named output port. It's the extraction half of the pack's JSON workflow, and the sibling of JSON List Pluck, which does the same job for lists.

The standout feature is the forgiving matching. Type prompt and it finds Prompt, prompt_json, the_prompt, even prompts - the node normalizes keys (lowercases, strips separators), tries stem matching, then falls back through a set of common variants. On top of that, if the input is a raw JSON string rather than a parsed object, it'll extract the JSON body, repair broken syntax (single quotes, trailing commas, unclosed braces), and even fall back to a regex grab on the raw text. If you're consuming output from a chat model that renames fields at will, this is the node that absorbs the chaos.

The inputs

  • json_object (wildcard) - the data. Accepts a parsed dict/list or a JSON string.
  • match_keys (multiline string, default object_1) - one key per line.
  • merge_output (boolean, default off) - flip it on and all matched values are merged into a single object instead of separate ports.

Outputs: object_1 through object_100, in the order of your keys. Matches that come back as dicts or lists pass through as those types; a missing key gives you None (or [] when the data was a string). This is a display-heavy node, so expect a wall of sockets.

Install

Part of Comfyui-PixNodes. ComfyUI Manager → search "PixNodes" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/pixixai/Comfyui-PixNodes

then restart. (The README's manual-install block references the wrong repo, ComfyUI-AlignLayout - use the URL above.)

Where it fits and where it doesn't

It's the natural companion to the pack's Qwen/Kimi API nodes: those return a raw text response, you coerce it to JSON, and this node splits it into usable parts. It also composes with JSON Mutation - extract first, mutate a field, recombine with Join JSON Object or JSON Object Combine. Just don't mistake the fuzzy matching for a guarantee: stem matching (promptprompts) is a convenience, not a spec, and if two fields stem to the same key the winner is whichever the walk finds first. For data where the key names are already exact and stable, the pack's plain JSON KV Split is the more predictable tool.

CategoryPixNodes/JSON

Inputs (3)

NameTypeDefaultDescription
json_object*
match_keysSTRINGobject_1
merge_outputBOOLEANfalse

Outputs (100)

NameTypeDescription
object_1JSON
object_2JSON
object_3JSON
object_4JSON
object_5JSON
object_6JSON
object_7JSON
object_8JSON
object_9JSON
object_10JSON
object_11JSON
object_12JSON
object_13JSON
object_14JSON
object_15JSON
object_16JSON
object_17JSON
object_18JSON
object_19JSON
object_20JSON
object_21JSON
object_22JSON
object_23JSON
object_24JSON
object_25JSON
object_26JSON
object_27JSON
object_28JSON
object_29JSON
object_30JSON
object_31JSON
object_32JSON
object_33JSON
object_34JSON
object_35JSON
object_36JSON
object_37JSON
object_38JSON
object_39JSON
object_40JSON
object_41JSON
object_42JSON
object_43JSON
object_44JSON
object_45JSON
object_46JSON
object_47JSON
object_48JSON
object_49JSON
object_50JSON
object_51JSON
object_52JSON
object_53JSON
object_54JSON
object_55JSON
object_56JSON
object_57JSON
object_58JSON
object_59JSON
object_60JSON
object_61JSON
object_62JSON
object_63JSON
object_64JSON
object_65JSON
object_66JSON
object_67JSON
object_68JSON
object_69JSON
object_70JSON
object_71JSON
object_72JSON
object_73JSON
object_74JSON
object_75JSON
object_76JSON
object_77JSON
object_78JSON
object_79JSON
object_80JSON
object_81JSON
object_82JSON
object_83JSON
object_84JSON
object_85JSON
object_86JSON
object_87JSON
object_88JSON
object_89JSON
object_90JSON
object_91JSON
object_92JSON
object_93JSON
object_94JSON
object_95JSON
object_96JSON
object_97JSON
object_98JSON
object_99JSON
object_100JSON