Nodes/ComfyUI FSL Nodes/FSL Gemini Image Generator
ComfyUI Node

FSL Gemini Image Generator

The fastest Gemini image node in this pack (and the one with zero moving parts)

By fredlef·Created about a year ago·Updated 9 months ago· 13
FSL Gemini Image Generator
    • IMAGE
    api_key
    prompt
    model_namegemini-3-pro-image-preview
    aspect_ratio16:9

    If you just want to stick a Gemini text-to-image node in a workflow and have it work, this is the one. FSLGeminiImageGenerator is the "Artist (Pro)" node in Fred LeFevre's FSL pack: a thin wrapper around Google's generate_content API that turns a prompt, a model name, and an aspect ratio into an IMAGE tensor. No inpainting, no masks, no init images - nothing to get wrong. Four inputs, one output, done.

    That's the whole pitch. This is the node you reach for when you want Nano Banana-class cloud generation (the KB's closed-source-models.md calls the Gemini 3 Pro Image lineage "technically impressive but heavily censored" - more on that below) without building a graph around it.

    How it works

    Under the hood it's almost embarrassingly simple: the node appends your aspect ratio to the prompt as an instruction, calls client.models.generate_content() with the model you picked, pulls the inline image bytes out of the response, and converts them to a ComfyUI IMAGE tensor. That "request the aspect ratio via prompt injection" trick is worth knowing - the model doesn't have a real aspect-ratio parameter, so the node just asks nicely in the prompt text.

    Two behaviors matter:

    • Smart gatekeeping. If the prompt is empty, the node skips the API call entirely and returns a blank 64×64 black image. That's deliberate: it lets the FSLGeminiChat "Creative Director" node route to this generator without spending money when you're only chatting.
    • No key → blank, not error. Missing API key also returns the blank image rather than crashing the graph. Handy in a workflow, confusing if you're debugging - the real reason is in your terminal, where it prints FSL Gemini Image: No prompt (Chat Mode). Skipping.

    The inputs that matter

    • prompt - the actual instruction. Empty skips the call.
    • model_name - defaults to gemini-3-pro-image-preview, with gemini-2.0-flash, gemini-2.0-flash-exp, and gemini-1.5-pro in the list. The -exp entries are previews; they rot, and this pack's changelog is literally a record of Google deprecating models out from under it.
    • aspect_ratio - seven choices from 16:9 down to 2:3, injected into the prompt.
    • api_key - leave blank to fall back on the GEMINI_API_KEY or GOOGLE_API_KEY environment variable.

    Output is a single IMAGE socket. Wire it into a preview node or straight into a saver.

    Install

    Through ComfyUI Manager, search "ComfyUI FSL Nodes". Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fredlef/Comfyui_FSL_Nodes
    cd Comfyui_FSL_Nodes
    pip install -r requirements.txt   # google-genai, requests, pillow, numpy
    

    Restart ComfyUI. On Windows portable, use .\python_embeded\python.exe -m pip install --upgrade google-genai requests. There are no model downloads - everything runs in Google's cloud, so the only real requirement is the google-genai SDK and a key.

    Gotchas

    The blank-image-when-no-key behavior is the #1 confusion trap - a silently black output usually means no API key reached the node. If google-genai isn't installed the node prints FSL Nodes Error: 'google-genai' library not found. at startup. And remember the censorship: Google's image models are aggressive about safety filtering, so if your prompt gets zero responses or a tiny black square and you know the key works, that's likely the filter, not the node. Set GEMINI_API_KEY in your startup script so you never paste a key into a workflow you might share.

    CategoryFSL Nodes

    Inputs (4)

    NameTypeDefaultDescription
    api_keySTRING
    promptSTRING
    model_nameCOMBOgemini-3-pro-image-preview4 options: gemini-3-pro-image-preview, gemini-2.0-flash, gemini-2.0-flash-exp, gemini-1.5-pro
    aspect_ratioCOMBO16:97 options: 16:9, 1:1, 9:16, 4:3, 3:4, 3:2, +1

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE