Imagen4 Text To Image
Imagen 4 in ComfyUI — pick your tier (fast, standard, ultra) and mind the one-image rule
- Generated Image
If Imagen 3 was Google's polished-but-plain text-to-image node, Imagen 4 is the one where they remembered there's a fast tier and a flagship tier. This node is a text-to-image API call with a model dropdown: IMAGEN_4_PREVIEW (default), IMAGEN_4_FAST_PREVIEW, and IMAGEN_4_ULTRA_PREVIEW. Same prompt-in, IMAGE-tensor-out pattern as the Imagen 3 node in this pack, but you get to pick how much quality you're paying for on each request.
It's still fully hosted - no weights, no local VRAM, per-image billing, Google's filters, and the invisible SynthID watermark the whole Gemini image family carries. If you've used Imagen 3 in this pack, the inputs will feel familiar, because it's the same shape plus the tier selector. The reason you'd pick this over the 2.5/3.1 Flash Image nodes is the same reason you'd pick Imagen at all: a real negative_prompt, a clean text-to-image-only workflow, and now, tiers to fit the job.
How it works
Straightforward: you pick a model tier and a prompt, the node builds a request through the pack's Google client (Gemini API key or Vertex AI, depending on your auth setup), and the response comes back as a ComfyUI IMAGE tensor you can wire anywhere. Nothing runs locally beyond the request itself. The mechanism worth learning is the rules around the settings, because the tier choices come with real constraints baked into the code.
Inputs and outputs that matter
- model - the tier switch:
IMAGEN_4_PREVIEW,IMAGEN_4_FAST_PREVIEW, orIMAGEN_4_ULTRA_PREVIEW. Fast for quick concepts, standard as the default, ultra when you want the flagship and are ready to pay for it. - prompt - multiline, the whole job, as with Imagen 3.
- negative_prompt - genuinely useful; most of the pack's Gemini-native image nodes don't have one.
- number_of_images - 1 to 4. Here's the trap: the Ultra tier only generates one image at a time. Set
IMAGEN_4_ULTRA_PREVIEWwithnumber_of_imagesabove 1 and the node throws anAPIInputErrorrather than silently ignoring it. Batch with Fast or Preview, not Ultra. - aspect_ratio -
1:1,16:9,4:3,3:4,9:16. - enhance_prompt (default on) - Google rewrites your prompt; disables
seed, same deal as Imagen 3. - seed - 0 lets the API pick; nonzero only works with
enhance_promptoff. - add_watermark - one more constraint from the code: seed is not supported when
add_watermarkis enabled. Turn the watermark on and you lose seed control entirely. - safety_filter_level -
BLOCK_LOW_AND_ABOVEthroughBLOCK_NONE; the dial when generations keep getting refused. - gcp_project_id / gcp_region - for the Vertex AI auth path.
Output: Generated Image (IMAGE).
Installing it
Same pack, same steps as every node here - catnipglitch/comfyui-genmedia-gemini-api, the community fork of Google's official comfyui-google-genmedia-custom-nodes. ComfyUI Manager, search comfyui-google-genmedia-custom-nodes, Install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/catnipglitch/comfyui-genmedia-gemini-api
pip install -r comfyui-genmedia-gemini-api/requirements.txt
Restart, then authenticate. The fork's signature move is the Gemini API key route with no GCP project required:
export GOOGLE_API_KEY=AIza...
# or export GEMINI_API_KEY=AIza...
Or use Vertex AI with gcloud auth application-default login plus gcp_project_id/gcp_region on the node. Restart ComfyUI after setting the variable either way.
Common issues
- "Ultra model only generates one image at a time." The one gotcha most people hit on day one. Drop
number_of_imagesto 1, or switch to Preview/Fast for batches. - "Seed is not supported when add_watermark is enabled." Real constraint, thrown by the code. Pick one: reproducible generations or the explicit watermark.
- "My seed is ignored."
enhance_promptdefaults to on and overrides it. Turn it off. - Refused generations. Google's safety filters are aggressive - the community's been complaining about them since the 4o era. Dial
safety_filter_leveldown, and accept some subjects stay blocked. - Forgetting auth. No key and no project/region on the Vertex path means a ConfigurationError before you ever see an image. The placeholder nodes in this pack are a good way to test your graph structure before you deal with any of this.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | IMAGEN_4_PREVIEW | 3 options: IMAGEN_4_PREVIEW, IMAGEN_4_FAST_PREVIEW, IMAGEN_4_ULTRA_PREVIEW |
| prompt | STRING | A vivid landscape painting of a futuristic city | — |
| person_generation | COMBO | allow_adult | 2 options: allow_adult, dont_allow |
| aspect_ratio | COMBO | 16:9 | 5 options: 1:1, 16:9, 4:3, 3:4, 9:16 |
| number_of_images | INT | 11–4 | — |
| negative_promptopt | STRING | — | |
| seedopt | INT | 00–4294967295 | 0 seed let's Imagen4 API handle randomness. Seed works with enhance_prompt disabled |
| enhance_promptopt | BOOLEAN | true | — |
| add_watermarkopt | BOOLEAN | false | — |
| output_image_typeopt | COMBO | PNG | 2 options: PNG, JPEG |
| safety_filter_levelopt | COMBO | BLOCK_MEDIUM_AND_ABOVE | 4 options: BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH, BLOCK_NONE |
| gcp_project_idopt | STRING | GCP project id where Vertex AI API will query Imagen | |
| gcp_regionopt | STRING | GCP region for Vertex AI API |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Generated Image | IMAGE | — |