Provider: Google GenAI Compatible
Point Gemini Nodes at Someone Else's Server
- provider
Resellers around Google's image models are a crowded market - kie.ai, laozhang, cometapi, apiyi, and a long tail of near-identical proxies all sell access to Nano Banana and Gemini under their own base URL. Most of them speak the official Gemini API shape, they just live somewhere else. This node exists so you can use one of those without unpacking your own HTTP client.
It's the sibling of Provider: OpenAI Compatible, pointed at the other API dialect. Same idea, different wire format: this one speaks the Gemini protocol, so it works with Google-shaped endpoints, and you can wire it into Gemini Chat or Nano Banana.
Why anyone bothers
Four reasons show up again and again, and none of them is exotic. Cost - resellers undercut first-party rates on volume. Region - the official API isn't available or isn't payable everywhere, and a multi-region reseller is sometimes the only door. Billing - a card and one key instead of a Google Cloud project, Vertex AI, and a billing account. Filtering - some relays run looser moderation than Google does.
Treat that last one as marketing until you've tested it. The relay still hands your prompt to Google's model, which does its own refusing; a looser front door doesn't unlock a stricter kitchen. The durable three are cost, region and billing.
The fields, and the one that matters
- base_url - required, no default. This is a Gemini-API-compatible endpoint, so give it the host and version path the provider documents, not an OpenAI-style
/v1URL. - api_key - required in practice, and here's the design decision worth praising: this provider declares no
api_key.jsonkey and no environment variable for keys, so a blank field means an error, not a fallback. The pack's own comment says why - compatible channels never receive your official key. That's exactly the right call, and it's the kind of thing you don't notice until a relay you found on a forum gets a free Google key out of your install. - proxy_url - optional,
http://127.0.0.1:7890orsocks5://. - timeout - seconds,
0= no limit.
Output: a single provider socket.
Wiring it
Drag it in, fill base_url and api_key, wire the provider output into Gemini Chat or Nano Banana, and pick your model version in the model node's dropdown. Route selection is by the provider's kind first, then its route key, so relay-specific model IDs - where they differ from Google's - get used automatically for the versions that need them.
Then keep the two keys straight. If you set gemini in api_key.json for your own Google account, this node never sees it: field only. That has a nasty mirror-image consequence - a blank key here produces an error even when there's a perfectly good Gemini key sitting in the JSON file, which reads as "the node is broken" until you remember the rule.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
ComfyUI Manager also finds it - search "YogurtNodes". Names on the canvas carry a " (Yogurt Nodes)" suffix, so look for "Provider: Google GenAI Compatible (Yogurt Nodes)".
Practical notes
Test with one cheap call first. Point it at a chat node, ask for a single sentence, watch it come back. If the base URL is wrong you'll know in five seconds instead of after a one-minute image generation.
retry_count lives on the model node. Leave it at 1 while characterising a new relay; a relay that timeouts won't improve with three attempts, you'll just wait three times as long to see the same error.
A relay is still an API node. It holds a credential and calls a network by design, which is the one category of custom node that's already been weaponized once in this ecosystem. Prefer relays people you trust actually use, and remember that the KB's external-api-nodes.md frames the whole trade honestly: your prompt and images leave the machine, and that's the mechanism, not a bug.
Where this node genuinely helps: you're in a region where the official API is painful, or you want Gemini-shaped models at a price that makes a batch job worth running. Where it's a bad idea: as a "cheaper Gemini" reflex when your own Google key already works - you're adding a middleman that sees every prompt, for a discount that may not be there.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| base_url | STRING | Base URL of a Gemini-API-compatible endpoint. | |
| api_key | STRING | Leave empty to use 'gemini' from api_key.json, then the GEMINI_API_KEY environment variable. | |
| proxy_url | STRING | Proxy URL, e.g. http://127.0.0.1:7890 or socks5://127.0.0.1:1080. | |
| timeout | INT | 00–3600 | Request timeout in seconds; 0 means no limit. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| provider | YOGURT_LLM_PROVIDER | — |