SF VertexAI Imagen 4 Text to Image
Google's Imagen 4 straight into ComfyUI, billed to your GCP project
- images
If you want Google's newest image model but don't want to leave ComfyUI, this node is the direct line. SF VertexAI Imagen 4 Text to Image sends your prompt to Imagen 4.0 through Google Cloud's Vertex AI and returns a real IMAGE tensor, so everything downstream - preview, upscale, VAE-free compositing, whatever - works exactly like a local generation. It's a pure text-to-image node; the sibling Imagen 4 Upscale covers enlargement, and if you want Google's edit model you'd reach for the Nano Banana nodes instead.
How it works
The node wraps the official google-genai SDK. On first run it builds a genai.Client(vertexai=True, project=..., location=...), which authenticates through Application Default Credentials - the same auth you set up once with the gcloud CLI. It then calls client.models.generate_images with your prompt, aspect ratio, and size, decodes the returned image bytes into a batch tensor, and hands it to ComfyUI. No API key goes in the node; your GCP project and billing do the work. That's the whole mental model: Vertex AI nodes = your cloud bill, local nodes = your GPU.
The inputs that matter
- project_id - your Google Cloud project ID. This is the one you actually have to look up; it's not "ComfyUI project."
- location -
us-central1is the sensible default. - prompt - the generation prompt.
- model -
imagen-4.0-generate-001by default, with fast/standard/ultra variants. The tooltip spells it out: fast = quick, standard = balanced, ultra = highest quality. - aspect_ratio and image_size - sizes are
1Kand2K, and 2K is only supported by the standard and ultra models. If you set 2K on fast, expect an error. - num_images - 1 to 4 per run.
- seed - defaults to a random value each load; set it for reproducible runs.
Worth knowing in the optional block: enhance_prompt (a prompt rewriter, preview feature), person_generation (default ALLOW_ADULT - this is a Google safety policy, not an on/off for anything spicy), and safety_filter_level (default BLOCK_MEDIUM_AND_ABOVE). These are the dials you touch when a perfectly reasonable prompt comes back blocked.
Installing it
It ships in the SF ComfyUI Nodes pack from Stillfront. ComfyUI Manager → "SF ComfyUI Nodes" → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Stillfront/comfyui-sf-nodes.git
cd comfyui-sf-nodes
pip install -r requirements.txt
The pack's requirements.txt pulls in google-genai, which is the only heavy dependency this node needs. Beyond that, you need a Google Cloud project with the Vertex AI API enabled and billing turned on. Authenticate once:
gcloud auth application-default login
Common issues
Two failure classes dominate. First, auth: "failed to locate Application Default Credentials" means you skipped gcloud auth application-default login or ran it in a different shell/user than ComfyUI. Second, money and quotas: no billing on the project, or a disabled Vertex AI API, and every call fails before it starts. And don't be surprised when a clean prompt gets refused - Google's filters are aggressive, which is exactly what the person_generation and safety_filter_level options exist to adjust. For a first run, leave everything at defaults, hit execute, and confirm you get a tensor back before you start tuning the cloud dials.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| project_id | STRING | Google Cloud project ID | |
| location | STRING | us-central1 | Google Cloud region (e.g., us-central1) |
| prompt | STRING | Text description of the image to generate | |
| model | COMBO | imagen-4.0-generate-001 | Imagen 4.0 model variant (fast=quick, standard=balanced, ultra=highest quality) |
| aspect_ratio | COMBO | 1:1 | Output image aspect ratio |
| image_size | COMBO | 1K | Output resolution (2K only supported by standard and ultra models) |
| num_images | INT | 11–4 | Number of images to generate (1-4) |
| seed | INT | 25006330270–4294967295 | Random seed for reproducible results |
| safety_filter_levelopt | COMBO | BLOCK_MEDIUM_AND_ABOVE | Safety filter strictness level |
| person_generationopt | COMBO | ALLOW_ADULT | Person generation policy |
| enhance_promptopt | BOOLEAN | false | Use prompt rewriter to enhance the prompt (preview feature) |
| output_formatopt | COMBO | image/png | Output image format |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |