ComfyUI Node

Imagen3 Text To Image

Google's Imagen 3 in your graph — a text-to-image API node with a real negative prompt

By catnipglitch·Created 5 months ago·Updated 5 months ago· 0
Imagen3 Text To Image
    • Generated Image
    promptA vivid landscape painting of a futuristic city
    person_generationALLOW_ADULT
    aspect_ratio16:9
    number_of_images1
    negative_prompt
    seed0
    enhance_prompttrue
    add_watermarkfalse
    output_image_typePNG
    safety_filter_levelBLOCK_MEDIUM_AND_ABOVE
    gcp_project_id
    gcp_region

    Google's Imagen has always been the "serious" branch of its image stack - the one that's more about polished, composed image generation than the fast-and-loose Nano Banana line. This node puts Imagen 3 (imagen-3.0-generate-002) into a ComfyUI graph as a plain text-to-image node, and it's worth knowing about for one specific reason: it has a real negative_prompt input, which most of Google's Gemini-native image models don't offer. If you've ever fought a Nano Banana workflow to keep something out of a picture, this is the Google node that actually lets you.

    The catch is the same one that applies to every node in this pack: it's an API call. No weights download, no local VRAM - you send a prompt to Google, you pay per image, and everything returns as a standard IMAGE tensor. It's also Google's filter, not yours: expect the aggressive content safety and invisible SynthID watermarking that the community has griped about for years.

    How it works

    The node builds a request and sends it to the Imagen 3 API through the pack's client - either the Gemini API key route or Vertex AI, depending on your setup (more on that below). Your prompt goes in, an IMAGE tensor comes out, ready to wire into a preview, save node, upscaler, or anything else. Simple enough that there's no real mechanism to learn; the interesting part is the settings.

    Inputs and outputs that matter

    • prompt - multiline, the main description. This is your whole job.
    • negative_prompt - the standout. A genuine "exclude this" field, which most of the Gemini image nodes in this pack simply don't have.
    • number_of_images - 1 to 4 per request. Batch it if you're iterating on a concept; just remember you're billed per image.
    • aspect_ratio - five options: 1:1, 16:9, 4:3, 3:4, 9:16.
    • person_generation - ALLOW_ADULT / DONT_ALLOW, Google's policy switch for whether the model will depict people at all.
    • enhance_prompt (default on) - Google rewrites your prompt for quality. Useful, but it disables seed, so if you're hunting for a reproducible generation, turn it off.
    • seed - set 0 and the API picks randomness; nonzero works only with enhance_prompt off.
    • add_watermark - toggles the invisible SynthID digital watermark (all Gemini images carry it anyway; this just controls the explicit marker).
    • safety_filter_level - BLOCK_LOW_AND_ABOVE up to BLOCK_NONE. If your generations keep getting refused, this is the dial.
    • gcp_project_id / gcp_region - only needed for the Vertex AI path.

    The single output is Generated Image (IMAGE).

    Installing it

    The node ships in catnipglitch/comfyui-genmedia-gemini-api, a community fork of Google's official comfyui-google-genmedia-custom-nodes. Via ComfyUI Manager, search comfyui-google-genmedia-custom-nodes and Install, or:

    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 set up auth. The fork's headline feature is that the Gemini API key route works without any GCP project - set one environment variable and you're done:

    export GOOGLE_API_KEY=AIza...
    # or export GEMINI_API_KEY=AIza...
    

    Alternatively the Vertex AI route uses ADC (gcloud auth application-default login) and needs gcp_project_id + gcp_region filled in. Either way, restart ComfyUI after setting the variable.

    Common issues

    • "Generation refused / blank result." Google's safety filter is real and aggressive. Try safety_filter_level at BLOCK_ONLY_HIGH or BLOCK_NONE, and expect some subjects to be blocked no matter what.
    • "My seed does nothing." Because enhance_prompt defaults to on and silently disables it. Turn it off, then seeds work.
    • "Error: GCP project/region required." You're on the Vertex path without a key set. Either set GOOGLE_API_KEY or GEMINI_API_KEY, or provide project + region inputs. The pack is explicit that every node needs project/region on the Vertex route.
    • Cost creep. This is billed per call, and number_of_images=4 is four charges. The placeholder nodes in this pack exist precisely so you don't burn money testing the wiring.
    CategoryGoogle AI/Imagen3

    Inputs (12)

    NameTypeDefaultDescription
    promptSTRINGA vivid landscape painting of a futuristic city
    person_generationCOMBOALLOW_ADULT2 options: ALLOW_ADULT, DONT_ALLOW
    aspect_ratioCOMBO16:95 options: 1:1, 16:9, 4:3, 3:4, 9:16
    number_of_imagesINT11–4
    negative_promptoptSTRING
    seedoptINT00–42949672950 seed let's Imagen3 API handle randomness. Seed works with enhance_prompt disabled
    enhance_promptoptBOOLEANtrue
    add_watermarkoptBOOLEANfalse
    output_image_typeoptCOMBOPNG2 options: PNG, JPEG
    safety_filter_leveloptCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH, BLOCK_NONE
    gcp_project_idoptSTRINGGCP project id where Vertex AI API will query Imagen
    gcp_regionoptSTRINGGCP region for Vertex AI API

    Outputs (1)

    NameTypeDescription
    Generated ImageIMAGE