Nodes/ComfyUI_Imagen/Google Imagen
ComfyUI Node

Google Imagen

Your GPU Stays Idle While Google Does the Work

By ru4ls·Created 12 months ago·Updated 11 months ago· 4
Google Imagen
  • image
  • mask
  • IMAGE
prompt
model_nameimagen-4.0-generate-001
aspect_ratio1:1
edit_modeinpainting
seed0
add_watermarktrue

This node is the anti-local ComfyUI experience, and that's the whole point. Google Imagen (ImagenNode) doesn't load a model onto your machine - it's a bridge to Google's Vertex AI Imagen API. You wire up a prompt, hit Run, and your image is generated inside Google's cloud for a few cents, then shipped back as a regular IMAGE tensor that flows into your graph like anything else. No VRAM, no checkpoint download, no sampler fiddling. If you've got a Google Cloud project with billing already set up, this is a surprisingly clean way to get Imagen's strong text rendering and photography chops into the same workflow as your local models.

The name is a small lie, in a good way. Despite the code calling ImageGenerationModel.from_pretrained(model_name), nothing is downloaded - that's just the Vertex AI SDK's way of instantiating an API client, not a weights fetch. There's also no API key in the traditional sense, no sk-... pasted into a field. Instead the node leans on Google Application Default Credentials (ADC): you authenticate once with gcloud auth application-default login and set your project in a .env file. It's more setup than an API-key node, but it's the same auth model Google's own tooling uses.

What it does

The node is a single unified input/output block that switches behavior based on whether you wire in an image:

  • No image wired → text-to-image generation. Uses aspect_ratio, seed, and the add_watermark toggle.
  • Image wired → image editing. Pass a mask too and it's inpainting or outpainting (edit_mode); leave the mask unconnected and it does a mask-free, prompt-guided edit of the whole image.

The only required inputs are prompt and model_name. The model dropdown is populated from the pack's data/models.json and offers three Vertex Imagen 4.0 variants: the standard imagen-4.0-generate-001, a fast tier for speed, and ultra for quality. aspect_ratio gives you the five usual suspects (1:1, 9:16, 16:9, 4:3, 3:4). The single output is IMAGE, which you wire straight into PreviewImage or SaveImage.

The one thing that bites people: seed and watermark are enemies. The Imagen API refuses to accept a seed while the automatic watermark is on. So by default (add_watermark = true) your seed is silently ignored - change the seed all you want, you'll keep getting the same-ish result. To get reproducible outputs in text-to-image mode, flip add_watermark to false and then the seed is honored. In edit mode the code passes the seed through directly, so reproducibility behaves a little differently there; either way, "why won't my seed do anything" is the support ticket you're most likely to file with yourself.

Installing it

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

Then restart ComfyUI. The dependencies are light in count but real: python-dotenv, google-auth, and google-cloud-aiplatform (the chunky one). ComfyUI Manager also picks it up under ComfyUI_Imagen if you'd rather install that way. Once installed, you need three things the README walks through: a Google Cloud project with the Vertex AI API enabled, a one-time gcloud auth application-default login, and a .env file in ComfyUI_Imagen/config/ holding PROJECT_ID and LOCATION (copy config/.env.template). Note the .env must live in that exact config/ folder - the auth code loads it from there and prints a loud warning if it's missing.

Where people get burned

  • Black 64×64 image = silent failure. The node wraps everything in error handling and returns a tiny black tensor instead of crashing your workflow - the actual error only shows as a red ERROR: line in the ComfyUI console. If you get a black thumbnail, read the console before you blame the node.
  • "API returned no images" usually means Google's safety filters blocked your prompt. Imagen sits in the same heavily-censored bucket as Google's other image products, and their filtering got stricter in the 2026 policy updates. If you came here expecting local-model freedom, you're in the wrong place.
  • Billing surprises. This is pay-per-image, not a subscription. Fast tier is cheap; ultra adds up fast if you're batch-generating. There's no free local fallback hiding in this pack.
  • Auth errors almost always trace back to the .env location or a project with Vertex AI not enabled. The startup log tells you exactly which piece is missing.

If you already run Google's stack it's a nice tool to have in the box. If your whole life is local-only, this pack probably isn't for you - but that's the point of it, and it does its one job well.

CategoryRu4ls/Imagen

Inputs (8)

NameTypeDefaultDescription
promptSTRING
model_nameCOMBOimagen-4.0-generate-0013 options: imagen-4.0-generate-001, imagen-4.0-fast-generate-001, imagen-4.0-ultra-generate-001
imageoptIMAGE
maskoptMASK
aspect_ratiooptCOMBO1:15 options: 1:1, 9:16, 16:9, 4:3, 3:4
edit_modeoptCOMBOinpainting2 options: inpainting, outpainting
seedoptINT00–18446744073709550000
add_watermarkoptBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE