🍌 Gemini Banana Multi Image Edit
Multi-image editing on the official API, with consistency control
- image1
- image2
- image3
- image4
- edited_image
- response_text
The single-image editor is great, but the thing people actually want from a Gemini image model is multi-image work: unify five product shots onto white backgrounds, apply one style across a character sheet, composite elements from several photos. That's this node - "🍌 Gemini Banana Multi Image Edit," the official-API version. It takes up to four image inputs plus a prompt and returns one edited image, and it ships a post_generation_control switch for how consistent that output should be across runs.
Mechanically it's the same Gemini generateContent image-edit call as the single-image node, just with multiple inline images in the request. The parts of a multi-image request that matter - how the model interprets "these images" and which one it edits - live in the prompt, and the built-in default is Chinese ("请根据这些图片进行专业的图像编辑", "please perform professional image editing based on these images"), which is a hint about the pack's primary audience. Rewrite it to be specific about which image does what, and you'll get dramatically better results.
The inputs that matter
api_key- official Google key (no mirror here; that's the sibling node).image1…image4(optional) - the image wires. Wire what you need.prompt/negative_prompt- the instructions. Be explicit about per-image roles.model-gemini-3-pro-image-preview(default) or the 2.5-flash image models.post_generation_control-randomize(default),maintain_consistency(keep results stable across runs), orenhance_creativity(looser, more variation). This plusseed/lock_seedis how you control reproducibility.aspect_ratio,response_modality,output_resolution(Auto/1K/2K/4K) - output geometry and format.upscale_factor/gigapixel_model- Topaz Gigapixel hook.quality,style,detail_level,camera_control,lighting_control,template_selection- the photography presets.temperature/top_p/top_k/max_output_tokens/seed- sampling. Note the seed max here is 999999, not the full 32-bit range of the single-image node.enable_iterative_refinement- session-based refinement (keepskeep_last_turnsof context, default 3);reset_conversationclears it.- Optional:
custom_additions,safety_level(5 presets),system_instruction_preset(7),custom_system_instruction.
Outputs: edited_image (IMAGE) and response_text (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
Restart. Needs google-genai>=1.51.0.
Gotchas
Multi-image calls are where attribution errors bite hardest - the same multi-subject weakness that plagues every VLM (the character-consistency and llm-in-comfyui KB docs). If you ask for one style across several photos, audit what actually happened before trusting it. And each call costs like a multi-image Pro request, which is more than single-image - batch deliberately, and use maintain_consistency + a fixed seed when you're iterating toward one result you actually want to keep.
Inputs (36)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| prompt | STRING | 请根据这些图片进行专业的图像编辑 | — |
| 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 |
| 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–999999 | — |
| post_generation_control | COMBO | randomize | 3 options: randomize, maintain_consistency, enhance_creativity |
| enable_iterative_refinement | BOOLEAN | false | 启用迭代优化:自动保存会话历史,支持连续细化 |
| keep_last_turns | INT | 31–10 | 保留最近N轮对话作为上下文 |
| reset_conversation | BOOLEAN | false | 重置会话历史(清空所有历史记录和缓存) |
| lock_seed | BOOLEAN | false | 锁定种子值:首次运行后固定seed,保持风格一致 |
| enable_conversation_summary | BOOLEAN | false | 启用会话摘要:自动生成对话摘要,减少token消耗 |
| summary_injection | COMBO | System Instruction | 摘要注入位置:System Instruction更稳定,Prompt Prefix更显式 |
| summary_max_chars | INT | 600100–2000 | 摘要最大字符数 |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| custom_additionsopt | STRING | — | |
| safety_levelopt | COMBO | default | 内容安全过滤级别:default=API默认, strict=严格, moderate=中等, permissive=宽松, off=关闭 |
| system_instruction_presetopt | COMBO | none | 系统指令预设模板,用于引导AI的行为和风格 |
| custom_system_instructionopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| edited_image | IMAGE | — |
| response_text | STRING | — |