Nodes/ComfyUI-VertexAPI/Imagen Generate (Vertex AI)
ComfyUI Node

Imagen Generate (Vertex AI)

Paying Google per image so your GPU doesn't have to

By Aryan185·Created 9 months ago·Updated about a month ago· 4
Imagen Generate (Vertex AI)
    • images
    promptA majestic lion in the savanna
    project_id
    locationus-central1
    service_account
    modelimagen-4.0-generate-001
    number_of_images1
    aspect_ratio1:1
    image_size1K
    seed69
    guidance_scale7.5
    negative_prompt

    Imagen 4.0 is Google's answer to the local text-to-image stack, and honestly, it's good enough that you'll stop noticing you're paying per render. It's strong on photorealism, renders text into images better than most closed competitors, and it's priced per image with zero VRAM cost to you. If you've got a Vertex AI project set up, this node drops the whole Imagen lineup into your ComfyUI graph - Ultra, standard, and fast tiers, plus the older Imagen 3.0 if you want the familiar one.

    What it does

    Type a prompt, pick a model, get one to four images back. It's the straightforward text-to-image node of the pack, and the sibling to the Imagen Edit node for mask-driven changes. Where it earns its keep over a local checkpoint: no model files on disk, no sampler fiddling, and quality that doesn't depend on which community checkpoint you happened to download. The trade is the usual closed-model deal - censored, billed per call, and your prompts go to Google.

    How it works

    The node builds a GenerateImagesConfig with your aspect ratio, guidance scale, seed, and (for the full-size Imagen 4.0 models) image size, then calls Vertex AI's generate_images. The returned images come back as bytes, get decoded to PIL, and land as a stacked IMAGE tensor ready for the rest of your graph. Nothing runs locally except the decode.

    The inputs that matter

    The same credential trio as every node in this pack: project_id, location, and service_account - and again, service_account wants the JSON contents pasted in, not a file path, despite what the README implies.

    After auth, you'll mostly touch:

    • model - imagen-4.0-ultra-generate-001, imagen-4.0-generate-001 (default), imagen-4.0-fast-generate-001, or imagen-3.0-generate-002.
    • number_of_images - 1 to 4 per call. More images = more money; start at 1.
    • aspect_ratio - 1:1, 9:16, 16:9, 4:3, 3:4.
    • image_size - 1K or 2K. Worth knowing: the source only applies this to the full Imagen 4.0 models, not the fast tier.
    • guidance_scale and seed - the usual dials. Default 7.5 guidance is a fine starting point.

    negative_prompt is optional and does the predictable thing.

    Outputs

    images - a single IMAGE output (stacked tensor, so multiple generations come as one batch). Wire it straight into a preview or save node.

    Installing

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

    Restart ComfyUI, or find ComfyUI-VertexAPI in ComfyUI Manager. The real dependency load is google-genai plus pillow, numpy, torch - nothing exotic.

    Where people get burned

    The usual closed-model caveats apply, and they're worth stating plainly. Imagen is aggressively safety-filtered - this is the same house policy that keeps Nano Banana "powerful, unimaginative, and massively biased," as the community puts it. Don't expect it to do things your local checkpoint would shrug at. And mind the billing: at a few cents a render it's cheap to try, but a batch loop of 100 images is real money. If you're hitting the filter wall or the bill, that's the sign this node is the wrong tool - not a bug you can configure around.

    Categoryimage/generation

    Inputs (11)

    NameTypeDefaultDescription
    promptSTRINGA majestic lion in the savanna
    project_idSTRING
    locationCOMBOus-central140 options: global, us-central1, us-east1, us-east4, us-east5, us-south1, +34
    service_accountSTRING
    modelCOMBOimagen-4.0-generate-0014 options: imagen-4.0-ultra-generate-001, imagen-4.0-generate-001, imagen-4.0-fast-generate-001, imagen-3.0-generate-002
    number_of_imagesINT11–4
    aspect_ratioCOMBO1:15 options: 1:1, 9:16, 16:9, 4:3, 3:4
    image_sizeCOMBO1K2 options: 1K, 2K
    seedINT691–2147483646
    guidance_scaleFLOAT7.51–20
    negative_promptoptSTRING

    Outputs (1)

    NameTypeDescription
    imagesIMAGE