Vertex AI Text (Gemini LLM)
A Gemini LLM inside your workflow, for the jobs that aren't diffusion
- vertex_config
- generation_config
- text
- generation_config
The pack's other half: instead of an image, this node returns text from a Gemini LLM on Vertex AI. Same credentials, same cloud-vs-local tradeoff, but for a different job. If you've ever wanted a prompt enhancer, a captioner, or just a chat completion that hands its answer to the next node as a string, this is the bolt-on.
The pattern is mainstream at this point - an LLM in the graph rewriting a rough idea into a structured prompt, or describing an image for captioning - our llm-in-comfyui doc covers the whole genre. The usual reason people prefer a local LLM for this is that it's uncensored and free per call; here you're trading that away for a frontier model with zero VRAM cost. Fine trade if you're already paying for Vertex anyway.
How it works
It POSTs your prompt to the Vertex AI :generateContent endpoint and returns the concatenated text of the first candidate. Three things stand out in the code, and one of them is a genuine trap:
- It's OAuth-only. Unlike the image node, there is no API-key path here - the text generator always resolves a service account or falls back to Google's default credentials (the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable). If you only set an API key inVertexAIAuth, this node will fail with a default-credentials error. Service account or env vars, full stop. - The model dropdown is the image model list. This is the trap. The
model_namechoices come from the same cached model list as the image node -gemini-3-pro-image-preview,gemini-3.0-pro-preview,gemini-2.5-flash-image. But the node's default isgemini-1.5-pro-002, a text model that isn't in that list at all. So the dropdown won't contain the default, and whatever it does offer are image models. The fix is thecustom_model_nameinput - type a real text model there (likegemini-1.5-pro-002or a currentgemini-2.5-flash) and it overrides the dropdown. It's an honest wart in the pack, and it'll cost you a baffling error if you don't know it's there. - Errors come back as text, not as exceptions. When a call fails, the node returns the error string in the
textoutput instead of raising. Your workflow keeps running, and the failure silently becomes your output. If you ever wonder why your downstream nodes are digesting anError: 403message, this is why.
Inputs and outputs that matter
vertex_config- fromVertexAIAuth(and it needs the service-account flavor, see above).promptandsystem_instruction- the conversation; the latter defaults to "You are a helpful assistant."temperature(0–2),max_tokens,safety_filter_level(BLOCK_NONEis the default).generation_config- optional; if you connect aVertexGenerationConfig, its temperature, safety settings, system instruction and response modalities are honored (though itsmaxOutputTokensandtopPkeys are not read here - an asymmetry with the image node worth knowing).- Outputs:
text(STRING - wire it into a Show Text node or a prompt builder) andgeneration_config(a small dict of what was actually used).
Installing it
Shared with the whole pack: ComfyUI Manager → search comfyUI_Vertex_API, or
cd ComfyUI/custom_nodes
git clone https://github.com/linfen0/comfyUI_Vertex_API.git
cd comfyUI_Vertex_API
pip install -r requirements.txt
Restart ComfyUI. Dependencies are just google-auth, requests, pillow, numpy - nothing heavy, nothing local to download.
The honest take
For a quick "make this sentence cinematic" step inside a workflow you already have, this does the job. But the model-dropdown bug makes it fiddlier than it should be, and if your whole goal is an LLM in the graph, a local uncensored model is usually the better default - free per call, offline, no filtering. Reach for this when you specifically want a Gemini model's reasoning wired into your pipeline, and set custom_model_name first thing.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| vertex_config | VERTEX_CONFIG | — | |
| prompt | STRING | Explain quantum physics in simple terms. | — |
| model_name | COMBO | gemini-1.5-pro-002 | 3 options: gemini-3-pro-image-preview, gemini-3.0-pro-preview, gemini-2.5-flash-image |
| temperature | FLOAT | 0.70–2 | — |
| max_tokens | INT | 81921–1000000 | — |
| safety_filter_level | COMBO | BLOCK_NONE | 4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, OFF |
| generation_configopt | GENERATION_CONFIG | — | |
| system_instructionopt | STRING | You are a helpful assistant. | — |
| custom_model_nameopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| generation_config | GENERATION_CONFIG | — |