Nodes/comfyui-aichat/Gemini 内容块连接器
ComfyUI Node

Gemini 内容块连接器

Bundle Gemini content parts into one message

By spawner1145·Created about a year ago·Updated 11 days ago· 3
Gemini 内容块连接器
  • content_part_1
  • content_part_2
  • content_part_3
  • content_parts

The plumbing node

Every content-builder in this pack - GeminiTextBlock, GeminiImageEncoder, GeminiFileUploader - emits one GEMINI_CONTENT_ITEM at a time. GeminiChat only has three content slots. So when you're assembling a bigger message - a couple of images plus a file, or more than three parts total - you need a way to merge items. That's exactly what GeminiContentConnector is.

It takes up to three GEMINI_CONTENT_ITEM inputs and merges them into a single list on one content_parts output. Because its output is the same type as its inputs, you can daisy-chain connectors - connector A's output into connector B's input - and stack far more parts than the three-slot limit on the Chat node. It's the duct tape of the pack.

Inputs and output

All three inputs - content_part_1, content_part_2, content_part_3 - are optional. Plug in whatever you have and leave the rest empty. The only rule that matters is order: parts come out in the order you connected them, and that's the order Gemini sees them. Text before image, context before content - that sort of thing.

There are no settings, no quality sliders, no surprises. A content item is just a plain dict under the hood ({"text": ...} or {"inlineData": ...}), and this node concatenates them. If you're debugging a weird reply, remember the connector does zero reordering - it is a wire, not a mixer.

Install and context

It installs with the whole pack - ComfyUI Manager (search "comfyui-aichat") or:

cd ComfyUI/custom_nodes
git clone https://github.com/spawner1145/comfyui-aichat

Restart ComfyUI. No models, no downloads; the pack's only dependencies are httpx, openai, and PyYAML.

When to bother

Honest take: if you only ever send one image or one text prompt, you won't touch this node - the Chat node's three content slots cover you. Reach for the connector when a message grows beyond that, or when you want a tidy single wire into the Chat node instead of three separate inputs. It's the most boring node in the pack, and that's the point: some parts of a pipeline are supposed to be boring.

CategoryGemini API/Content

Inputs (3)

NameTypeDefaultDescription
content_part_1optGEMINI_CONTENT_ITEM
content_part_2optGEMINI_CONTENT_ITEM
content_part_3optGEMINI_CONTENT_ITEM

Outputs (1)

NameTypeDescription
content_partsGEMINI_CONTENT_ITEM