Nodes/ComfyUI_LLM_Banana/🍌 Gemini Banana Image Edit
ComfyUI Node

🍌 Gemini Banana Image Edit

Nano Banana inside your graph

By xuchenxu168·Created 12 months ago·Updated 9 months ago· 46
🍌 Gemini Banana Image Edit
  • image
  • generation_text
  • generated_image
api_key
promptTransform this image
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_additions
safety_leveldefault
system_instruction_presetnone
custom_system_instruction
enable_iterative_refinementfalse
keep_last_turns3
reset_conversationfalse
lock_seedfalse
auto_use_last_imagefalse
enable_conversation_summaryfalse
summary_injectionSystem Instruction
summary_max_chars600

This is the node the pack is built around. "🍌 Gemini Banana Image Edit" is a Google-official-API image-to-image editor: wire in an image, type "add a llama next to me," and the Gemini 3 Pro Image model (the Nano Banana Pro engine, per the closed-source-models KB doc) sends back an edited image, fully in-context with your graph. This is a closed model you can never download, so the API wrapper is the only door - and this node is one of the more complete doors in the ecosystem.

It uses Google's native generateContent endpoint with imageConfig, so it supports the things the model actually supports: aspect ratios, 1K/2K/4K output, response modalities, safety presets, system instructions, and seed locking. The negative prompt, the photography controls (camera angle, lighting, style, detail), and the Topaz Gigapixel upscale hook are the pack's own additions layered on top.

The inputs that matter

  • api_key - Google AI Studio key. This is the official path, so no mirror needed (there's a separate mirror node if you want that).
  • image - the IMAGE you're editing.
  • prompt / negative_prompt - what to do, and what to avoid. "Transform this image" is the default prompt; be more specific.
  • model - gemini-3-pro-image-preview (default) or the 2.5-flash image models. Pro is slower and pricier but sharper.
  • aspect_ratio - 11 options from 1:1 to 21:9, or Auto.
  • response_modality - TEXT_AND_IMAGE (default) or IMAGE_ONLY. Text-and-image is useful when you want the model to explain what it changed.
  • output_resolution - Auto / 1K / 2K / 4K. 4K is real and it shows, but it costs more.
  • upscale_factor + gigapixel_model - the Topaz Gigapixel hook (2x/4x/6x). Note: this needs the optional face-restore/Gigapixel dependencies to actually do anything; at 1x (default) it's a no-op.
  • quality, style, detail_level, camera_control, lighting_control, template_selection - the photography knobs. Defaults are mostly "Auto," and honestly Auto is fine to start.
  • temperature / top_p / top_k / max_output_tokens / seed - sampling.
  • enable_iterative_refinement - the conversation mode. Turn this on and the node keeps last turns (default 3) so you can refine an edit iteratively in the same session, with lock_seed and auto_use_last_image helping keep things stable.
  • safety_level - 5 presets from default to off. The model still refuses at Google's end regardless; this just tunes the API-level filter.

Outputs: generated_image (IMAGE) and generation_text (STRING). The image goes to a preview/save node; the text is what the model says about its work.

Install

ComfyUI Manager (search 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

requirements.txt needs google-genai>=1.51.0 for the image endpoints. Restart.

Gotchas

The official API costs real money per call - 4K Pro edits add up fast. Iterative refinement is stateful, so if you're getting weird outputs that reference previous edits, flip reset_conversation on. And the upsample options are a trap if you haven't installed the Gigapixel extras: the node will quietly run at 1x or error, so install requirements_face_restore.txt too if you plan to use them.

CategoryKen-Chen/LLM-Nano-Banana

Inputs (34)

NameTypeDefaultDescription
api_keySTRING
promptSTRINGTransform this image
negative_promptSTRING
imageIMAGE
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_additionsoptSTRING
safety_leveloptCOMBOdefault内容安全过滤级别:default=API默认, strict=严格, moderate=中等, permissive=宽松, off=关闭
system_instruction_presetoptCOMBOnone系统指令预设模板,用于引导AI的行为和风格
custom_system_instructionoptSTRING
enable_iterative_refinementoptBOOLEANfalse开启多轮迭代优化:自动把最近几轮对话作为上下文,逐步细化图像。会增加token消耗,建议仅保留最近3-5轮。
keep_last_turnsoptINT31–10保留最近N轮(user+assistant为一轮)的对话作为上下文
reset_conversationoptBOOLEANfalse重置当前节点的会话历史(基于 unique_id)
lock_seedoptBOOLEANfalse🔒 锁定 seed:启用后,首次运行时使用当前 seed,后续运行自动沿用首次的 seed,保持风格一致。配合迭代优化使用效果最佳。
auto_use_last_imageoptBOOLEANfalse🖼️ 自动使用上一轮生成的图像:启用后,如果未连接输入图像,将自动使用本节点上一轮生成的图像作为输入。配合迭代优化实现连续细化。
enable_conversation_summaryoptBOOLEANfalse🧠 启用会话摘要:自动将过往多轮对话概括为简短摘要,持续注入以保持一致性,同时减少历史上下文长度。
summary_injectionoptCOMBOSystem Instruction摘要注入位置:作为系统指令或提示词前缀
summary_max_charsoptINT600100–2000摘要最大字符数(越大越详细,但会增加token)

Outputs (2)

NameTypeDescription
generation_textSTRING
generated_imageIMAGE