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

# ComfyUI

> 安装 PoYo 自定义节点，在 ComfyUI 画布上使用 PoYo 模型。

# ComfyUI

PoYo 自定义节点把 PoYo 的图像、视频和音频模型加入 ComfyUI，与你的本地节点并列使用。结果会以文件形式保存在 ComfyUI 的输出文件夹中。

源码和示例工作流：[PoyoAPI/poyo-comfyui](https://github.com/PoyoAPI/poyo-comfyui)。

## 前提条件

* ComfyUI 0.32.0 或更高版本
* Git
* 从 [API Key 页面](https://poyo.ai/dashboard/api-key)获取的 PoYo API Key

## 安装

将仓库克隆到 `custom_nodes`，然后完全重启 ComfyUI：

```bash theme={"dark"}
cd ComfyUI/custom_nodes
git clone https://github.com/PoyoAPI/poyo-comfyui.git
```

重启后，在节点菜单中搜索 "PoYo" 即可看到 PoYo 节点。

## 配置 API Key

在启动 ComfyUI 之前设置 Key：

```bash macOS / Linux theme={"dark"}
export POYO_API_KEY=your_poyo_api_key
export POYO_BASE_URL=https://api.poyo.ai
```

```bat Windows theme={"dark"}
set POYO_API_KEY=your_poyo_api_key
set POYO_BASE_URL=https://api.poyo.ai
```

```bash Local config theme={"dark"}
python -m poyo_nodes.configure
```

> [!WARNING]
>
> 不要把 API Key 粘贴到工作流节点的字段中。节点的值会保存在导出的工作流文件里。

## 示例工作流

| 工作流 | 作用 |
| - | - |
| [poyo-generate-image.json](https://github.com/PoyoAPI/poyo-comfyui/blob/main/workflows/poyo-generate-image.json) | 运行 PoYo 图像模型并保存返回的图片 |
| [poyo-submit-and-await.json](https://github.com/PoyoAPI/poyo-comfyui/blob/main/workflows/poyo-submit-and-await.json) | 提交任意目录中的模型，等待完成并保存结果文件 |

将 JSON 拖到画布上，或使用 **Workflow → Open**，选择一个模型，然后点击 **Queue Prompt**。结果保存在 `ComfyUI/output/poyo` 下。

## 故障排查

| 问题 | 解决方法 |
| - | - |
| PoYo 节点没有出现 | 完全重启 ComfyUI，并在启动控制台中查找 `poyo_nodes` 的导入错误。 |
| 模型目录无法加载 | 检查 API Key 和网络；修改环境变量后重启 ComfyUI。 |
| 没有输出文件 | 等待任务变为 `finished`，然后检查 Save Result File 节点和 `ComfyUI/output/poyo`。 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.