Nodes/comfyui-stillfront/SF VertexAI Imagen 3 Text to Image
ComfyUI Node

SF VertexAI Imagen 3 Text to Image

Imagen 3 in ComfyUI — Google's text-to-image, minus the ImageFX tab

By razvanmatei-sf·Created 9 months ago·Updated 7 months ago· 0
SF VertexAI Imagen 3 Text to Image
    • images
    project_id
    locationus-central1
    prompt
    modelimagen-3.0-generate-002
    aspect_ratio1:1
    num_images1
    seed1394699067
    negative_prompt
    safety_filter_levelBLOCK_MEDIUM_AND_ABOVE
    person_generationALLOW_ADULT
    enhance_promptfalse
    output_formatimage/png

    Google's Imagen is one of the few frontier image models you can't run locally - there are no weights, and there never will be. If you want its clean, typography-solid output inside ComfyUI instead of on the ImageFX website, SF VertexAI Imagen 3 Text to Image is the bridge. It's a thin wrapper around Vertex AI's Imagen 3.0 API that returns a normal ComfyUI IMAGE tensor, so everything downstream - save, upscale, composite, feed into another model - just works.

    That's the real value proposition, by the way: not that the node does anything clever, but that it turns a cloud call into a first-class node in your graph. It's part of comfyui-stillfront, the SF pack, under Stillfront/VertexAI.

    How it works

    The node uses Google's google-genai library with vertexai=True, which means authentication is your standard Google Cloud Application Default Credentials - the same gcloud auth application-default login you'd use for any GCP project. You give it a project_id and a location (default us-central1), it calls models.generate_images, and it converts the returned bytes back into a tensor. Simple, but you need a Google Cloud project with the Vertex AI API enabled and a billing account. No GPU, no model downloads, no local VRAM.

    The inputs that matter

    Most of the fields are what you'd expect from an image generator, with two model-specific catches:

    • model - three variants: imagen-3.0-generate-002 (default, best quality), imagen-3.0-generate-001, and imagen-3.0-fast-generate-001 (quick and dirty). The catches: negative_prompt only works on the 001 models, and enhance_prompt only works on the 002 model. The author wired both in but they're mutually exclusive by Google's own API design - pick your model, then the corresponding feature.
    • aspect_ratio - five options (1:1, 16:9, 9:16, 4:3, 3:4), mapped to Imagen's fixed resolutions.
    • num_images - 1 to 4, returned as a batch tensor.
    • seed - for reproducible results; it has a "control after generate" widget, so it auto-randomizes after each run unless you lock it.
    • Optional: safety_filter_level and person_generation - Google's policy dials. Defaults are BLOCK_MEDIUM_AND_ABOVE and ALLOW_ADULT, which is the middle of the road.

    Output is a single images output (IMAGE). Wire it to a preview or save node.

    Installing it

    Same pack install as everything else in this collection:

    cd ComfyUI/custom_nodes
    git clone https://github.com/razvanmatei-sf/comfyui-stillfront
    cd comfyui-stillfront
    pip install -r requirements.txt
    

    Then restart. The requirements.txt pulls in google-genai and google-cloud-storage, which are the heavy bits for the Vertex nodes. Before you run, make sure your GCP project has the Vertex AI API enabled and you've authenticated:

    gcloud auth application-default login
    

    You can also set GOOGLE_CLOUD_PROJECT (and GOOGLE_CLOUD_LOCATION) as env vars so you don't have to type the project ID into every node.

    Troubleshooting

    • "No valid images were returned by the API." This is the big one, and it's almost always the safety filter. The node literally prints the rai_filtered_reason to the console when an image is blocked. Loosen safety_filter_level to BLOCK_NONE if your project's policy allows, and restate the prompt - this is Google's censorship, not a bug.
    • "Imagen API call failed." Usually auth. Check that ADC is set up (gcloud auth application-default login) and that your project ID is right - the node needs it if you haven't set GOOGLE_CLOUD_PROJECT.
    • Negative prompt silently ignored. You're on the 002 model. Switch to a 001 variant.

    One honest caveat: Imagen images carry Google's invisible SynthID watermark, and the service is aggressively moderated compared to local generation. If you're building an uncensored pipeline, this is the wrong tool - it's for when you want Imagen's specific look and are fine with Google's rules.

    CategoryStillfront/VertexAI

    Inputs (12)

    NameTypeDefaultDescription
    project_idSTRINGGoogle Cloud project ID
    locationSTRINGus-central1Google Cloud region (e.g., us-central1)
    promptSTRINGText description of the image to generate
    modelCOMBOimagen-3.0-generate-002Imagen 3.0 model variant
    aspect_ratioCOMBO1:1Output image aspect ratio
    num_imagesINT11–4Number of images to generate (1-4)
    seedINT13946990670–4294967295Random seed for reproducible results
    negative_promptoptSTRINGWhat to avoid in the generated image (only supported by 001 models)
    safety_filter_leveloptCOMBOBLOCK_MEDIUM_AND_ABOVESafety filter strictness level
    person_generationoptCOMBOALLOW_ADULTPerson generation policy
    enhance_promptoptBOOLEANfalseUse prompt rewriter to enhance the prompt (only 002 model)
    output_formatoptCOMBOimage/pngOutput image format

    Outputs (1)

    NameTypeDescription
    imagesIMAGE