Nodes/ComfyUI-Gemini-3/Gemini 3 + Google搜索
ComfyUI Node

Gemini 3 + Google搜索

Ground the answer in the live web, citations included

By xuchenxu168·Created 10 months ago·Updated 10 months ago· 4
Gemini 3 + Google搜索
    • response
    • grounding_metadata
    • usage_metadata
    prompt搜索最新的AI新闻
    api_providergoogle
    api_key
    modelgemini-3-pro-preview
    thinking_levelhigh
    max_output_tokens8192

    A frontier LLM's knowledge has a sell-by date, and after it passes, the model will confidently tell you things that stopped being true. Gemini3WithGoogleSearch fixes that the direct way: it enables Google's built-in search grounding tool on the call, so the model can actually look things up in real time and - crucially - tell you where it got the answer. The grounding_metadata output is a structured list of sources, which is the difference between "trust me" and "here's the link."

    Reach for it when the prompt depends on current facts: latest news, live prices, model release dates, an event that happened after the training cutoff. In an image pipeline it's most useful as an upstream fact-checker - a node that verifies a claim before a prompt or a script is built on top of it. It's also the honest alternative to a raw LLM hallucinating a citation out of thin air; grounding makes the source auditable.

    How it works

    Under the hood it's a single generateContent call with a google_search tool attached to the request (tools: [Tool(google_search={})]). Google's backend decides when to search, grounds the response in the results, and returns a groundingMetadata blob on the candidate. The node extracts that and hands it back as JSON - groundingChunks (the source chunks) and groundingSupports (which parts of the answer map to which sources). The prompt's thinking level applies as usual, so with thinking_level high, the model reasons over search results rather than pattern-matching them.

    Inputs and outputs that matter

    • prompt - ask for something time-sensitive. The default ("search the latest AI news") is a fine template.
    • thinking_level - high/low; the standard two choices.
    • max_output_tokens - optional cap, default 8192.

    Outputs: response (the grounded answer), grounding_metadata (JSON of sources - wire it to a text display if you want the citations visible), and usage_metadata (token counts).

    Install

    Standard pack install. ComfyUI Manager (search "ComfyUI-Gemini-3") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xuchenxu168/ComfyUI-Gemini-3
    cd ComfyUI-Gemini-3
    pip install -r requirements.txt
    

    No models. Google AI Studio key via api_key field, config.json, or GEMINI_API_KEY.

    Common issues

    • No grounding metadata returned - the model doesn't always search; if the answer doesn't need fresh facts, it may skip the tool and grounding_metadata comes back empty. That's not a bug, but it means the answer wasn't grounded.
    • Search cost - grounded search isn't free on top of generation. If you only need citations on some runs, this node pays for search every run; the pack's structured output node lets you enable search only when you flip a toggle.
    • Filtering still applies - search grounding doesn't change Google's content policy; this node can't be used to route around what the model refuses (external-api-nodes.md lays out why that's structural).
    • Not a replacement for a dedicated web tool - the search is Google's built-in grounding, tuned for answering questions, not for scraping. If your workflow needs raw page content or structured scraping, this isn't that node.
    CategoryGemini3/工具

    Inputs (6)

    NameTypeDefaultDescription
    promptSTRING搜索最新的AI新闻
    api_providerCOMBOgoogle1 options: google
    api_keySTRING
    modelCOMBOgemini-3-pro-preview1 options: gemini-3-pro-preview
    thinking_levelCOMBOhigh2 options: high, low
    max_output_tokensoptINT819216–8192

    Outputs (3)

    NameTypeDescription
    responseSTRING
    grounding_metadataSTRING
    usage_metadataSTRING