Imagen Image Generation
Google's dedicated text-to-image, not the Nano Banana path
- images
Google actually sells two different image generators, and they are not interchangeable. There's the Gemini-native "Nano Banana" family, and there's Imagen 4 - the older, dedicated text-to-image line with its own endpoint. Most ComfyUI packs only wrap one. This node is the Imagen half of the ComfyUI-API-Toolkit's Gemini service, and it's worth knowing which you're actually calling, because the two behave differently for real.
You'd reach for this when you want Imagen 4's strength: clean, prompt-following, photorealistic text-to-image with genuinely good text rendering baked in. The three dropdown models are Ultra (best quality, slowest, priciest), Standard (the balanced default), and Fast (cheaper and quicker when you're iterating). In a wider workflow it slots in exactly where a local checkpoint would - feed the images output into an upscaler, an img2vid model, or a face detail pass - except the image is born on Google's servers and costs per call.
How it works
Under the hood it calls client.models.generate_images() - the separate generate_images endpoint, not the generate_content one the Nano Banana nodes use. That's the mechanism difference this node exists to expose. Your prompt, aspect ratio, negative prompt, and seed go into a GenerateImagesConfig, the request rides over Google's Developer API, and the returned image bytes get decoded into ComfyUI image tensors and batched together.
The pack wraps the call in exponential-backoff retry for transient errors (429, 5xx), which matters more here than for local nodes - rate limits are a daily reality on paid image APIs.
The inputs and outputs that matter
Most of the panel is set-and-forget. The three you actually touch:
model- the Ultra / Standard / Fast trio. Standard is a fine default; reach for Ultra when it's a hero shot and Fast when you're doing 50 variations.prompt- describe the image. Plain English works; Imagen likes detail.number_of_images- 1 to 4 per call, so you can burn one generation's worth of credits sampling four variants at once.
Everything else is optional. aspect_ratio offers the five Imagen ratios (1:1, 3:4, 4:3, 9:16, 16:9). seed defaults to 0, which means random - set it above 0 if you want reproducible output. person_generation controls how people are handled (allow_adult is the default). negative_prompt is a real Imagen feature, not a local-sampler habit, so use it.
One honest quirk: safety_filter_level has exactly one choice (block_low_and_above), because Google's Developer API only accepts that one level - the tooltip says so itself. It's basically a "yep, that's the filter" toggle.
The single output, images (type IMAGE), is a batch tensor ready to wire into anything that takes an image.
How to install it
This is a pack-level install - the node is one of 68 in ComfyUI-API-Toolkit, so you're installing the whole thing:
cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-API-Toolkit
cd ComfyUI-API-Toolkit
pip install -r requirements.txt
The Gemini service only needs google-genai>=0.8.0 - if you want the other services (Kling, ElevenLabs) you can add their deps later. Easier still: search "API Toolkit" in ComfyUI Manager and let it handle the clone and restart. No model files, no VRAM - this node is a thin HTTP client.
Common issues
The error you'll actually hit is "Imagen returned no images" - that's Google's safety filter quietly refusing your prompt, not a bug in the node. Loosen the prompt, and remember that Imagen 4 (like every closed Google model) has a real filter you cannot tune away. Also: set the key in the node or as GEMINI_API_KEY in your environment, or every call fails with "Gemini API key required." And if you want a different model ID than the dropdown - maybe a brand-new Imagen release that hasn't been added yet - the custom_model override takes priority over the dropdown.
The catch with any API node is the price tag: every queue is a paid call, and ComfyUI caches node outputs, so the pack makes every API node re-run on each queue (an IS_CHANGED override). That's the feature that keeps results fresh - and the same feature that keeps charging you. Iterate deliberately.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Gemini API key. Leave blank to use GEMINI_API_KEY env var. | |
| model | COMBO | imagen-4.0-generate-001 | Imagen model. Ultra = highest quality, Standard = balanced, Fast = cheaper/faster. |
| prompt | STRING | Describe the image to generate. | |
| custom_modelopt | STRING | Override with a custom model ID (takes priority over dropdown). | |
| number_of_imagesopt | INT | 11–4 | How many images to generate in one call (Imagen supports up to 4). |
| aspect_ratioopt | COMBO | 1:1 | Output aspect ratio. Imagen supports: 1:1, 3:4, 4:3, 9:16, 16:9. |
| negative_promptopt | STRING | Things to avoid in the image. | |
| seedopt | INT | 00–2147483647 | Seed for reproducibility. 0 = random. |
| safety_filter_levelopt | COMBO | block_low_and_above | Safety filter threshold. The Developer API only accepts block_low_and_above. (Vertex AI supports more levels.) |
| person_generationopt | COMBO | allow_adult | Whether/how to generate people. Some models enforce stricter defaults. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |