Nodes/ComfyUI_LLM_Banana/🍌 Gemini Banana Text to Image
ComfyUI Node

🍌 Gemini Banana Text to Image

The cleanest Nano Banana door

By xuchenxu168·Created 12 months ago·Updated 9 months ago· 46
🍌 Gemini Banana Text to Image
    • generation_text
    • generated_image
    • grounding_info
    api_key
    promptA beautiful landscape with mountains and lake
    negative_prompt
    modelgemini-3-pro-image-preview
    proxyNone
    aspect_ratioAuto
    response_modalityTEXT_AND_IMAGE
    output_resolutionAuto (Model Default)
    upscale_factor1x (不放大)
    gigapixel_modelHigh Fidelity
    qualityhd
    stylenatural
    detail_levelProfessional Detail
    camera_controlAuto Select
    lighting_controlAuto Settings
    template_selectionAuto Select
    temperature1.00
    top_p0.95
    top_k40
    max_output_tokens8192
    seed0
    custom_instructions
    safety_leveldefault
    system_instruction_presetnone
    custom_system_instruction
    enable_google_searchfalse
    enable_iterative_refinementfalse
    keep_last_turns3
    reset_conversationfalse
    lock_seedfalse
    enable_conversation_summaryfalse
    summary_injectionSystem Instruction
    summary_max_chars600

    The mirror image-gen node is the pragmatic pick when you can't deal with Google billing. This one is the opposite choice: "🍌 Gemini Banana Text to Image" goes straight to Google's official API with your own key - the cleanest, least-flaky route to Nano Banana / Gemini 3 Pro Image generation that this pack offers. If you have a Google AI Studio key, start here instead of a mirror; fewer variables, no reseller in the middle, and you keep the full model feature set.

    It's text-to-image only (there's a separate edit node if you need image input), and it brings the pack's usual control surface: aspect ratio, 1K/2K/4K output resolution, quality/style/detail presets, camera and lighting controls, a negative prompt (a nice extra the raw Gemini API doesn't really have), and Google Search grounding via the optional enable_google_search flag.

    How it works

    Calls Gemini's generateContent with imageConfig (aspect ratio + image size) and responseModalities. The camera/lighting/template presets are the pack's own prompt-injection layer - they get baked into the request as structured instructions, so "Professional Portrait" + "Golden Hour" actually steer the model toward that look. The negative prompt is likewise folded into the instruction side of the call.

    The inputs that matter

    • api_key - your Google AI Studio key. This is the official path, so no mirror_site dropdown here.
    • prompt / negative_prompt - what to draw, and what to avoid. Default prompt is a landscape; replace it.
    • model - gemini-3-pro-image-preview (default) or the 2.5-flash image models. Pro is the quality pick; flash is cheaper and faster.
    • aspect_ratio - Auto or one of 10 ratios.
    • response_modality - TEXT_AND_IMAGE or IMAGE_ONLY.
    • output_resolution - Auto / 1K / 2K / 4K. 4K costs more; Auto is a sensible default.
    • upscale_factor / gigapixel_model - Topaz hook (needs the optional face-restore extras to function).
    • quality, style, detail_level, camera_control, lighting_control, template_selection - the presets. A short list you'll actually touch: style (natural/vivid/artistic/cinematic…), quality (standard→ai_ultra), and template_selection (portrait, landscape, product, anime…).
    • temperature / top_p / top_k / max_output_tokens / seed - sampling.
    • custom_instructions (optional) - free-form extra guidance.
    • enable_google_search (optional) - grounding; you'll see grounding_info on the output when it's on.
    • Optional refinement block: enable_iterative_refinement, keep_last_turns, reset_conversation, lock_seed, conversation summary.

    Outputs: generated_image (IMAGE), generation_text (STRING), grounding_info (STRING).

    Install

    ComfyUI Manager → ComfyUI_LLM_Banana, or:

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

    Requires google-genai>=1.51.0. Restart.

    Gotchas

    Cost: Pro image calls are metered per image and resolution, and this pack's love of defaults (4K, Pro) will quietly inflate your bill if you don't dial it back to flash + 1K for drafts. Also, the same filter reality as every closed model: whatever Google refuses, this node refuses - there's no bypass, and a "negative prompt" won't unblock a content block. And the 4K/upscale options are dead weight unless you've installed requirements_face_restore.txt for the Gigapixel path.

    CategoryKen-Chen/LLM-Nano-Banana

    Inputs (33)

    NameTypeDefaultDescription
    api_keySTRING
    promptSTRINGA beautiful landscape with mountains and lake
    negative_promptSTRING
    modelCOMBOgemini-3-pro-image-preview3 options: gemini-3-pro-image-preview, gemini-2.5-flash-image, gemini-2.5-flash-image-preview
    proxySTRINGNone
    aspect_ratioCOMBOAuto图像宽高比 (Gemini官方API支持)
    response_modalityCOMBOTEXT_AND_IMAGE响应模式:TEXT_AND_IMAGE=文字+图像,IMAGE_ONLY=仅图像
    output_resolutionCOMBOAuto (Model Default)🔥 仅 Nano Banana 2 (gemini-3-pro-image-preview) 支持:通过 imageSize 参数直出 1K/2K/4K 分辨率(与 aspect_ratio 组合生成对应尺寸)。其他模型会忽略此参数。
    upscale_factorCOMBO1x (不放大)使用Topaz Gigapixel AI进行智能放大
    gigapixel_modelCOMBOHigh FidelityGigapixel AI放大模型
    qualityCOMBOhd5 options: standard, hd, ultra_hd, ai_enhanced, ai_ultra
    styleCOMBOnatural18 options: None, vivid, natural, artistic, cinematic, photographic, +12
    detail_levelCOMBOProfessional Detail5 options: None, Basic Detail, Professional Detail, Premium Quality, Masterpiece Level
    camera_controlCOMBOAuto Select8 options: None, Auto Select, Wide-angle Lens, Macro Shot, Low-angle Perspective, High-angle Shot, +2
    lighting_controlCOMBOAuto Settings8 options: None, Auto Settings, Natural Light, Studio Lighting, Dramatic Shadows, Soft Glow, +2
    template_selectionCOMBOAuto Select14 options: None, Auto Select, Professional Portrait, Cinematic Landscape, Product Photography, Digital Concept Art, +8
    temperatureFLOAT1.000–1.5
    top_pFLOAT0.950–1
    top_kINT400–100
    max_output_tokensINT81920–32768
    seedINT00–268435455
    custom_instructionsoptSTRING
    safety_leveloptCOMBOdefault内容安全过滤级别:default=API默认, strict=严格, moderate=中等, permissive=宽松, off=关闭
    system_instruction_presetoptCOMBOnone系统指令预设模板,用于引导AI的行为和风格
    custom_system_instructionoptSTRING
    enable_google_searchoptBOOLEANfalse🔍 启用 Google 搜索接地(Grounding with Google Search) ⚠️ 注意事项: 1. 仅支持 gemini-3-pro-image-preview 模型 2. 必须使用 TEXT_AND_IMAGE 响应模式(IMAGE_ONLY 模式不会返回图像) 3. 每次搜索查询会单独计费 4. 基于图片的搜索结果不会传递给生成模型 💡 用途:根据实时信息(天气、新闻、事件等)生成图片
    enable_iterative_refinementoptBOOLEANfalse开启多轮迭代优化:自动把最近几轮对话作为上下文,逐步细化图像。会增加token消耗,建议仅保留最近3-5轮。
    keep_last_turnsoptINT31–10保留最近N轮(user+assistant为一轮)的对话作为上下文
    reset_conversationoptBOOLEANfalse重置当前节点的会话历史(基于 unique_id)
    lock_seedoptBOOLEANfalse🔒 锁定 seed:启用后,首次运行时使用当前 seed,后续运行自动沿用首次的 seed,保持风格一致。配合迭代优化使用效果最佳。
    enable_conversation_summaryoptBOOLEANfalse🧠 启用会话摘要:自动将过往多轮对话概括为简短摘要,持续注入以保持一致性,同时减少历史上下文长度。
    summary_injectionoptCOMBOSystem Instruction摘要注入位置:作为系统指令或提示词前缀
    summary_max_charsoptINT600100–2000摘要最大字符数(越大越详细,但会增加token)

    Outputs (3)

    NameTypeDescription
    generation_textSTRING
    generated_imageIMAGE
    grounding_infoSTRING