🍌 Gemini Banana Text to Image
The cleanest Nano Banana door
- generation_text
- generated_image
- grounding_info
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 nomirror_sitedropdown 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_IMAGEorIMAGE_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), andtemplate_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 seegrounding_infoon 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.
Inputs (33)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| prompt | STRING | A beautiful landscape with mountains and lake | — |
| negative_prompt | STRING | — | |
| model | COMBO | gemini-3-pro-image-preview | 3 options: gemini-3-pro-image-preview, gemini-2.5-flash-image, gemini-2.5-flash-image-preview |
| proxy | STRING | None | — |
| aspect_ratio | COMBO | Auto | 图像宽高比 (Gemini官方API支持) |
| response_modality | COMBO | TEXT_AND_IMAGE | 响应模式:TEXT_AND_IMAGE=文字+图像,IMAGE_ONLY=仅图像 |
| output_resolution | COMBO | Auto (Model Default) | 🔥 仅 Nano Banana 2 (gemini-3-pro-image-preview) 支持:通过 imageSize 参数直出 1K/2K/4K 分辨率(与 aspect_ratio 组合生成对应尺寸)。其他模型会忽略此参数。 |
| upscale_factor | COMBO | 1x (不放大) | 使用Topaz Gigapixel AI进行智能放大 |
| gigapixel_model | COMBO | High Fidelity | Gigapixel AI放大模型 |
| quality | COMBO | hd | 5 options: standard, hd, ultra_hd, ai_enhanced, ai_ultra |
| style | COMBO | natural | 18 options: None, vivid, natural, artistic, cinematic, photographic, +12 |
| detail_level | COMBO | Professional Detail | 5 options: None, Basic Detail, Professional Detail, Premium Quality, Masterpiece Level |
| camera_control | COMBO | Auto Select | 8 options: None, Auto Select, Wide-angle Lens, Macro Shot, Low-angle Perspective, High-angle Shot, +2 |
| lighting_control | COMBO | Auto Settings | 8 options: None, Auto Settings, Natural Light, Studio Lighting, Dramatic Shadows, Soft Glow, +2 |
| template_selection | COMBO | Auto Select | 14 options: None, Auto Select, Professional Portrait, Cinematic Landscape, Product Photography, Digital Concept Art, +8 |
| temperature | FLOAT | 1.000–1.5 | — |
| top_p | FLOAT | 0.950–1 | — |
| top_k | INT | 400–100 | — |
| max_output_tokens | INT | 81920–32768 | — |
| seed | INT | 00–268435455 | — |
| custom_instructionsopt | STRING | — | |
| safety_levelopt | COMBO | default | 内容安全过滤级别:default=API默认, strict=严格, moderate=中等, permissive=宽松, off=关闭 |
| system_instruction_presetopt | COMBO | none | 系统指令预设模板,用于引导AI的行为和风格 |
| custom_system_instructionopt | STRING | — | |
| enable_google_searchopt | BOOLEAN | false | 🔍 启用 Google 搜索接地(Grounding with Google Search) ⚠️ 注意事项: 1. 仅支持 gemini-3-pro-image-preview 模型 2. 必须使用 TEXT_AND_IMAGE 响应模式(IMAGE_ONLY 模式不会返回图像) 3. 每次搜索查询会单独计费 4. 基于图片的搜索结果不会传递给生成模型 💡 用途:根据实时信息(天气、新闻、事件等)生成图片 |
| enable_iterative_refinementopt | BOOLEAN | false | 开启多轮迭代优化:自动把最近几轮对话作为上下文,逐步细化图像。会增加token消耗,建议仅保留最近3-5轮。 |
| keep_last_turnsopt | INT | 31–10 | 保留最近N轮(user+assistant为一轮)的对话作为上下文 |
| reset_conversationopt | BOOLEAN | false | 重置当前节点的会话历史(基于 unique_id) |
| lock_seedopt | BOOLEAN | false | 🔒 锁定 seed:启用后,首次运行时使用当前 seed,后续运行自动沿用首次的 seed,保持风格一致。配合迭代优化使用效果最佳。 |
| enable_conversation_summaryopt | BOOLEAN | false | 🧠 启用会话摘要:自动将过往多轮对话概括为简短摘要,持续注入以保持一致性,同时减少历史上下文长度。 |
| summary_injectionopt | COMBO | System Instruction | 摘要注入位置:作为系统指令或提示词前缀 |
| summary_max_charsopt | INT | 600100–2000 | 摘要最大字符数(越大越详细,但会增加token) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| generation_text | STRING | — |
| generated_image | IMAGE | — |
| grounding_info | STRING | — |