ComfyUI Node

Imagen Text-to-Image

The best default generator in the pack

By khanhlvg·Created about a year ago·Updated about a year ago· 4
Imagen Text-to-Image
    • images
    project_id
    locationus-central1
    promptA majestic lion in the savannah, 4k, high detail
    num_images1
    aspect_ratio
    model
    image_size
    seed426682022
    safety_filter_level
    person_generation
    enhancePrompttrue
    output_mime_type

    If you're going to use exactly one node from the Vertex AI pack, this is the one. Imagen Text-to-Image wraps Google's current flagship generation models - Imagen 4, 4 Ultra, and 4 Fast - and returns a standard IMAGE you can treat like any other ComfyUI output. It's the closest this pack gets to "free quality": no checkpoint download, no VRAM math, just a prompt and a billable API call that returns genuinely good 1K or 2K images.

    What it is

    A text-to-image node with three model tiers in the dropdown:

    • imagen-4.0-generate-001 - the quality/speed default.
    • imagen-4.0-ultra-generate-001 - top quality, slower and pricier, when the first draft matters.
    • imagen-4.0-fast-generate-001 - cheap quick drafts for iterating on composition before committing to Ultra.

    enhancePrompt is on by default and worth leaving on - Imagen rewrites your prompt into something more descriptive before generating, and the results are noticeably better for it. You can flip it off if you want your wording passed through verbatim.

    How it works

    It uses the google-genai client's generate_images API with the standard Imagen config: aspect ratio, image count, seed, safety filter, person generation, output format, and add_watermark=False (all Imagen output carries an invisible SynthID watermark regardless). Results are decoded to RGBA tensors and stacked into a single batched IMAGE.

    Inputs that matter

    • prompt - multiline, natural language works best.
    • model - the tier dropdown above.
    • num_images - 1 to 4 per call.
    • aspect_ratio - 1:1, 16:9, 9:16, 4:3, 3:4.
    • image_size - 1K or 2K. This one has a trap: 2K is only supported by imagen-4.0-generate and imagen-4.0-ultra-generate. Pick 2K with Fast and the node raises an error telling you exactly that.
    • seed, safety_filter_level, person_generation, output_mime_type (PNG/JPEG) - the standard knobs.

    Output is images, a standard IMAGE tensor - preview it, save it, or feed it into local upscaling and detail nodes.

    Installing

    Pack install. ComfyUI Manager → search "Vertex AI", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/khanhlvg/vertex-ai-comfyui-nodes.git
    cd vertex-ai-comfyui-nodes
    pip install -r requirements.txt
    

    Then the shared auth: gcloud auth application-default login, and GOOGLE_CLOUD_PROJECT / GOOGLE_CLOUD_LOCATION (defaults us-central1) set in the environment or the node's fields. You need a billing-enabled project with the Vertex AI / Imagen API enabled. No model downloads - the requirements file is just Google SDKs plus torch/torchaudio for tensor plumbing.

    Where people get burned

    • The 2K-with-Fast error is the most common surprise. Read the model list before you set image size.
    • Safety filters - the "no images returned" message means the filter blocked the prompt. Person generation and safety level have separate controls; if you're doing people, person_generation has to be ALLOW_ALL or ALLOW_ADULT, not DONT_ALLOW.
    • Cost - Ultra is genuinely expensive per image, and it's easy to leave the model on Ultra and batch-generate yourself a surprising bill. Iterate on Fast, render on Ultra.
    • Invisible watermark - SynthID is baked into every Imagen image. Fine for most work, a factor if you're selling.

    One honest take: local open models have closed most of the still-image gap, and this node won't beat a tuned local workflow for style consistency. Where it wins is speed to a clean result, correct text rendering, and zero VRAM pressure. Reach for it when the local stack is fighting you.

    CategoryVertex AI

    Inputs (12)

    NameTypeDefaultDescription
    project_idSTRING
    locationSTRINGus-central1
    promptSTRINGA majestic lion in the savannah, 4k, high detail
    num_imagesINT11–4
    aspect_ratioCOMBO5 options: 1:1, 16:9, 9:16, 4:3, 3:4
    modelCOMBO3 options: imagen-4.0-generate-001, imagen-4.0-ultra-generate-001, imagen-4.0-fast-generate-001
    image_sizeCOMBO2 options: 1K, 2K
    seedINT4266820220–4294967295
    safety_filter_levelCOMBO4 options: BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE, BLOCK_NONE
    person_generationCOMBO3 options: ALLOW_ALL, ALLOW_ADULT, DONT_ALLOW
    enhancePromptBOOLEANtrue
    output_mime_typeCOMBO2 options: image/png, image/jpeg

    Outputs (1)

    NameTypeDescription
    imagesIMAGE