Nodes/DIGIT Nodes/DIGIT LLM Query
ComfyUI Node

DIGIT LLM Query

A Gemini brain inside your workflow, with no API key to babysit

By thedepartmentofexternalservices·Created 6 months ago·Updated 26 days ago· 0
DIGIT LLM Query
  • image
  • response
modelgemini-2.5-pro
prompt
gcp_project_id
gcp_region
system_prompt
max_tokens8192
temperature0.70

An LLM in the graph is one of the most useful things you can add to a workflow, and this node makes it a one-node install: prompt in, text out, using Gemini through Vertex AI with your existing gcloud login. No API key field, no OpenAI account, no proxy. The project and region auto-detect from your GCP setup, and the billing lands on your own GCP account.

The jobs this actually earns its keep on: rewriting a rough idea into a structured image prompt, analyzing an image and describing it in detail, generating dialogue or scripts for a video pipeline, or captioning a frame you just made. It's the "ask a frontier model a question" node, sitting right next to your samplers.

How it works

Under the hood it calls Gemini's generateContent through Vertex AI - the google-genai SDK, same auth as the DIGIT Gemini Image node. No local model, no VRAM, no Ollama server to keep running. You get the frontier-model quality that a local 8B can't match, and you pay per call for it.

The inputs:

  • prompt - required. Your ask. With an image connected it becomes a vision query.
  • model - gemini-2.5-pro is the default, with gemini-3.1-pro-preview, gemini-3.1-flash-lite-preview, and a few others in the list. Start with the default; drop to a flash model when you just want speed and cheap tokens.
  • system_prompt - optional instructions that shape how the model answers. This is where you pin behavior ("you are a prompt engineer, output only the final prompt").
  • image - optional IMAGE input. Connect a frame and the node becomes a vision-language query: "describe this image", "what's the lighting setup".
  • max_tokens - default 8192. Generous, but for prompt rewriting you rarely need that much.
  • temperature - default 0.7. Lower it (0.2-ish) when you want consistent structured output.
  • gcp_project_id / gcp_region - leave blank; auto-detected from env vars or GCP metadata.

The single output is response - the model's text. Wire it into a text-input node, a Prompt Combine, a text saver, or whatever consumes strings in your pipeline.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/thedepartmentofexternalservices/comfyui-digit.git
cd comfyui-digit
pip install -r requirements.txt
gcloud auth application-default login
gcloud config set project YOUR_PROJECT_ID

(Or ComfyUI Manager → search comfyui-digit → install.) Restart ComfyUI, look under DIGIT.

Common issues

Auth is 90% of the failure surface, and it's the same story as the other Vertex nodes: if you get a permissions error, your account can't bill the project (check Vertex AI is enabled and a billing account is attached); if it can't find the project, gcloud config set project before launching, or fill in gcp_project_id on the node.

The other trap is structural and worth planning around: a chat model doesn't naturally emit bare, clean output. If you're using this to feed a prompt into a text encoder, ask for exactly what you want in the system_prompt and keep temperature low, or the model's conversational preamble ("Here is your enhanced prompt:") will leak straight into your conditioning. That's the classic LLM-in-the-graph failure mode, and the fix lives in how you ask, not in the node.

Worth saying plainly: this is a paid, cloud call. Your prompt and any image you attach go to Google. For prompt enhancement that's a reasonable trade; for sensitive client frames, think before you wire them in.

CategoryDIGIT

Inputs (8)

NameTypeDefaultDescription
modelCOMBOgemini-2.5-pro9 options: gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-3.1-pro-preview, +3
promptSTRING
gcp_project_idSTRINGGCP project ID. Auto-detected from DIGIT_GCP_PROJECT env var or GCP metadata.
gcp_regionSTRINGGCP region. Auto-detected from DIGIT_GCP_REGION env var or GCP metadata. Defaults to 'global'.
system_promptoptSTRING
imageoptIMAGE
max_tokensoptINT81921–65536
temperatureoptFLOAT0.700–2

Outputs (1)

NameTypeDescription
responseSTRING