Nodes/ComfyUI-MultiTranslator/Gemini Service Connector 🦉| OwlV
ComfyUI Node

Gemini Service Connector 🦉| OwlV

Gemini in ComfyUI, minus the weird API format

By OwlvChirotha·Created 11 months ago·Updated 10 months ago· 0
Gemini Service Connector 🦉| OwlV
    • llm
    api_key
    model_selectgemini-1.5-flash
    custom_model_id

    Google's Gemini is a genuinely strong translator - fast, multilingual, and the free tier is friendly - but its API looks like nothing else. No /v1/chat/completions. Instead you get generateContent, contents, parts, and a response buried in candidates[0].content.parts[0].text. The Gemini Service Connector is the adapter that sits between Gemini's dialect and the rest of the ComfyUI-Translator pack, so the LLM Translator node doesn't need to know any of that.

    Why you'd reach for it

    You want a Google key, or you already have one. The gemini-1.5-flash default is a sensible pick for translation - fast, cheap, and plenty multilingual. One honest caveat, straight from the pack's README: Gemini needs an international network. If you're in mainland China this is the odd one out of the four connectors; the same pack's SiliconFlow and ZhiPu connectors are the no-proxy paths.

    How it works

    Run the node and it wraps a Gemini connector in the pack's LLMClient, returning an llm handle. The connector builds a URL like https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={api_key} and converts the standard chat messages into Gemini's contents/parts shape, then digs the reply out of the response. Note the key= in that URL - your API key rides in the query string, so don't go pasting that URL into chat logs or screenshots.

    As with every connector in this pack, running the node itself calls nothing. No request fires until the LLM Translator node downstream runs. A 401 (bad or missing key) only shows up as an error message coming back through that node's output.

    Inputs and output

    • api_key - password-masked in the UI.
    • model_select - gemini-1.5-pro, gemini-1.5-flash, gemini-2.0-flash-exp, or Custom. Default is 1.5-flash.
    • custom_model_id - the model name when you pick Custom.

    Output is a single llm (type LLM), wired into the LLM Translator node's llm input.

    Installing it

    ComfyUI Manager: search ComfyUI-Translator, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/OwlvChirotha/ComfyUI-Translator
    pip install -r ComfyUI-Translator/requirements.txt
    

    Then restart ComfyUI. No model downloads, no heavy dependencies - this node only needs requests, which is already everywhere.

    Common gotchas

    • The experimental model will age out. gemini-2.0-flash-exp is an "exp" model and Google retires those. By the time you read this it may be gone or renamed. If it errors, switch to Custom and type the current model ID from Google's docs.
    • The node does nothing alone. Run it by itself and you'll see an object, not translated text. That's expected - connect it to the LLM Translator and run the pair.
    • Errors surface as text. A bad key or a retired model comes back as an error string in the translator's output rather than a crash. Read the output.
    • Your key is in the workflow JSON. The UI masks it, but the saved workflow stores it in plain text. Clear it before you share, or accept that anyone with the file can spend your quota.

    This pack is a small, one-commit GPL-3.0 project, and the Gemini node is the most involved connector in it - which says more about how odd Gemini's API is than how big the pack is. If you already hold a Gemini key, this is the fastest way to put it to work in a ComfyUI translation flow.

    CategoryText Processing/LLM

    Inputs (3)

    NameTypeDefaultDescription
    api_keySTRING
    model_selectCOMBOgemini-1.5-flash4 options: gemini-1.5-pro, gemini-1.5-flash, gemini-2.0-flash-exp, Custom
    custom_model_idoptSTRING

    Outputs (1)

    NameTypeDescription
    llmLLM