Nodes/ComfyUI-ExternalAPI-Helpers/Google Imagen Generator
ComfyUI Node

Google Imagen Generator

High-end text-to-image with just a Gemini key

By Aryan185·Created about a year ago·Updated about a month ago· 14
Google Imagen Generator
    • images
    prompt
    api_key
    model
    number_of_images1
    aspect_ratio
    image_size
    seed69
    guidance_scale7.5
    negative_prompt

    Imagen 4 is Google's flagship text-to-image model, and the nice thing about this node is how boringly simple it is: give it a prompt and a Gemini API key - the same key as every other Google node in this pack - and it returns images. No Google Cloud project, no service account, no Vertex AI. It's the low-friction sibling to the pack's Imagen Edit node, which demands all of those.

    What you get for the key is Imagen's strengths: clean compositions, strong prompt adherence, and noticeably better text rendering than the average local model. The community history puts Google's image stack (Nano Banana/Imagen) as "technically impressive but heavily censored" - expect Google's filters to be opinionated about what it will and won't draw.

    How it works

    The node uses the google-genai SDK (genai.Client with your API key) and calls the model's generation endpoint with your prompt and settings. Images come back as bytes, decoded into a Comfy IMAGE. All inference happens at Google; your machine just reshapes the result.

    The inputs that matter

    • prompt - the creative input.
    • model - three Imagen 4.0 options: models/imagen-4.0-ultra-generate-001 (best quality, slowest, priciest), models/imagen-4.0-generate-001 (the balanced default), and models/imagen-4.0-fast-generate-001 (quick iteration, lower ceiling). Start with the standard one; reach for ultra for finals.
    • number_of_images - 1 to 4 per call. This is your cost lever.
    • aspect_ratio - 1:1, 9:16, 16:9, 4:3, 3:4. Note the list is small - no ultrawide here.
    • image_size - 1K or 2K. 2K is the quality and cost jump.
    • guidance_scale - 1–20, default 7.5. Higher = sticks closer to the prompt (at some cost to variety/naturalness).
    • negative_prompt (optional) - what to keep out.
    • seed / api_key - seed for ComfyUI re-runs; key in the field or as a .env variable name (GEMINI_API_KEY).

    The output

    images - an IMAGE output (all generated images in one batch). Straight into a preview or save node.

    Installing it

    One node in the Aryan185/ComfyUI-ExternalAPI-Helpers pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Aryan185/ComfyUI-ExternalAPI-Helpers.git
    cd ComfyUI-ExternalAPI-Helpers
    pip install -r requirements.txt
    

    Restart ComfyUI; find "Google Imagen Generator" under image/generation. The google-genai dependency is the one that matters (you may already have it from the Gemini nodes). Get a key at aistudio.google.com/app/api-keys, paste it in the field or set GEMINI_API_KEY in .env.

    Where people get burned

    Billing and quotas. AI Studio keys have rate limits and paid tiers; if you hammer number_of_images at 4 on 2K ultra, you'll hit limits fast and the errors look like node failures. Iterate small (1 image, 1K, standard model), then scale up for the final pass. And remember the filter story - Imagen is among the more aggressively filtered models Google ships, so a refusal is the model's content policy, not a bug.

    Compared to the pack's other image options: it's more "clean corporate ad" aesthetic than Nano Banana's creative weirdness, and it can't edit (that's the Vertex-only Imagen Edit node). For straight text-to-image with a Google key you already own, it's a solid default.

    Categoryimage/generation

    Inputs (9)

    NameTypeDefaultDescription
    promptSTRING
    api_keySTRINGDirectly put Gemini API key or .env variable name (GEMINI_API_KEY)
    modelCOMBO3 options: models/imagen-4.0-ultra-generate-001, models/imagen-4.0-generate-001, models/imagen-4.0-fast-generate-001
    number_of_imagesINT11–4
    aspect_ratioCOMBO5 options: 1:1, 9:16, 16:9, 4:3, 3:4
    image_sizeCOMBO2 options: 1K, 2K
    seedINT691–2147483646
    guidance_scaleFLOAT7.51–20
    negative_promptoptSTRING

    Outputs (1)

    NameTypeDescription
    imagesIMAGE