Gemini Field Extractor
The name is a lie β this node doesn't call any API
- extracted_value
- formatted_output
- extraction_success
A free JSON plucker hiding in a Gemini pack
Here's the twist: GeminiFieldExtractor has nothing to do with Gemini. It makes zero API calls, needs no API key, costs nothing per run. It's a pure Python JSON-path tool that digs one value out of a blob of JSON - which makes it the natural finishing move after any of the API nodes in this pack hand you a wall of structured data. GeminiStructuredOutput gives you JSON, and this node pulls the single field you actually need out of it to feed the next node in the graph.
If that sounds like a tiny job, it is. That's the point - small, fast, free, no model involved.
How it works
You give it a json_input string (raw JSON or even markdown-fenced JSON, which it strips) and a field_path using dot notation:
- Simple:
name,user.email - Nested:
config.database.credentials.username - Array by index:
items[0],users[2].name - Negative index:
items[-1](last item) - All array items:
products[*].price- returns every price in the array
The output_format enum (auto, string, json, number, boolean, list) controls how the value comes back. For arrays there's array_handling - all, first, last, or join (with join_separator for how items get glued together, default ", ").
The few inputs you'll touch
- json_input - paste the JSON, or wire it from an upstream node's string output.
- field_path - the path expression. The placeholders in the UI show the syntax, and testing with a simpler path first is always the right move when a complex one fails.
- default_value - what comes back when the path doesn't resolve. Make it meaningful;
default_valueis how you avoid nulls crashing whatever's downstream. - output_format / array_handling - for shaping the result. Most runs never touch these past their defaults.
Outputs: extracted_value (the value), formatted_output (a detailed string with type and structure info - great for debugging), and extraction_success (a BOOLEAN that's true when extraction worked, which you can drive a conditional/switch node with).
Install
It installs with the whole pack - there's no separate anything:
cd ComfyUI/custom_nodes
git clone https://github.com/jqy-yo/comfyui-gemini-nodes
cd comfyui-gemini-nodes
pip install -r requirements.txt
Restart ComfyUI. Note you're still paying for the heavy opencv-python/moviepy deps because the pack installs as one unit, but this node itself is a plain stdlib json walk - no API key, no network, no Google account.
Where people get burned
The classic trap is expecting it to do what GeminiJSONExtractor does. It won't - if the JSON is malformed, or the field simply isn't there, there's no model to rescue you. Validate your JSON first (GeminiJSONParser is the pack's own tool for that), check your path syntax against the README's examples, and always set a default_value for fields that might be missing. And one more free tip: since it's local, you can use it to sanity-check anything before you spend an API call asking a model to do the same job.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| json_input | STRING | β | |
| field_path | STRING | β | |
| default_value | STRING | β | |
| output_format | COMBO | auto | 6 options: auto, string, json, number, boolean, list |
| array_handlingopt | COMBO | all | 4 options: first, last, all, join |
| join_separatoropt | STRING | , | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| extracted_value | STRING | β |
| formatted_output | STRING | β |
| extraction_success | BOOLEAN | β |