SF VertexAI Imagen 3 Text to Image
Imagen 3 in ComfyUI — Google's text-to-image, minus the ImageFX tab
- images
Google's Imagen is one of the few frontier image models you can't run locally - there are no weights, and there never will be. If you want its clean, typography-solid output inside ComfyUI instead of on the ImageFX website, SF VertexAI Imagen 3 Text to Image is the bridge. It's a thin wrapper around Vertex AI's Imagen 3.0 API that returns a normal ComfyUI IMAGE tensor, so everything downstream - save, upscale, composite, feed into another model - just works.
That's the real value proposition, by the way: not that the node does anything clever, but that it turns a cloud call into a first-class node in your graph. It's part of comfyui-stillfront, the SF pack, under Stillfront/VertexAI.
How it works
The node uses Google's google-genai library with vertexai=True, which means authentication is your standard Google Cloud Application Default Credentials - the same gcloud auth application-default login you'd use for any GCP project. You give it a project_id and a location (default us-central1), it calls models.generate_images, and it converts the returned bytes back into a tensor. Simple, but you need a Google Cloud project with the Vertex AI API enabled and a billing account. No GPU, no model downloads, no local VRAM.
The inputs that matter
Most of the fields are what you'd expect from an image generator, with two model-specific catches:
model- three variants:imagen-3.0-generate-002(default, best quality),imagen-3.0-generate-001, andimagen-3.0-fast-generate-001(quick and dirty). The catches:negative_promptonly works on the 001 models, andenhance_promptonly works on the 002 model. The author wired both in but they're mutually exclusive by Google's own API design - pick your model, then the corresponding feature.aspect_ratio- five options (1:1,16:9,9:16,4:3,3:4), mapped to Imagen's fixed resolutions.num_images- 1 to 4, returned as a batch tensor.seed- for reproducible results; it has a "control after generate" widget, so it auto-randomizes after each run unless you lock it.- Optional:
safety_filter_levelandperson_generation- Google's policy dials. Defaults areBLOCK_MEDIUM_AND_ABOVEandALLOW_ADULT, which is the middle of the road.
Output is a single images output (IMAGE). Wire it to a preview or save node.
Installing it
Same pack install as everything else in this collection:
cd ComfyUI/custom_nodes
git clone https://github.com/razvanmatei-sf/comfyui-stillfront
cd comfyui-stillfront
pip install -r requirements.txt
Then restart. The requirements.txt pulls in google-genai and google-cloud-storage, which are the heavy bits for the Vertex nodes. Before you run, make sure your GCP project has the Vertex AI API enabled and you've authenticated:
gcloud auth application-default login
You can also set GOOGLE_CLOUD_PROJECT (and GOOGLE_CLOUD_LOCATION) as env vars so you don't have to type the project ID into every node.
Troubleshooting
- "No valid images were returned by the API." This is the big one, and it's almost always the safety filter. The node literally prints the
rai_filtered_reasonto the console when an image is blocked. Loosensafety_filter_leveltoBLOCK_NONEif your project's policy allows, and restate the prompt - this is Google's censorship, not a bug. - "Imagen API call failed." Usually auth. Check that ADC is set up (
gcloud auth application-default login) and that your project ID is right - the node needs it if you haven't setGOOGLE_CLOUD_PROJECT. - Negative prompt silently ignored. You're on the 002 model. Switch to a 001 variant.
One honest caveat: Imagen images carry Google's invisible SynthID watermark, and the service is aggressively moderated compared to local generation. If you're building an uncensored pipeline, this is the wrong tool - it's for when you want Imagen's specific look and are fine with Google's rules.
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-3.0-generate-002 | Imagen 3.0 model variant |
| aspect_ratio | COMBO | 1:1 | Output image aspect ratio |
| num_images | INT | 11–4 | Number of images to generate (1-4) |
| seed | INT | 13946990670–4294967295 | Random seed for reproducible results |
| negative_promptopt | STRING | What to avoid in the generated image (only supported by 001 models) | |
| 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 (only 002 model) |
| output_formatopt | COMBO | image/png | Output image format |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |