> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-nav-cta-ab-test-try-cloud-free.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Gemini 合作节点 ComfyUI 官方示例

> 本文将介绍如何在 ComfyUI 中使用 Google Gemini 合作节点来完成对话功能

Google Gemini 是 Google 推出的一款强大的 AI 模型，支持对话、文本生成等多种功能。目前 ComfyUI 已集成 Google Gemini API，你可以直接在 ComfyUI 中使用相关节点来完成对话功能。

本篇指南中，我们将引导你完成对应对话功能。

<Tip>
  使用 API 节点需要保证你已经正常登录，并在受许可的网络环境下使用，请参考[API 节点总览](/zh/tutorials/partner-nodes/overview)部分文档来了解使用 API 节点的具体使用要求。
</Tip>

<Tip>
  <Tabs>
    <Tab title="本地用户">
      请确保你的 ComfyUI 已经更新。

      * [ComfyUI 下载](https://www.comfy.org/download)
      * [ComfyUI 更新教程](/zh/installation/update_comfyui)

      本指南里的工作流可以在[工作流模板](/zh/interface/features/template)中找到。如果找不到，可能是 ComfyUI 没有更新。

      如果加载工作流时有节点缺失，可能原因有：

      1. 你用的不是最新版（每夜版）。
      2. 启动时有些节点导入失败。
    </Tab>

    <Tab title="云端用户">
      * [Cloud](https://cloud.comfy.org) 会在 ComfyUI 稳定版本发布后更新。

      所以，如果你发现本文档中有任何核心节点缺失，可能是因为新核心节点尚未在最新稳定版中发布。请等待下一个稳定版发布。
    </Tab>
  </Tabs>
</Tip>

<h3 id="api_google_gemini">
  Google Gemini
</h3>

体验 Google 的多模态 AI 与 Gemini 的推理能力。

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/api_google_gemini-1.webp" alt="Google Gemini 工作流预览" />

<CardGroup cols={2}>
  <Card title="在 Comfy Cloud 上运行" icon="cloud" href="https://cloud.comfy.org/?template=api_google_gemini&utm_source=docs&utm_medium=referral&utm_campaign=gemini">
    在 Comfy Cloud 中打开
  </Card>

  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_google_gemini.json">
    下载 JSON 或在模板库中搜索 "Google Gemini"
  </Card>
</CardGroup>

**输入材料**

将此文件上传到对应的 `LoadImage` 节点：

<CardGroup cols={2}>
  <Card title="example.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/example.png">
    `LoadImage` 节点 2 · `example.png`
  </Card>
</CardGroup>

<div style={{display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: '1rem', alignItems: 'start'}}>
  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/example.png" alt="example.png" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />
</div>

### 按步骤完成工作流的执行

<img src="https://mintcdn.com/dripart-docs-nav-cta-ab-test-try-cloud-free/H2ggroS0BZ5Nn0ES/images/tutorial/api_nodes/google/tripo_image_to_model_step_guide.jpg?fit=max&auto=format&n=H2ggroS0BZ5Nn0ES&q=85&s=c2149125a5414fee273fcbb930bef4db" alt="OpenAI Chat 步骤指南" width="3940" height="2092" data-path="images/tutorial/api_nodes/google/tripo_image_to_model_step_guide.jpg" />

<Note>
  在对应模板中，我们构建了一个用于分析并生成角色提示词的提示词，用于将你的图像解读成对应的绘图提示词。
</Note>

你可参考图片中的序号来完成最基础的文生图工作流运行：

1. 在 `Load Image` 节点中加载需要 AI 解读的图像。
2. （可选）如果需要，你可以修改 `Google Gemini` 中的提示词，从而让 AI 来执行特定任务。
3. 点击 `Run` 按钮，或使用快捷键 `Ctrl(cmd) + Enter` 来执行对话。
4. 等待 API 返回结果后，你可在 `Preview Any` 节点中查看对应 AI 返回的内容。

### 补充说明

* 目前文件输入节点 `Gemini Input Files` 需要先将文件上传至 `ComfyUI/input/` 目录下，此节点正在改进，我们会在更新后修改模板。
* 工作流中提供了使用 `Batch Images` 来输入的示例。如果你有多张图像需要 AI 解读，可参考步骤图，使用右键将对应的节点模式设置为 `总是（Always）` 来启用。
