> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hexinzhandao.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 插件 - 图像生成助手

> 使用多种 AI 大模型的文生图、图生图能力，智能创作和处理高质量图片，让 AI 生图更具专业质感。

<Columns cols={1}>
  <Card title="在扣子中收藏插件" icon="plug-circle-plus" href="https://www.coze.cn/store/plugin/7613685691108802612">
    如果您想自己动手搭建工作流，可在扣子平台中收藏此插件以备使用
  </Card>
</Columns>

## 图像生成 (image\_generation)

使用AI大模型通过"文生图"或"图生图"技术创作图片。

### image\_generation - 输入参数

<ParamField body="model_name" type="string" required>
  **大模型名称**，以下为可以选用的 AI 图像模型。

  | 大模型名称                    | 说明                                 |
  | :----------------------- | :--------------------------------- |
  | doubao-seedream-4-0      | 字节跳动 Seedream 4.0 图像模型             |
  | doubao-seedream-4-5      | 字节跳动 Seedream 4.5 图像模型，多图一致性更稳定    |
  | doubao-seedream-5-0-lite | 字节跳动 Seedream 5.0 Lite 图像模型，支持实时联网 |
</ParamField>

<ParamField body="prompt" type="string" required>
  **文本提示词**，输入用于指导模型生成图像的文本提示词。
</ParamField>

<ParamField body="aspect_ratio" type="string" required>
  **图像的宽高比**，例如：`9:16`。不同模型支持的图像宽高比不一样，请根据下表选择合适的比例。

  | 大模型名称                    | 支持的宽高比                                                |
  | :----------------------- | :---------------------------------------------------- |
  | doubao-seedream-4-0      | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, 9:21, auto |
  | doubao-seedream-4-5      | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, 9:21, auto |
  | doubao-seedream-5-0-lite | 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, auto       |
</ParamField>

<ParamField body="resolution" type="string" required>
  **图像分辨率**，例如：`2K`。不同模型支持的图像分辨率不一样，请根据下表选择合适的分辨率。

  | 大模型名称                    | 支持的分辨率     |
  | :----------------------- | :--------- |
  | doubao-seedream-4-0      | 1K, 2K, 4K |
  | doubao-seedream-4-5      | 2K, 4K     |
  | doubao-seedream-5-0-lite | 2K, 3K     |
</ParamField>

<ParamField body="ref_images" type="array<string>">
  **参考图列表**，用于图生图，必须是公开可访问的链接，格式支持 `jpeg` `png` `gif` `bmp` `webp` 等。
</ParamField>

<ParamField body="wait_for_completed" type="boolean">
  **是否等待图片生成任务完成**，`true` 等待本次任务完成，直接出图。`false` 只提交任务，不等待完成，先执行其他任务，适合批量任务并发执行，后面再使用 `wait_image_tasks_completed` 工具等待所有任务完成并获得结果，生成图片数量较多时，可大量节省任务时间。默认值 `true`。
</ParamField>

<ParamField body="hezhan_api_key" type="string" required>
  **合芯栈道 API 密钥**，用于识别和验证身份的凭证 `免费获取`。

  * **免费获取方式**：登录 [合芯栈道 - 会员中心](https://www.hexinzhandao.cn/user/home)，在 `API 密钥` 版块中查看。
  * **重要安全建议**：
    * 建议通过工作流开始节点的输入参数的形式使用，而不是直接明文写入插件工具的参数中。
    * 请防止在分享工作流调试记录或截图时无意间展示密钥信息。
  * **密钥失效处理**：若密钥存在泄露风险，请立即在会员中心进行重置，原密钥将即刻失效。
</ParamField>

### image\_generation - 输出参数

<ResponseField name="success" type="boolean">
  **是否执行成功**，`true` 成功，`false` 失败。
</ResponseField>

<ResponseField name="error" type="string">
  **错误信息**，如果没有执行成功，这里会显示错误信息，否则为空。
</ResponseField>

<ResponseField name="task_id" type="string">
  **任务 ID**，本次生成图像任务的唯一编码，可用于在 `wait_image_tasks_completed` 工具中查询任务状态和结果。
</ResponseField>

<ResponseField name="image_url" type="string">
  **生成图像的 URL**，可直接打开的图像链接。如果输入参数 `wait_for_completed` 为 `false` 即不等待任务完成的情况下，图像 URL 值为空，需另外使用 `wait_image_tasks_completed` 工具获得图像 URL。
</ResponseField>

## 等待任务完成 (wait\_image\_tasks\_completed)

用于等待生成图像任务完成，返回最终生成的图像。

### wait\_image\_tasks\_completed - 输入参数

<ParamField body="task_ids" type="array<string>" required>
  **任务 ID 列表**，需要查询的任务 ID 列表。
</ParamField>

<ParamField body="hezhan_api_key" type="string" required>
  **合芯栈道 API 密钥**，用于识别和验证身份的凭证 `免费获取`。

  * **免费获取方式**：登录 [合芯栈道 - 会员中心](https://www.hexinzhandao.cn/user/home)，在 `API 密钥` 版块中查看。
  * **重要安全建议**：
    * 建议通过工作流开始节点的输入参数的形式使用，而不是直接明文写入插件工具的参数中。
    * 请防止在分享工作流调试记录或截图时无意间展示密钥信息。
  * **密钥失效处理**：若密钥存在泄露风险，请立即在会员中心进行重置，原密钥将即刻失效。
</ParamField>

### wait\_image\_tasks\_completed - 输出参数

<ResponseField name="success" type="boolean">
  **是否执行成功**，`true` 成功，`false` 失败。
</ResponseField>

<ResponseField name="error" type="string">
  **错误信息**，如果没有执行成功，这里会显示错误信息，否则为空。
</ResponseField>

<ResponseField name="image_urls" type="array<string>">
  **生成图像的 URL 列表**，可直接打开的图像链接的列表，即任务结果。
</ResponseField>
