Nodes/ComfyUI API Toolkit/Gemini Model Selector
ComfyUI Node

Gemini Model Selector

One dropdown for 55 Gemini models — with a guardrail that catches your own mistakes

By IxMxAMAR·Created 5 months ago·Updated 2 months ago· 1
Gemini Model Selector
    • model
    modelgemini-pro-latest
    category_validateany
    custom_model

    Most Gemini nodes in this pack carry their own model dropdown, which is convenient until you have six text nodes and want to switch them all from gemini-2.5-flash to a new preview in one move. That's the job of the Gemini Model Selector: it's a single node holding a dropdown of 55+ model IDs - text, image, Imagen, TTS, Veo, Lyria, embeddings - that outputs a plain string you can wire into any of the pack's custom_model inputs. Change it once, and every node fed by it follows.

    But the selector earns its keep with the second input, which is genuinely clever: category_validate. Set it to text and the node will throw an error at runtime if the selected model isn't a text model. Pick veo and it refuses to pass a Lyria music model through. It's a guardrail against the dumbest failure in this whole category - wiring an imagen-... ID into a node that's about to call generate_content and watching it 404.

    How it works

    The mechanism is almost insultingly simple: it's a value pass-through. The dropdown maps to a fixed list of model IDs (the same verified list the whole pack shares), and the node returns the selected string as its model output. The interesting part is the validation - when category_validate isn't any, it compares the model's category against what you requested and raises a clear error if they don't match. So you get the shared dropdown ergonomics and a runtime check that's effectively free.

    Inputs and outputs

    • model - the big dropdown. 55 choices spanning every service in the Gemini module, from gemini-3-pro-preview and gemini-2.5-flash down through the specialized IDs like the robotics and computer-use previews. Defaults to gemini-pro-latest, the safe alias.
    • category_validate - any, text, image_gen, imagen, tts, veo, lyria, or embedding. Set this to the kind of node it feeds. any disables the check.
    • custom_model - the escape hatch. Type any model ID and it takes priority over the dropdown, so you're not stuck if Google ships something new before the pack updates.

    One output: model (STRING). Feed it into another node's custom_model input - that's the intended wiring.

    How to install it

    It ships in ComfyUI-API-Toolkit, so:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IxMxAMAR/ComfyUI-API-Toolkit
    cd ComfyUI-API-Toolkit
    pip install -r requirements.txt
    

    Or install "API Toolkit" from ComfyUI Manager. The Gemini service needs google-genai>=0.8.0. No key needed for this node itself (it doesn't call anything) - the downstream node does the calling.

    Common issues

    The main trap is expecting it to do more than it does. It's a pass-through with a validator, not a router that can auto-pick models or know what your account can access. If the dropdown contains a model your key can't reach, the error will come from the node doing the actual call, not here - run the pack's Gemini List Available Models node to see what's real for your account, then use custom_model for anything not in the list.

    Also worth knowing: because category_validate checks at execution time, a mismatch won't red-flag until you hit Queue. That's by design - it's a runtime guard, not a canvas-time linter - but it means your first run of a mis-wired workflow will error rather than silently produce garbage, which is honestly the better failure mode.

    CategoryAPI Toolkit/Gemini/Config

    Inputs (3)

    NameTypeDefaultDescription
    modelCOMBOgemini-pro-latestSelect any Gemini/Imagen/Veo/Lyria/Embedding model.
    category_validateCOMBOanyValidate that the selected model matches this category. Raises an error at runtime if not. Helps catch mistakes like 'imagen-...' selected for a text node.
    custom_modeloptSTRINGOverride with a custom model ID (leave blank to use dropdown).

    Outputs (1)

    NameTypeDescription
    modelSTRING