Nodes/comfyUI_Vertex_API/Vertex AI Auth/Config
ComfyUI Node

Vertex AI Auth/Config

The one node every other node in this pack is waiting for

By linfen0·Created 10 months ago·Updated 10 months ago· 2
Vertex AI Auth/Config
    • vertex_config
    config_filevertex_config.json
    service_account_json
    api_key

    Vertex AI Auth/Config is the front door to the whole comfyUI_Vertex_API pack. Nothing else runs without it: the image and text generators both demand a vertex_config input, and this node is where that little bundle of credentials and project settings is born. Think of it less as a "node" and more as the pack's wallet - it holds your Google Cloud identity and hands it to every generation node you wire up.

    The name is doing two jobs at once, and that's intentional. It's an auth node because it stores your API key or service account, and it's a config node because it remembers your project ID and location and exposes them as one VERTEX_CONFIG object you can pass around the graph.

    How it works

    The author offers two authentication modes, and which one you pick matters:

    • API key - recommended in the README for personal use. You paste a key from Google Cloud's Vertex AI Studio into api_key, run the workflow once, and the node writes it to a config file and clears the field from the canvas. From then on the key lives on disk, not in your workflow JSON.
    • Service account JSON - the production/enterprise route. You point service_account_json at a downloaded .json key file (the README's credentials guide walks through creating one with the Vertex AI User role - not Viewer, not Admin).

    Here's the mechanism worth understanding: the node only ever reads and writes inside its own config/ folder inside the pack directory. Your config_file input is just a filename, no directory - vertex_config.json is the default. Run once, and the saved config is merged back in on every later run, so you never retype the key.

    The node is a "save-on-input" node: it keeps whatever was saved before, and only rewrites the file when you type something new into api_key or service_account_json. Its output is a single vertex_config (VERTEX_CONFIG type) that plugs straight into VertexGeminiImageGenerator and VertexGeminiTextGenerator.

    Inputs and outputs that matter

    • config_file (string, default vertex_config.json) - which saved config to load/update. Filename only.
    • api_key - your Vertex AI API key; blank after first save.
    • service_account_json - path to the service account key file.
    • Output: vertex_config → wire this into the generators' vertex_config input.

    That's the whole list. Three inputs, one output.

    Installing it

    Via ComfyUI Manager, search for comfyUI_Vertex_API (or "Vertex"). Or the manual route:

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

    Then restart ComfyUI. Dependencies are light - google-auth, requests, pillow, numpy - and there are no model downloads, because the models run on Google's side. You need internet access to googleapis.com, and a Google Cloud project with billing attached (the README is blunt that a virtual card won't work for activating GCP).

    Common issues

    • "Credentials missing" error at the start of your run - that's the node telling you nothing is saved yet. Set a key or service account once, run, and it persists.
    • A quirk in the error path: that helpful red "Credentials missing" message is built with colorama, which isn't in requirements.txt. If your Python env somehow lacks it, the error handler itself can crash with an ImportError - pip install colorama fixes the messaging.
    • Don't share config/vertex_config.json or a service account file - they're plaintext keys in your custom_nodes folder. The node keeps them off the canvas, which is a nice touch, but they're still sitting on disk.

    One honest caveat this pack deserves: it's new and tiny - one commit, and no community thread anywhere has vetted it yet. An API-wrapper node that ships a key and phones home by design is exactly the shape of the thing that got weaponized once in this ecosystem (the LLMVISION incident). Pasted personal API keys are low-stakes; before you drop a production service account in here, read the pack's auth_node.py and utils.py yourself. That's not paranoia - it's the standard this category should be held to.

    CategoryVertexAI

    Inputs (3)

    NameTypeDefaultDescription
    config_fileSTRINGvertex_config.json
    service_account_jsonoptSTRING
    api_keyoptSTRING

    Outputs (1)

    NameTypeDescription
    vertex_configVERTEX_CONFIG