diff --git a/zh/account/login.mdx b/zh/account/login.mdx index fcf9462c5..830736380 100644 --- a/zh/account/login.mdx +++ b/zh/account/login.mdx @@ -2,13 +2,12 @@ title: 登录您的 Comfy 账户 sidebarTitle: 登录 description: 访问您的 Comfy 账户以使用 ComfyUI 的所有平台功能和服务。 -translationSourceHash: 31b0c6ca -translationFrom: account/login.mdx +reviewSourceHash: 31b0c6ca --- import GetApiKey from '/snippets/zh/get-api-key.mdx' -您的 Comfy 账户可让您访问[合作伙伴节点(API 节点)](/zh/tutorials/partner-nodes/overview)和[云订阅](https://www.comfy.org/cloud),使您能够在 ComfyUI 平台上使用高级功能和服务。 +您的 Comfy 账户可让您访问[合作节点](/zh/tutorials/partner-nodes/overview)和[云订阅](https://www.comfy.org/cloud),使您能够在 ComfyUI 平台上使用高级功能和服务。 ## 支持的登录方式 @@ -22,7 +21,7 @@ ComfyUI 支持以下登录方式: 要在 Comfy Cloud 上访问您的 Comfy 账户以使用 ComfyUI: 1. 访问 [Comfy Cloud](https://www.comfy.org) -2. 点击**登录**或**登入** +2. 点击**登录** 3. 选择您的登录方式: - **电子邮件**:输入您的电子邮件地址和密码,然后点击**登录** - **Google**:点击 Google 登录按钮并进行身份验证 @@ -120,7 +119,6 @@ ComfyUI 支持以下登录方式: 为了保护您的账户安全: - 使用强大且唯一的密码 -- 启用双因素身份验证 - 不要分享您的登录凭据 - 使用共享设备时请注销 - 定期更新您的密码 diff --git a/zh/agent-tools/index.mdx b/zh/agent-tools/index.mdx index 920a08c52..8560ecad5 100644 --- a/zh/agent-tools/index.mdx +++ b/zh/agent-tools/index.mdx @@ -1,22 +1,21 @@ --- title: "Agent Tools / MCP" -description: "通过 Model Context Protocol (MCP) 将 AI 助手接入 ComfyUI,用于图片、视频、音频和 3D 内容生成。" +description: "通过 Model Context Protocol (MCP) 将 AI 助手接入 ComfyUI,用于图像、视频、音频和 3D 内容生成。" sidebarTitle: "概览" icon: "robot" -translationSourceHash: 5f22f918 -translationFrom: agent-tools/index.mdx +reviewSourceHash: 5f22f918 --- -ComfyUI 提供了 **两个 MCP 服务器**,让 AI 助手(Claude Desktop、Claude Code、Cursor、Amp 等)能够生成图片、视频、音频和 3D 内容——无需本地安装 ComfyUI 或 GPU。 +ComfyUI 提供了 **两个 MCP 服务器**,让 AI 助手(Claude Desktop、Claude Code、Cursor、Amp 等)能够生成图像、视频、音频和 3D 内容——无需本地安装 ComfyUI 或 GPU。 - 连接至托管在 cloud.comfy.org 的 MCP 服务器。在 Cloud GPU 上运行工作流,使用预装模型。 + 连接至托管在 cloud.comfy.org 的 MCP 服务器。在 Cloud GPU 上运行工作流,使用预装模型,并搜索完整的模板库。

**封闭测试** — 注册等候名单。
- 在本地运行的 MCP 服务器,使用 Comfy Partner-Node SDK。提供统一的 generate_imagegenerate_video 等工具,覆盖 30+ 合作提供商。 + 在本地运行的 MCP 服务器,使用 Comfy Partner-Node SDK。提供统一的 generate_imagegenerate_videogenerate_3d 等工具,覆盖 30+ 合作提供商。

**等候名单** — 注册提前体验。
@@ -43,9 +42,9 @@ ComfyUI 提供了 **两个 MCP 服务器**,让 AI 助手(Claude Desktop、Cl 连接 MCP 服务器到 Claude Desktop、Claude Code、Cursor 或 Amp 后,AI 助手可以: -- **生成图片** — 根据文字描述 -- **创建视频** — 从文字或图片生成 -- **生成 3D 模型** — 从文字或图片 +- **生成图像** — 根据文字描述 +- **创建视频** — 从文字或图像生成 +- **生成 3D 模型** — 从文字或图像 - **生成音频和音乐** — 使用 AI 模型 - **搜索模型和模板** — 找到合适的工具 diff --git a/zh/comfy-cli/getting-started.mdx b/zh/comfy-cli/getting-started.mdx index 51de0b087..1a6ebfe2a 100644 --- a/zh/comfy-cli/getting-started.mdx +++ b/zh/comfy-cli/getting-started.mdx @@ -1,7 +1,6 @@ --- title: "快速入门" -translationSourceHash: 81a03067 -translationFrom: comfy-cli/getting-started.mdx +reviewSourceHash: 81a03067 --- import InstallComfyFromCli from "/snippets/zh/install-comfy-from-cli.mdx"; @@ -9,7 +8,12 @@ import InstallCli from "/snippets/zh/install-comfycli.mdx"; ### 概述 -`comfy-cli` 是一个 [命令行工具](https://github.com/Comfy-Org/comfy-cli),可以帮助更轻松地安装和管理 Comfy。 +`comfy-cli` 是一个[命令行工具](https://github.com/Comfy-Org/comfy-cli),可以帮助更轻松地安装和管理 Comfy。 + +它主要做两件事: + +1. **管理本地 ComfyUI 安装** — 安装、启动、更新、快照和二分排查 ComfyUI 及其自定义节点。 +2. **直接调用托管的合作节点** — 通过一条命令即可从 Seedance、Nano Banana(Gemini)、Grok、Flux、Ideogram、DALL·E、Recraft、Stability、Kling、Luma、Runway、Pika、Vidu、Hailuo、Moonvalley 等生成图像和视频。无需本地 ComfyUI 或工作流 JSON。 ### 安装 CLI @@ -25,29 +29,171 @@ import InstallCli from "/snippets/zh/install-comfycli.mdx"; comfy launch ``` -### 管理自定义节点 +## 通过 `comfy generate` 直接调用合作节点(Beta) + + +**`comfy generate` 目前处于 Beta 阶段。** 标志名称、模型别名和输出格式可能发生变化,我们会根据反馈持续优化。底层合作节点 API 是稳定的——仍在演进的是建立在它们之上的 CLI 交互方式。请在 [comfy-cli GitHub 仓库](https://github.com/Comfy-Org/comfy-cli/issues) 提交反馈或问题。 + + + +`comfy generate` 是从终端或脚本调用 Comfy [合作节点](/tutorials/partner-nodes/overview)的最快方式。它访问的是与你通过工作流连接相同的托管端点,但以一次性 CLI 调用的形式呈现——非常适合批处理作业、快速实验和自动化流水线,这些场景下搭建完整的 ComfyUI 图过于繁琐。 + + +### 前提条件 + +* [创建 Comfy API 密钥](/zh/development/comfyui-server/api-key-integration) +* [向账户添加积分](/zh/interface/credits) +* 可选:[浏览合作节点及按次定价](/zh/tutorials/partner-nodes/overview) + +设置一次密钥,即可开始使用: + +```bash +export COMFY_API_KEY=comfyui-... # 或者在每次调用时传入 --api-key +``` + +### 首次生成 + +```bash +comfy generate flux-pro \ + --prompt "a cat on the moon, cinematic lighting" \ + --width 1024 --height 1024 \ + --download cat.png +``` + +就是这样——CLI 会上传任何本地文件输入,提交任务,轮询直到就绪,并将结果保存到 `cat.png`。 + +### 热门模型 + +以下是几个最常用的合作模型,一行命令即可调用: + +```bash +# Nano Banana(Google Gemini Flash Image)— 文生图及基于提示词的编辑 +comfy generate nano-banana \ + --prompt "a watercolor of a sleeping fox" \ + --download fox.png + +# 同一别名,现在是图像编辑——通过 --image(可重复使用)传入参考图: +comfy generate nano-banana \ + --prompt "add a top hat" \ + --image ./cat.png \ + --download edited.png + +# 选择 Gemini 变体: +comfy generate nano-banana \ + --prompt "neon city skyline" \ + --model gemini-3-pro-image-preview \ + --download city.png + +# Seedance(字节跳动)— 文本转视频,最高 1080p / 12 秒片段 +comfy generate seedance \ + --prompt "a hummingbird hovering over a flower" \ + --resolution 1080p --duration 5 \ + --download hummingbird.mp4 + +# Seedance 图像转视频——选择 lite/i2v 变体并传入首帧 +comfy generate seedance \ + --model seedance-1-0-lite-i2v-250428 \ + --prompt "the wave crests and crashes" \ + --image ./still.jpg \ + --download wave.mp4 + +# Grok(xAI)— 图像生成和编辑 +comfy generate grok --prompt "a cyberpunk street market at night" --download street.png +comfy generate grok-edit --prompt "swap the umbrella for a parasol" --image ./photo.jpg --download out.png + +# Grok 视频 +comfy generate grok-video --prompt "a paper plane gliding through a cathedral" --download flight.mp4 +``` + +### 发现模型 + +```bash +comfy generate list # 所有可用模型 +comfy generate list --category text-to-video # 按类别筛选 +comfy generate list --partner kling # 按合作方筛选 +comfy generate schema flux-kontext # 查看某个模型的参数 +``` + +### 使用参考图像进行图像编辑 + +直接传入本地文件路径——CLI 会通过 Comfy 的存储端点上传承文件(或根据各个合作方的要求内联 base64 编码): + +```bash +comfy generate flux-kontext \ + --prompt "add a top hat and a monocle" \ + --input_image ./photo.jpg \ + --download out.png + +comfy generate ideogram-edit \ + --image cat.png --mask mask.png \ + --prompt "add sunglasses" \ + --rendering_speed TURBO \ + --download edited.png +``` + +如果你希望上传一次并在多次调用中重复使用签名 URL: + +```bash +comfy generate upload ./photo.jpg +# → 打印一个签名 URL,可将其作为 --input_image 传入 +``` + + +上传的参考素材会在 **24 小时**后自动删除。它们存储在 Comfy 管理 GCS 存储桶中,通过签名 URL 提供。对于大多数工作流(上传 → 使用 → 完成),这一过程是透明的;对于长时间运行的流水线,请在每次任务前重新上传。详情请参阅[参考](/zh/comfy-cli/reference#upload)页面。 + + +### 视频生成(异步任务) + +视频任务是异步的——默认情况下 CLI 会阻塞并轮询直到就绪: + +```bash +comfy generate kling \ + --prompt "a paper boat drifting on a river at dusk" \ + --duration 5 \ + --download boat.mp4 +``` + +传入 `--async` 可立即返回任务 ID,稍后再继续: + +```bash +comfy generate luma --prompt "neon koi swimming through clouds" --aspect_ratio 16:9 --async +# → 打印任务 ID;稍后使用以下命令继续: +comfy generate resume luma --download out.mp4 +``` + +### 使用 JSON 输出进行脚本编写 + +对于流水线,`--json` 可以输出原始 API 响应: + +```bash +comfy generate dalle --prompt "a watercolor whale" --json | jq '.data[0].url' +``` + +完整的命令、标志和模型别名列表请参阅[参考](/zh/comfy-cli/reference)页面。 + +## 管理自定义节点 ```bash comfy node install ``` -我们使用 `cm-cli` 来安装自定义节点。更多信息请参阅 [文档](https://github.com/Comfy-Org/ComfyUI-Manager/blob/main/docs/en/cm-cli.md)。 +我们使用 `cm-cli` 来安装自定义节点。更多信息请参阅[文档](https://github.com/Comfy-Org/ComfyUI-Manager/blob/main/docs/en/cm-cli.md)。 -### 管理模型 +## 管理模型 使用 `comfy-cli` 下载模型非常简单。只需运行以下命令: ```bash -comfy model download models/checkpoints +comfy model download --url --relative-path models/checkpoints ``` -### 贡献 +## 贡献 我们鼓励对 comfy-cli 的贡献!如果您有建议、想法或错误报告,请在我们的 [GitHub 仓库](https://github.com/Comfy-Org/comfy-cli/issues) 上提交问题。如果您想贡献代码,请 fork 仓库并提交 pull request。 -有关更多详细信息,请参阅 [开发指南](https://github.com/Comfy-Org/comfy-cli/blob/main/DEV_README.md)。 +更多详细信息请参阅[开发指南](https://github.com/Comfy-Org/comfy-cli/blob/main/DEV_README.md)。 -### 数据分析 +## 数据分析 我们会跟踪 CLI 的使用情况以改进用户体验。您可以通过运行以下命令禁用此功能: diff --git a/zh/comfy-cli/reference.mdx b/zh/comfy-cli/reference.mdx index 8f2bd4f1e..133a3ad4f 100644 --- a/zh/comfy-cli/reference.mdx +++ b/zh/comfy-cli/reference.mdx @@ -1,13 +1,21 @@ --- title: "参考" -translationSourceHash: d3b02585 -translationFrom: comfy-cli/reference.mdx +reviewSourceHash: d3b02585 --- +import GenerateCliReference from '/snippets/cli-reference/generate.mdx' import NodesCliReference from '/snippets/zh/cli-reference/nodes.mdx' import ModelsReference from '/snippets/zh/cli-reference/models.mdx' # CLI +## 生成(合作节点)— Beta + + +**`comfy generate` 目前处于 Beta 阶段。** 标志名称、模型别名和输出格式可能发生变化。底层合作节点 API 是稳定的,但 CLI 表面仍在演进中。请在 [comfy-cli GitHub 仓库](https://github.com/Comfy-Org/comfy-cli/issues) 提交反馈。 + + + + ## 节点 diff --git a/zh/comfy-cli/troubleshooting.mdx b/zh/comfy-cli/troubleshooting.mdx index dbb7c7f18..69a530ebc 100644 --- a/zh/comfy-cli/troubleshooting.mdx +++ b/zh/comfy-cli/troubleshooting.mdx @@ -1,9 +1,20 @@ --- -title: "开始" -translationSourceHash: 8c9d813c -translationFrom: comfy-cli/troubleshooting.mdx +title: "故障排查" +reviewSourceHash: "c501cfb5" --- -### 前提条件 +## 入门 -你需要在你的系统上已经安装好了 Git。可以[在这里](https://git-scm.com/downloads)下载。 \ No newline at end of file +欢迎使用 Comfy CLI 故障排查指南。 + +## 安装 CLI + +### 安装 Comfy CLI + +要安装 Comfy CLI,请运行以下命令: + +### 在此处安装 + +```bash +pip install comfy-cli +``` diff --git a/zh/community/links.mdx b/zh/community/links.mdx index 8abc4dc7e..22a595954 100644 --- a/zh/community/links.mdx +++ b/zh/community/links.mdx @@ -1,52 +1,21 @@ --- title: "社区链接" -description: "通过各种平台与 ComfyUI 社区联系" -translationSourceHash: ea6ecb7c -translationFrom: community/links.mdx +reviewSourceHash: ea6ecb7c --- -加入 ComfyUI 社区,获取帮助、分享您的作品并了解最新动态。 +## Discord - - - 加入我们的 Discord 社区 - +[加入 Comfy Discord](https://www.comfy.org/discord) - - 获取帮助和支持 - +## GitHub - - 加入社区讨论 - +[ComfyUI GitHub 仓库](https://github.com/Comfy-Org/ComfyUI) +[ComfyOrg 组织](https://github.com/Comfy-Org) - - 在 Matrix 上聊天 - +## Reddit - - 查看源代码 - +[ComfyUI Subreddit](https://www.reddit.com/r/comfyui) - - 观看教程 - +## X (Twitter) - - 在 X 上关注我们 - - - - 在 LinkedIn 上联系 - - - - 加入我们的 subreddit - - - -## 微信 - -扫描二维码加入我们的微信社区。 - -WeChat QR Code +[ComfyOrg 官方账号](https://x.com/ComfyOrg) diff --git a/zh/custom-nodes/js/subgraphs.mdx b/zh/custom-nodes/js/subgraphs.mdx index d3f5bbd3e..69b742b04 100644 --- a/zh/custom-nodes/js/subgraphs.mdx +++ b/zh/custom-nodes/js/subgraphs.mdx @@ -1,25 +1,24 @@ --- title: "子图" description: "在 ComfyUI 扩展中使用子图:节点 ID、图遍历、事件、控件提升和清理。" -translationSourceHash: 66a72faa -translationFrom: custom-nodes/js/subgraphs.mdx +reviewSourceHash: 66a72faa --- -## Overview +## 概述 -Subgraphs let users group nodes into reusable, nestable components. Each subgraph is its own `LGraph` with a UUID. For the user-facing guide, see [Subgraphs](/zh/interface/features/subgraph). +子图允许用户将节点分组为可复用、可嵌套的组件。每个子图都是一个独立的 `LGraph`,带有 UUID。有关面向用户的指南,请参阅[子图](/zh/interface/features/subgraph)。 -## Node Identifiers +## 节点标识符 -ComfyUI uses three distinct node identifier types. Using the wrong one causes silent failures. +ComfyUI 使用三种不同的节点标识符类型。使用错误的标识符会导致静默失败。 -| Type | Format | Used for | +| 类型 | 格式 | 用途 | |------|--------|----------| -| `node.id` | `42` (number) | Local to its immediate graph level. `graph.getNodeById(id)` | -| Execution ID | `"1:2:3"` (colon-separated string) | Backend progress messages, `UNIQUE_ID` | -| Locator ID | `":"` or `""` | UI state: badges, errors, images | +| `node.id` | `42`(数字) | 限其直接图层级内使用。`graph.getNodeById(id)` | +| 执行 ID | `"1:2:3"`(冒号分隔字符串) | 后端进度消息、`UNIQUE_ID` | +| 定位 ID | `":"` 或 `""` | UI 状态:徽章、错误、图像 | -To construct a node's locator ID from within an extension: +从扩展内部构造节点定位 ID: ```javascript function getLocatorId(node) { @@ -28,9 +27,9 @@ function getLocatorId(node) { } ``` -## Traversing Nodes +## 遍历节点 -### Current layer only +### 仅当前图层 ```javascript for (const node of app.graph.nodes) { @@ -38,9 +37,9 @@ for (const node of app.graph.nodes) { } ``` -### All nodes recursively +### 递归遍历所有节点 -To walk into nested subgraphs, use a recursive helper that calls a callback on every node: +要进入嵌套子图,可以使用递归辅助函数,对每个节点调用回调: ```javascript function walkGraph(graph, callback) { @@ -51,7 +50,7 @@ function walkGraph(graph, callback) { } ``` -Full example: +完整示例: ```javascript import { app } from "../../scripts/app.js" @@ -73,49 +72,49 @@ app.registerExtension({ }) ``` -## Root vs Active Graph +## 根图 vs 当前活动图 -| You want to... | Use | +| 你需要… | 使用 | |-----------------|-----| -| Operate on all nodes in the workflow | `app.graph` (root) | -| Operate on only the visible layer | `app.canvas?.graph` | -| Access a specific subgraph | `someNode.subgraph` | +| 对工作流中所有节点进行操作 | `app.graph`(根图) | +| 仅对当前可见图层进行操作 | `app.canvas?.graph` | +| 访问特定子图 | `someNode.subgraph` | ```javascript -// All nodes (including nested subgraphs) +// 所有节点(包括嵌套子图) walkGraph(app.graph, (node) => { /* ... */ }) -// Only nodes the user currently sees +// 仅用户当前看到的节点 for (const node of app.canvas?.graph?.nodes ?? []) { /* ... */ } ``` -## Events +## 事件 -### Subgraph-level events +### 子图级别事件 -Dispatched on `subgraph.events`: +在 `subgraph.events` 上分发: -| Event | Payload | When | +| 事件 | 载荷 | 触发时机 | |-------|---------|------| -| `widget-promoted` | `{ widget, subgraphNode }` | Widget promoted to parent node | -| `widget-demoted` | `{ widget, subgraphNode }` | Widget removed from parent node | -| `input-added` | `{ input }` | Input slot added | -| `removing-input` | `{ input, index }` | Input slot being removed | -| `output-added` | `{ output }` | Output slot added | -| `removing-output` | `{ output, index }` | Output slot being removed | -| `renaming-input` | `{ input, index, oldName, newName }` | Input slot renamed | -| `renaming-output` | `{ output, index, oldName, newName }` | Output slot renamed | +| `widget-promoted` | `{ widget, subgraphNode }` | 控件被提升到父节点 | +| `widget-demoted` | `{ widget, subgraphNode }` | 控件从父节点移除 | +| `input-added` | `{ input }` | 输入插槽被添加 | +| `removing-input` | `{ input, index }` | 输入插槽正在移除 | +| `output-added` | `{ output }` | 输出插槽被添加 | +| `removing-output` | `{ output, index }` | 输出插槽正在移除 | +| `renaming-input` | `{ input, index, oldName, newName }` | 输入插槽被重命名 | +| `renaming-output` | `{ output, index, oldName, newName }` | 输出插槽被重命名 | -### Canvas-level events +### 画布级别事件 -Dispatched on `app.canvas.canvas` (the HTML canvas element): +在 `app.canvas.canvas`(HTML canvas 元素)上分发: -| Event | Payload | When | +| 事件 | 载荷 | 触发时机 | |-------|---------|------| -| `subgraph-opened` | `{ subgraph, closingGraph, fromNode }` | User navigates into a subgraph | -| `subgraph-converted` | `{ subgraphNode }` | Selection converted to a subgraph | +| `subgraph-opened` | `{ subgraph, closingGraph, fromNode }` | 用户导航进入子图 | +| `subgraph-converted` | `{ subgraphNode }` | 选区被转换为子图 | -### Listening pattern +### 监听模式 ```javascript import { app } from "../../scripts/app.js" @@ -131,12 +130,12 @@ app.registerExtension({ }) ``` -## Widget Promotion +## 控件提升 -When a `SubgraphInput` connects to a widget inside a subgraph, a copy of that widget appears on the parent subgraph node. This fires `widget-promoted`. Removing the connection fires `widget-demoted`. +当 `SubgraphInput` 连接到子图内部的控件时,该控件的副本会出现在父子图节点上。这会触发 `widget-promoted`。断开连接会触发 `widget-demoted`。 -Widget promotion behavior is still evolving and may change in future releases. +控件提升行为仍在演进中,未来版本可能发生变化。 ```javascript @@ -177,9 +176,9 @@ app.registerExtension({ }) ``` -## Cleanup +## 清理 -Use an `AbortController` to clean up all event listeners when a node is removed. +使用 `AbortController` 在节点被移除时清理所有事件监听器。 ```javascript import { app } from "../../scripts/app.js" @@ -210,10 +209,10 @@ app.registerExtension({ ``` -`onRemoved` can also fire during subgraph conversion, not just deletion. Guard teardown logic if you need to preserve state across restructuring. +`onRemoved` 也可能在子图转换时触发,而不仅仅是删除操作。如果你需要在重组后保留状态,请对拆解逻辑进行防护。 -## See Also +## 另请参阅 -- [Subgraphs (User Guide)](/zh/interface/features/subgraph) -- [Extension Hooks](/zh/custom-nodes/js/javascript_hooks) +- [子图(用户指南)](/zh/interface/features/subgraph) +- [扩展 Hook](/zh/custom-nodes/js/javascript_hooks) diff --git a/zh/custom-nodes/tips.mdx b/zh/custom-nodes/tips.mdx index d9ef0fece..ceaa25809 100644 --- a/zh/custom-nodes/tips.mdx +++ b/zh/custom-nodes/tips.mdx @@ -1,7 +1,6 @@ --- -title: "Tips" -translationSourceHash: 9fe5613e -translationFrom: custom-nodes/tips.mdx +title: "提示" +reviewSourceHash: 9fe5613e --- -### Recommended Development Lifecycle +### 推荐开发流程 diff --git a/zh/development/cloud/api-reference.mdx b/zh/development/cloud/api-reference.mdx index 7526d9cab..5496c7922 100644 --- a/zh/development/cloud/api-reference.mdx +++ b/zh/development/cloud/api-reference.mdx @@ -2,8 +2,7 @@ title: "Cloud API 参考" description: "Comfy Cloud 的完整 API 参考及代码示例" icon: "book-open" -translationSourceHash: 5ec787f8 -translationFrom: development/cloud/api-reference.mdx +reviewSourceHash: 5ec787f8 --- import PollJobCompletion from '/snippets/zh/cloud/poll-job-completion.mdx' @@ -457,81 +456,7 @@ workflow = set_workflow_input(workflow, "6", "text", "a beautiful landscape") 轮询任务完成状态。 - -```bash curl -curl -X GET "$BASE_URL/api/job/{prompt_id}/status" \ - -H "X-API-Key: $COMFY_CLOUD_API_KEY" -``` - -```typescript TypeScript -interface JobStatus { - status: string; -} - -async function getJobStatus(promptId: string): Promise { - const response = await fetch(`${BASE_URL}/api/job/${promptId}/status`, { - headers: getHeaders(), - }); - if (!response.ok) throw new Error(`HTTP ${response.status}`); - return response.json(); -} - -async function pollForCompletion( - promptId: string, - timeout: number = 300, - pollInterval: number = 2000 -): Promise { - const startTime = Date.now(); - - while (Date.now() - startTime < timeout * 1000) { - const { status } = await getJobStatus(promptId); - - if (status === "success") { - return; - } else if (["error", "failed", "cancelled"].includes(status)) { - throw new Error(`Job failed with status: ${status}`); - } - - await new Promise((resolve) => setTimeout(resolve, pollInterval)); - } - - throw new Error(`Job ${promptId} did not complete within ${timeout}s`); -} - -await pollForCompletion(promptId); -console.log("Job completed!"); -``` - -```python Python -def get_job_status(prompt_id: str) -> str: - """Get the current status of a job.""" - response = requests.get( - f"{BASE_URL}/api/job/{prompt_id}/status", - headers=get_headers() - ) - response.raise_for_status() - return response.json()["status"] - -def poll_for_completion(prompt_id: str, timeout: int = 300, poll_interval: float = 2.0) -> None: - """Poll until job completes or times out.""" - start_time = time.time() - - while time.time() - start_time < timeout: - status = get_job_status(prompt_id) - - if status == "success": - return - elif status in ("error", "failed", "cancelled"): - raise RuntimeError(f"Job failed with status: {status}") - - time.sleep(poll_interval) - - raise TimeoutError(f"Job {prompt_id} did not complete within {timeout}s") - -poll_for_completion(prompt_id) -print("Job completed!") -``` - + --- @@ -989,7 +914,7 @@ REST API 端点返回标准 HTTP 状态码: |--------|------| | `400` | 无效请求(错误的工作流、缺少字段) | | `401` | 未授权(无效或缺少 API 密钥) | -| `402` | 余额不足 | +| `402` | 积分不足 | | `429` | 订阅未激活 | | `500` | 内部服务器错误 | @@ -1003,5 +928,5 @@ REST API 端点返回标准 HTTP 状态码: | `ModelDownloadError` | 所需模型不可用或下载失败 | | `ImageDownloadError` | 从 URL 下载输入图像失败 | | `OOMError` | GPU 内存不足 | -| `InsufficientFundsError` | 账户余额不足(用于合作伙伴节点) | +| `InsufficientFundsError` | 账户积分不足(用于合作节点) | | `InactiveSubscriptionError` | 订阅未激活 | diff --git a/zh/development/cloud/overview.mdx b/zh/development/cloud/overview.mdx index 6a6472088..300abe3c6 100644 --- a/zh/development/cloud/overview.mdx +++ b/zh/development/cloud/overview.mdx @@ -1,8 +1,7 @@ --- title: "Cloud API 概述" description: "通过编程方式访问 Comfy Cloud,在云端运行工作流、管理文件并监控执行状态" -translationSourceHash: d9316708 -translationFrom: development/cloud/overview.mdx +reviewSourceHash: d9316708 --- import GetApiKey from '/snippets/zh/get-api-key.mdx' @@ -25,7 +24,7 @@ Comfy Cloud API 提供以编程方式访问 Comfy Cloud 的能力,可在云端 ## 积分与用量 -API 请求消耗的是与 Comfy Cloud 网页端相同的每月积分配额——不存在单独的 API 积分池。每个等级的包含积分、加购选项以及单次工作流运行时长上限对 API 任务和网页端任务完全相同。Creator 和 Pro 等级的每月积分数量请参阅[定价方案](https://www.comfy.org/cloud/pricing?utm_source=docs&utm_campaign=cloud-api)。如果在月中用尽积分,可在账户面板中购买加购包。 +API 请求消耗的是与 Comfy Cloud 网页端相同的每月积分配额——不存在单独的 API 积分池。每个等级的包含积分、加购选项以及单次工作流运行时长上限对 API 任务和网页端任务完全相同。Standard、Creator 和 Pro 等级的每月积分数量请参阅[定价方案](https://www.comfy.org/cloud/pricing?utm_source=docs&utm_campaign=cloud-api)。如果在月中用尽积分,可在账户面板中购买加购包。 ## 基础 URL @@ -94,6 +93,7 @@ API 用户可以同时提交多个工作流,无需等待之前的任务完成 | 订阅等级 | 并发任务数 | |----------|-----------| +| Standard | 1 | | Creator | 3 | | Pro | 5 | diff --git a/zh/development/comfyui-server/api-examples.mdx b/zh/development/comfyui-server/api-examples.mdx index 18f26f463..c00c9b0d0 100644 --- a/zh/development/comfyui-server/api-examples.mdx +++ b/zh/development/comfyui-server/api-examples.mdx @@ -1,28 +1,26 @@ --- title: "API 示例" -description: "调用 ComfyUI Server API 的三种常见方式" -translationSourceHash: 8afd49d2 -translationFrom: development/comfyui-server/api-examples.mdx +reviewSourceHash: "8afd49d2" --- -本页演示了与 ComfyUI Server API 交互的三种方式,从简单的 HTTP 提交到完整的 WebSocket 集成实时图像输出。 +本文档演示了与 ComfyUI 服务器 API 交互的三种方式,从简单的 HTTP 提交到完整的 WebSocket 集成并实时获取图像输出。 -所有示例均使用[默认的 SD1.5 工作流](https://github.com/Comfy-Org/ComfyUI/blob/master/script_examples)进行演示。使用 API 之前,你需要先导出工作流的 [API 格式](/zh/development/api-development/workflow-api-format)。 +所有示例均使用[默认 SD1.5 工作流](https://github.com/Comfy-Org/ComfyUI/blob/master/script_examples)进行演示。在使用 API 之前,您需要以 [API 格式](/development/api-development/workflow-api-format)导出您的工作流。 - 这些示例使用 Python 标准库和 `websocket-client` 包(`pip install websocket-client`)。底层 API 协议与语言无关 — 请参阅 [Cloud API 参考](/zh/development/cloud/api-reference) 了解 TypeScript 和 curl 版本。 + 这些示例使用 Python 标准库和 `websocket-client` 包(`pip install websocket-client`)。底层 API 协议与语言无关——有关 TypeScript 和 curl 的等价实现,请参阅[云 API 参考](/development/cloud/api-reference)。 --- -## 方法一:提交即忘(仅 HTTP) +## 方法一:提交即弃(仅 HTTP) -源码:[`basic_api_example.py`](https://github.com/Comfy-Org/ComfyUI/blob/master/script_examples/basic_api_example.py) +来源:[`basic_api_example.py`](https://github.com/Comfy-Org/ComfyUI/blob/master/script_examples/basic_api_example.py) -最简单的方式:提交工作流,不等待结果。适用于不需要即时输出的场景。 +最简单的方式:提交工作流后不等待结果。适用于无需立即获取输出、稍后检查结果的场景。 ```python -"""basic_api_example.py — 仅通过 HTTP 提交工作流。""" +"""basic_api_example.py — Submit a workflow via HTTP only.""" import json from urllib import request @@ -40,7 +38,7 @@ def queue_prompt(prompt): if __name__ == "__main__": - # 加载 API 格式导出的工作流 + # 以 API 格式加载已导出的工作流 prompt_text = """{ "3": { "class_type": "KSampler", @@ -91,19 +89,19 @@ if __name__ == "__main__": ``` - 此方法使用 `SaveImage` 节点,图片会保存到服务器磁盘。要获取图片,需要调用 `GET /view?filename=...`。 + 此方法使用 `SaveImage` 节点,将图像保存到服务器磁盘上。要获取图像,您需要调用 `GET /view?filename=...`。 --- -## 方法二:WebSocket + History(监控执行完成) +## 方法二:WebSocket + 历史记录(监控完成状态) -源码:[`websockets_api_example.py`](https://github.com/Comfy-Org/ComfyUI/blob/master/script_examples/websockets_api_example.py) +来源:[`websockets_api_example.py`](https://github.com/Comfy-Org/ComfyUI/blob/master/script_examples/websockets_api_example.py) -使用 WebSocket 等待执行完成,然后通过 `/history` 端点获取结果。这是大多数场景的推荐方式。 +使用 WebSocket 等待执行完成,然后通过 `/history` 端点获取输出。这是大多数用例推荐的模式。 ```python -"""websockets_api_example.py — 通过 WebSocket 监控执行,通过 /history 下载。""" +"""websockets_api_example.py — Monitor execution via WebSocket, download via /history.""" import websocket # pip install websocket-client import uuid @@ -155,11 +153,11 @@ def get_images(ws, prompt): data = message["data"] if data["node"] is None and data["prompt_id"] == prompt_id: break # 执行完成 - # 二进制帧是预览图片 — 此处跳过 + # 二进制帧是预览图像——此处跳过 continue history = get_history(prompt_id)[prompt_id] - output_images = {} + output_images = {{}} for node_id in history["outputs"]: node_output = history["outputs"][node_id] images_output = [] @@ -174,32 +172,45 @@ def get_images(ws, prompt): if __name__ == "__main__": - # 此处省略完整工作流 JSON,请参考方法一的示例 - # prompt = json.loads(prompt_text) - # prompt["3"]["inputs"]["seed"] = 5 - # prompt["6"]["inputs"]["text"] = "masterpiece best quality man" - - # ws = websocket.WebSocket() - # ws.connect(f"ws://{SERVER_ADDRESS}/ws?clientId={client_id}") - # images = get_images(ws, prompt) - # ws.close() - pass + prompt_text = """{ + "3": {{ ... }}, "4": {{ ... }}, "5": {{ ... }}, + "6": {{ ... }}, "7": {{ ... }}, "8": {{ ... }}, + "9": {{ "class_type": "SaveImage", "inputs": {{ ... }} }} + }""" + prompt = json.loads(prompt_text) + prompt["3"]["inputs"]["seed"] = 5 + prompt["6"]["inputs"]["text"] = "masterpiece best quality man" + + ws = websocket.WebSocket() + ws.connect(f"ws://{SERVER_ADDRESS}/ws?clientId={{client_id}}") + images = get_images(ws, prompt) + ws.close() + + print(f"Got {{len(images)}} output node(s) with images.") + + # 显示图像(需要 Pillow): + # for node_id in images: + # for image_data in images[node_id]: + # from PIL import Image + # import io + # img = Image.open(io.BytesIO(image_data)) + # img.show() ``` - WebSocket 二进制帧中的生成过程预览图片可以解码用于实时预览(二进制格式参见[服务器消息](/zh/development/comfyui-server/comms_messages)页面)。 + WebSocket 二进制帧包含生成过程中的进度预览图像。您可以解码这些帧以实现实时预览(二进制格式请参阅[服务器消息](/development/comfyui-server/comms_messages)页面)。 --- -## 方法三:WebSocket 配合 SaveImageWebsocket(实时获取图片) +## 方法三:使用 SaveImageWebsocket 的 WebSocket(实时图像) -源码:[`websockets_api_example_ws_images.py`](https://github.com/Comfy-Org/ComfyUI/blob/master/script_examples/websockets_api_example_ws_images.py) +来源:[`websockets_api_example_ws_images.py`](https://github.com/Comfy-Org/ComfyUI/blob/master/script_examples/websockets_api_example_ws_images.py) -如果不想将图片保存到磁盘,可以使用 `SaveImageWebsocket` 节点。图片会通过 WebSocket 二进制帧直接传送。 +对于不希望将图像保存到磁盘的场景,请使用 `SaveImageWebsocket` 节点。图像将直接通过 WebSocket 二进制帧传送。 ```python -"""websockets_api_example_ws_images.py — 通过 WebSocket 直接接收图片。""" +"""websockets_api_example_ws_images.py — Receive images directly via WebSocket.""" import websocket # pip install websocket-client import uuid @@ -222,7 +233,7 @@ def queue_prompt(prompt): def get_images(ws, prompt): prompt_id = queue_prompt(prompt)["prompt_id"] - output_images = {} + output_images = {{}} current_node = "" while True: @@ -236,10 +247,10 @@ def get_images(ws, prompt): break # 执行完成 current_node = data["node"] else: - # 二进制帧 — SaveImageWebsocket 的图片数据 + # 二进制帧——SaveImageWebsocket 的图像数据 if current_node == "save_image_websocket_node": images_output = output_images.get(current_node, []) - # 前 8 字节是类型/元数据,剩余是图片数据 + # 前 8 个字节是类型/元数据,其余为图像数据 images_output.append(out[8:]) output_images[current_node] = images_output @@ -247,34 +258,50 @@ def get_images(ws, prompt): if __name__ == "__main__": - # prompt = json.loads(prompt_text) - # prompt["3"]["inputs"]["seed"] = 5 - - # ws = websocket.WebSocket() - # ws.connect(f"ws://{SERVER_ADDRESS}/ws?clientId={client_id}") - # images = get_images(ws, prompt) - # ws.close() - pass + prompt_text = """{ + "3": {{ "class_type": "KSampler", "inputs": {{ ... }} }}, + ... + "save_image_websocket_node": {{ + "class_type": "SaveImageWebsocket", + "inputs": {{"images": ["8", 0]}} + }} + }""" + prompt = json.loads(prompt_text) + prompt["3"]["inputs"]["seed"] = 5 + + ws = websocket.WebSocket() + ws.connect(f"ws://{SERVER_ADDRESS}/ws?clientId={{client_id}}") + images = get_images(ws, prompt) + ws.close() + + print(f"Received {{len(images)}} image(s) via WebSocket.") + + # 显示(需要 Pillow): + # for image_data in images.get("save_image_websocket_node", []): + # from PIL import Image + # import io + # img = Image.open(io.BytesIO(image_data)) + # img.show() ``` - 工作流必须使用 `class_type: "SaveImageWebsocket"`(内置节点)代替普通的 `SaveImage` 节点。 + 工作流必须使用 `class_type: "SaveImageWebsocket"`(内置节点)的节点,而非普通的 `SaveImage` 节点。 --- -## 应该用哪种方法? +## 应该使用哪种方法? - + - **发送即忘。** 适用于不需要立即获取输出的场景。 + **提交即弃。** 适用于不需要即时输出,或可稍后获取结果的场景。 - - **推荐。** 等待完成,然后下载结果。简单性和可靠性之间最佳平衡。 + + **推荐。** 等待完成,然后下载输出。兼具简洁性和可靠性。 - - **实时图片。** 适用于需要图片不写磁盘直接送达的交互式应用。 + + **实时图像。** 适用于交互式应用,希望无需写盘即可获取图像。 -完整的 API 参考(端点、负载格式、错误处理)请参阅[服务器路由](/zh/development/comfyui-server/comms_routes)和[服务器消息](/zh/development/comfyui-server/comms_messages)页面。 +有关完整的 API 参考(端点、载荷格式、错误处理),请参阅[服务器路由](/development/comfyui-server/comms_routes)和[服务器消息](/development/comfyui-server/comms_messages)页面。 diff --git a/zh/development/comfyui-server/api-key-integration.mdx b/zh/development/comfyui-server/api-key-integration.mdx index dfd7dcde9..d95a8c02d 100644 --- a/zh/development/comfyui-server/api-key-integration.mdx +++ b/zh/development/comfyui-server/api-key-integration.mdx @@ -1,129 +1,38 @@ --- -title: '通过 API Key 集成来使用 ComfyUI API 节点' -description: '本文介绍了如何通过 API Key 集成来使用 ComfyUI API 节点' -sidebarTitle: 'Partner Node API 集成' -icon: 'puzzle-piece' -translationSourceHash: 1276143d -translationFrom: development/comfyui-server/api-key-integration.mdx +title: "API Key 集成" +reviewSourceHash: "1276143d" --- -从[PR #8041](https://github.com/Comfy-Org/ComfyUI/pull/8041)开始,ComfyUI 支持通过创建 API Key 来直接使用 ComfyUI 内置的 API 节点,无需特定的前端界面(甚至可以完全不使用前端)。 +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; -这意味着你可以创建工作流来组合: -- 本地操作系统模型 -- 自定义节点社区的工具 -- 流行的付费模型 +本文档将介绍如何使用您自己的 Comfy 账户 API Key 与自定义节点进行交互。 -并通过本地 Comfy webserver API 一起运行所有内容,让它处理所有的协调工作。 +## 介绍 -这对于将 Comfy 用作后端服务、通过命令行运行 Comfy、拥有自己的前端等用户都很有帮助。 +某些 ComfyUI 节点与服务提供商集成,需要 API Key 才能访问。 -## 前提条件 + +创建"合作节点"需要使用 Comfy 账户 API Key。如果您是节点发布者,希望将节点作为合作节点发布,则可能需要 Comfy 账户 API Key。有关发布节点的信息,请参阅[发布](/registry/publishing)指南。 + -使用 API Key 来调用 ComfyUI 内置的 API 节点需要: -- 确保你的 ComfyUI 版本 >= [PR #8041](https://github.com/Comfy-Org/ComfyUI/pull/8041) -- 对应账户的 [API Key](/zh/development/api-development/getting-an-api-key) -- 足够的账户积分 +## 获取您的 Comfy 账户 API Key -使用 API Key 来调用 ComfyUI 内置的 API 节点需要先在 [ComfyUI Platform](https://platform.comfy.org/login) 上注册一个账户,然后[创建 API key](/zh/development/api-development/getting-an-api-key) +要获取您的 API Key——它允许您从 ComfyUI 工作流程调用[合作节点](/tutorials/partner-nodes/overview)——请按照以下步骤操作: - -请参考用户界面章节了解如何使用 API Key 进行登录 - +1. 登录到您的 Comfy 账户 +2. 点击右上角的用户图标 +3. 从下拉菜单中选择"设置" +4. 在设置中,导航至"API Keys"部分 +5. 点击"创建新密钥"按钮 +6. 复制生成的 API Key 并安全保存 -你需要确保你的 ComfyUI 账户有足够的积分来测试对应的功能。 +## 设置您的 API Key - -请参考积分章节了解如何为你的账户购买积分 - - - -## Python 示例 - -以下是一个如何通过 Python 代码向 ComfyUI API 发送包含 API节点的工作流的示例: - -```python -"""在无头模式或使用替代前端运行 ComfyUI 时使用 API 节点 - -你可以通过在 prompt 中包含 API key 来执行包含 API 节点的 ComfyUI 工作流。 -API key 需要添加到 payload 的 `extra_data` 字段中。 -下面我们展示一个如何实现的示例。 - -更多信息请参考: - -- API 节点概述: https://docs.comfy.org/zh/tutorials/partner-nodes/overview -- 要生成 API key,请登录这里: https://platform.comfy.org/login -""" - -import json -from urllib import request - -SERVER_URL = "http://127.0.0.1:8188" - -# 我们有一个包含 API 节点的 prompt/job(API 格式的工作流)。 -workflow_with_api_nodes = """{ - "11": { - "inputs": { - "prompt": "A dreamy, surreal half-body portrait of a young woman meditating. She has a short, straight bob haircut dyed in pastel pink, with soft bangs covering her forehead. Her eyes are gently closed, and her hands are raised in a calm, open-palmed meditative pose, fingers slightly curved, as if levitating or in deep concentration. She wears a colorful dress made of patchwork-like pastel tiles, featuring clouds, stars, and rainbows. Around her float translucent, iridescent soap bubbles reflecting the rainbow hues. The background is a fantastical sky filled with cotton-candy clouds and vivid rainbow waves, giving the entire scene a magical, dreamlike atmosphere. Emphasis on youthful serenity, whimsical ambiance, and vibrant soft lighting.", - "prompt_upsampling": false, - "seed": 589991183902375, - "aspect_ratio": "1:1", - "raw": false, - "image_prompt_strength": 0.4000000000000001, - "image_prompt": [ - "14", - 0 - ] - }, - "class_type": "FluxProUltraImageNode", - "_meta": { - "title": "Flux 1.1 [pro] Ultra Image" - } - }, - "12": { - "inputs": { - "filename_prefix": "ComfyUI", - "images": [ - "11", - 0 - ] - }, - "class_type": "SaveImage", - "_meta": { - "title": "Save Image" - } - }, - "14": { - "inputs": { - "image": "example.png" - }, - "class_type": "LoadImage", - "_meta": { - "title": "Load Image" - } - } -}""" - - -prompt = json.loads(workflow_with_api_nodes) -payload = { - "prompt": prompt, - # 将 `api_key_comfy_org` 添加到 payload 中。 - # 如果你需要处理多个客户端,可以先从关联的用户获取 key。 - "extra_data": { - "api_key_comfy_org": "comfyui-87d01e28d*******************************************************" # 替换为实际的 key - }, -} -data = json.dumps(payload).encode("utf-8") -req = request.Request(f"{SERVER_URL}/prompt", data=data) - -# 发送请求 -request.urlopen(req) +获取 API Key 后,您可以将其设置为环境变量或直接传入节点: +```bash +export COMFY_API_KEY=your_api_key_here ``` -## 相关文档 - -- [API节点概述](https://docs.comfy.org/zh/tutorials/partner-nodes/overview) -- [账户管理](https://docs.comfy.org/zh/interface/user) -- [积分](https://docs.comfy.org/zh/interface/credits) \ No newline at end of file +或者,您可以通过 ComfyUI Manager 来配置 API Key。 diff --git a/zh/development/core-concepts/dependencies.mdx b/zh/development/core-concepts/dependencies.mdx index 1db02b4cc..dbb57af28 100644 --- a/zh/development/core-concepts/dependencies.mdx +++ b/zh/development/core-concepts/dependencies.mdx @@ -2,8 +2,7 @@ title: "依赖关系" description: "了解 ComfyUI 中的依赖关系" icon: "file" -translationSourceHash: c24a35c5 -translationFrom: development/core-concepts/dependencies.mdx +reviewSourceHash: c24a35c5 --- ## 工作流文件依赖于其他文件 @@ -26,7 +25,7 @@ ComfyUI 的工作方式也是如此。工作流只有在找到并加载所有必 ## 自定义节点 -自定义节点是 ComfyUI 的一个重要组成部分, +自定义节点是 ComfyUI 的一个重要组成部分,可以扩展其功能。它们由社区创建,可以安装以向工作流添加新功能。 ## Python 依赖 @@ -76,7 +75,7 @@ pydantic-settings~=2.0 ```bash pip install -r requirements.txt ``` -从而来安装 ComfyUI 最新的依赖以保证 ComfyUI 的正常运行,你也可以通过修改特定包的依赖版本来实现部分依赖的升级或者降级 +从而确保 ComfyUI 的依赖保持最新以保证正常运行,你也可以通过修改特定包的依赖版本来实现部分依赖的升级或者降级 另外 ComfyUI 的前端 [ComfyUI_frontend](https://github.com/Comfy-Org/ComfyUI_frontend) 目前是作为一个独立的项目来进行维护,我们会在对应版本稳定之后更新对应的 `comfyui-frontend-package` 依赖版本,如果你需要切换对应的前端版本,你可以在[这里](https://pypi.org/project/comfyui-frontend-package/#history)查看对应的版本信息。 @@ -124,6 +123,12 @@ python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ - 从本地服务器搭建开始,了解消息类型、路由处理和执行模型反转。 + + 在自有机器上将 ComfyUI 作为服务器运行。通过 REST 和 WebSocket API 启动、配置和调用它。 -另见:[消息与路由](/zh/development/comfyui-server/comms_messages) · [执行模型反转](/zh/development/comfyui-server/execution_model_inversion_guide) · [Partner Node API 集成](/zh/development/comfyui-server/api-key-integration) +另见:[API 示例](/zh/development/comfyui-server/api-examples) · [Partner Node API 集成](/zh/development/comfyui-server/api-key-integration) ## Cloud API -在 Comfy Cloud 上以编程方式运行工作流,无需管理硬件。使用 REST API、查看 OpenAPI 规范,并通过 API Key 集成 Partner Node。 +在 Comfy Cloud 上以编程方式运行工作流,无需管理硬件。使用 REST API、查看 OpenAPI 规范,并通过 API Key 集成合作节点。 了解如何认证、提交任务、查询状态以及从 Comfy Cloud 下载结果。 -另见:[API 参考](/zh/development/cloud/api-reference) · [OpenAPI 规范](/zh/development/cloud/openapi) · [获取 API Key](/zh/development/api-development/getting-an-api-key) +另见:[API 参考](/zh/development/cloud/api-reference) · [OpenAPI 规范](/zh/development/cloud/openapi) · [获取 API Key](/zh/development/api-development/getting-an-api-key) · [API 概览](/zh/development/api-development/overview) ## Agent Tools / MCP diff --git a/zh/interface/settings/3d.mdx b/zh/interface/settings/3d.mdx index af4e730c9..09d4aca29 100644 --- a/zh/interface/settings/3d.mdx +++ b/zh/interface/settings/3d.mdx @@ -3,8 +3,7 @@ title: "ComfyUI 3D 设置" description: "ComfyUI 3D 设置选项的详细说明" icon: "cube" sidebarTitle: "3D" -translationSourceHash: a8b7a01b -translationFrom: interface/settings/3d.mdx +reviewSourceHash: a8b7a01b --- import SettingsMenuContext from "/snippets/zh/interface/settings-menu-context.mdx" diff --git a/zh/interface/settings/comfy-desktop.mdx b/zh/interface/settings/comfy-desktop.mdx index caec2bdda..59525a985 100644 --- a/zh/interface/settings/comfy-desktop.mdx +++ b/zh/interface/settings/comfy-desktop.mdx @@ -3,8 +3,7 @@ title: "ComfyUI 桌面应用通用设置" description: "ComfyUI 桌面应用通用设置选项的详细说明" icon: "desktop" sidebarTitle: "Comfy 桌面版" -translationSourceHash: b0a5f5bd -translationFrom: interface/settings/comfy-desktop.mdx +reviewSourceHash: b0a5f5bd --- import SettingsMenuContext from "/snippets/zh/interface/settings-menu-context.mdx" @@ -14,34 +13,28 @@ import SettingsMenuContext from "/snippets/zh/interface/settings-menu-context.md ## 常规 **窗口样式** -- **默认值**: default -- **说明**: 控制应用窗口的标题栏样式 +- **说明**: 控制应用窗口的标题栏样式 + +**自动检查更新** +- **说明**: 自动检查 ComfyUI 桌面版的更新,当有更新时会提醒你进行更新 -**自动更新检查** -- **默认值**: 启用 -- **说明**: 自动检查 ComfyUI 桌面版的更新,在更新可同时将会提醒你进行更新 - **发送匿名使用情况统计** -- **默认值**: 启用 -- **说明**: 发送匿名使用情况统计数据,帮助改进软件 ,对应的设置修改需要重启才能生效 +- **说明**: 发送匿名使用情况统计数据,帮助改进软件。对应的设置修改需要重启才能生效 -## UV(包管理器) +## UV 这个部分主要针对中国地区用户设置使用,因为 Desktop 使用的许多原始镜像都是中国境外的,所以对国内用户访问不一定友好,你可以在这里设置你自己的镜像源,以提高访问速度,保证对应包可以正常访问下载。 - + **Python 安装镜像** -- **默认值**: 空(使用默认源) - **说明**: - 管理的 Python 安装包从 Astral python-build-standalone 项目下载 - 可设置镜像 URL 使用不同的 Python 安装源 - 提供的 URL 将替换默认的 GitHub 下载地址 - 支持使用 file:// 协议从本地目录读取分发包 -- **验证**: 自动检查镜像可达性 - +- **验证**: 自动检查镜像可达性 + **PyPI 安装镜像** -- **默认值**: 空(使用默认源) - **说明**: 默认的 pip 包安装镜像源 - -**Torch安装镜像** -- **默认值**: 空(使用默认源) -- **说明**: PyTorch 专用的 pip 安装镜像源 + +**Torch 安装镜像** +- **说明**: PyTorch 专用的 pip 安装镜像源 diff --git a/zh/interface/settings/comfy.mdx b/zh/interface/settings/comfy.mdx index aa5a99a63..bfcd3ff54 100644 --- a/zh/interface/settings/comfy.mdx +++ b/zh/interface/settings/comfy.mdx @@ -3,23 +3,22 @@ title: "Comfy 设置" description: "ComfyUI 核心设置选项的详细说明" icon: "sliders" sidebarTitle: "Comfy" -translationSourceHash: dc624283 -translationFrom: interface/settings/comfy.mdx +reviewSourceHash: dc624283 --- import SettingsMenuContext from "/snippets/zh/interface/settings-menu-context.mdx" -## API 节点 +## 合作节点 -### 显示 API 节点定价徽章 +### 显示合作节点定价徽章 - **默认值**:启用 -- **功能**:控制是否在 API 节点上显示定价徽章,帮助用户识别 API 节点的使用成本 +- **功能**:控制是否在合作节点上显示定价徽章,帮助用户识别合作节点的使用成本 ![启用效果](/images/interface/setting/comfy/api_node_pricing_badge.jpg) -> 更多关于 API 节点请参考 [API 节点](/zh/tutorials/partner-nodes/overview) +> 更多关于合作节点请参考 [合作节点](/zh/tutorials/partner-nodes/overview) ## 开发者模式 @@ -96,9 +95,9 @@ import SettingsMenuContext from "/snippets/zh/interface/settings-menu-context.md ### 显示实验性节点 - **默认值**:启用 -- **功能**:控制是否在搜索中显示实验性节点,实验性节点说一些新的功能支持,但未完全稳定,可能在未来版本中发生变化或被移除 +- **功能**:控制是否在搜索中显示实验性节点,实验性节点是一些新的功能支持,但未完全稳定,可能在未来版本中发生变化或被移除 -![已弃用节点](/images/interface/setting/comfy/beta_node.jpg) +![实验性节点](/images/interface/setting/comfy/beta_node.jpg) ## 节点搜索框 @@ -156,9 +155,7 @@ import SettingsMenuContext from "/snippets/zh/interface/settings-menu-context.md - **默认值**:100 - **功能**:设置单次点击添加到队列的最大任务数量,防止意外添加过多任务到队列 -## 验证和开发者设置 - -### 验证节点定义 +### 验证节点定义 (slow) - **默认值**:禁用 - **功能**:控制是否在启动时验证所有节点定义(慢),仅推荐给节点开发者使用,当启用时系统会使用 Zod 模式对每个节点定义进行严格验证,这一功能会消耗更多内存和时间 - **错误处理**:验证失败的节点定义会被跳过,并在控制台输出警告信息 diff --git a/zh/interface/settings/server-config.mdx b/zh/interface/settings/server-config.mdx index 7356f3f31..e904fa245 100644 --- a/zh/interface/settings/server-config.mdx +++ b/zh/interface/settings/server-config.mdx @@ -3,8 +3,7 @@ title: "服务器配置" description: "ComfyUI 服务器配置选项的详细说明" icon: "server" sidebarTitle: "服务器配置" -translationSourceHash: 49fcc47e -translationFrom: interface/settings/server-config.mdx +reviewSourceHash: 49fcc47e --- import SettingsMenuContext from "/snippets/zh/interface/settings-menu-context.mdx" @@ -25,7 +24,7 @@ import SettingsMenuContext from "/snippets/zh/interface/settings-menu-context.md 虽然我们为 Desktop 版本提供了局域网监听设置的能力,但是作为桌面版,它本身并不适合作为服务器使用,我们建议如果你需要将 ComfyUI 示例作为局域网内的公共服务使用,请参考手动部署教程部署对应的 ComfyUI 服务。 -### 端口端口:要监听的端口 +### 端口:要监听的端口 **功能**:服务器监听的端口号。桌面版默认8000端口,Web版通常使用8188端口 diff --git a/zh/manager/pack-management.mdx b/zh/manager/pack-management.mdx index 820b2415e..b6fc7bb36 100644 --- a/zh/manager/pack-management.mdx +++ b/zh/manager/pack-management.mdx @@ -2,21 +2,19 @@ title: ComfyUI Manager 自定义节点(新版 UI)管理 sidebarTitle: 新版 UI description: 使用 ComfyUI-Manager 新界面安装、更新和管理自定义节点 -translationSourceHash: f175b3d9 -translationFrom: manager/pack-management.mdx +reviewSourceHash: f175b3d9 --- 如果你不是新版 UI 请参考 [切换新旧版UI](/zh/manager/install) 部分了解如何进行切换 -你可以通过一下方式 ## 新版界面说明 ![新版本 UI ](/images/manager/new_ui_labeled.jpg) 1. **左侧筛选器**:筛选已安装、工作流中的节点、缺失节点、可更新节点等 -2. **顶部搜索栏**:搜索节点包(Node Pack)或单个节点(Node),Filter 可切换搜索类型 +2. **顶部搜索栏**:搜索节点包(Node Pack)或单个节点(Node),筛选可切换搜索类型 3. **右侧详情面板**:点击节点后显示详情信息,包括介绍、启用状态、版本信息等。Description 标签页包含仓库信息,Nodes 标签页预览所有节点 @@ -26,7 +24,7 @@ translationFrom: manager/pack-management.mdx ### 搜索节点 ![筛选器](/images/manager/new_ui_filter.jpg) -在 Manager 中支持单独搜索节点包和单个节点,如上图,通过切换筛选器(filter)可以切换搜索类型 +在 Manager 中支持单独搜索节点包和单个节点,如上图,通过切换筛选器可以切换搜索类型 - 节点包:一个完整的自定义节点包 - 单个节点: 搜索节点内的单个节点 @@ -38,7 +36,7 @@ translationFrom: manager/pack-management.mdx 3. 或者在**版本(version)** 选择特定版本进行安装 ### 更新节点 -在 **Update available** 筛选器下,可以筛选出当前节点列表中可更新的节点 +在 **有可用更新** 筛选器下,可以筛选出当前节点列表中可更新的节点 ![更新节点](/images/manager/new_ui_update_pack.jpg) 1. 对应可更新节点会显示一个可更新的箭头标志 2. 在 **version** 选择特定版本 @@ -59,7 +57,7 @@ translationFrom: manager/pack-management.mdx 如果想要卸载已安装的节点,则选中对应节点后,在预览界面点击**卸载(Uninstall)**按钮即可进行卸载 ## 常见问题 -1. 为什搜索不到我需要的节点? +1. 为什么搜索不到我需要的节点? 目前新版 Manager 仅支持从 [registry](/zh/registry/overview) 上安装节点,如果你的节点未在 registry 注册请先在 Manager 进行注册 2. 为什么找不到通过 git 安装的选项了? diff --git a/zh/registry/api-reference/nodes/create-a-new-custom-node.mdx b/zh/registry/api-reference/nodes/create-a-new-custom-node.mdx index fdbcddb30..e8c945d67 100644 --- a/zh/registry/api-reference/nodes/create-a-new-custom-node.mdx +++ b/zh/registry/api-reference/nodes/create-a-new-custom-node.mdx @@ -1,5 +1,18 @@ --- -openapi: post /publishers/{publisherId}/nodes -translationSourceHash: c29b437f -translationFrom: registry/api-reference/nodes/create-a-new-custom-node.mdx ---- \ No newline at end of file +title: "创建一个新的自定义节点" +reviewSourceHash: "f269b3da" +--- + +import RemoveNodeWrapper from '/snippets/api-reference/create-new-custom-node.mdx'; +import PublishVersionWrapper from '/snippets/api-reference/publish-new-version.mdx'; +import SubheaderLink from '/snippets/api-reference/_subheader-link.mdx'; +import Body from '/snippets/api-reference/_body.mdx'; +import Parameters from '/snippets/api-reference/_parameters.mdx'; +import RequestExample from '/snippets/api-reference/_request-example.mdx'; + + diff --git a/zh/support/payment/payment-history.mdx b/zh/support/payment/payment-history.mdx index 2e65b4451..a70273f55 100644 --- a/zh/support/payment/payment-history.mdx +++ b/zh/support/payment/payment-history.mdx @@ -2,8 +2,7 @@ title: 查看您的付款历史记录 description: 访问和查看您过去的付款和发票 sidebarTitle: 支付记录 -translationSourceHash: 42d7c357 -translationFrom: support/payment/payment-history.mdx +reviewSourceHash: 42d7c357 --- 您可以通过帐户仪表板查看完整的付款历史记录并下载发票。 @@ -17,10 +16,10 @@ translationFrom: support/payment/payment-history.mdx ### 操作步骤示意 -![个人菜单中高亮显示的“用户设置”入口](/images/support/payment/billing-1-account.png) +![个人菜单中高亮显示的"用户设置"入口](/images/support/payment/billing-1-account.png) *打开个人菜单并选择**用户设置**以管理账单。* -![积分选项卡中高亮显示的“发票历史记录”按钮](/images/support/payment/billing-2-credits.png) +![积分选项卡中高亮显示的"发票历史记录"按钮](/images/support/payment/billing-2-credits.png) *进入**积分**选项卡并点击**发票历史记录**。* ![Stripe 门户中显示发票历史列表的界面](/images/support/payment/billing-4-history.jpg) @@ -29,8 +28,8 @@ translationFrom: support/payment/payment-history.mdx ## 下载发票 -在 Stripe 门户中你可以看到 Invoice history 列表,点击对应的 invoice 可以查看发票详情, 并下载对应的发票 +在 Stripe 门户中,打开发票历史记录中的任意条目,即可查看详情并下载 PDF 副本。 -![下载发票](/images/support/payment/billing-5-download-invoice.jpg) +![发票历史详情,下载选项高亮显示](/images/support/payment/billing-5-download-invoice.jpg) -请确定在支付生成发票前你的发票信息填写正确 [编辑您的付款信息](/zh/support/payment/editing-payment-information) \ No newline at end of file +请确保在生成新发票前您的账单信息填写正确。从[编辑您的付款信息](/zh/support/payment/editing-payment-information)更新它们。 diff --git a/zh/troubleshooting/model-issues.mdx b/zh/troubleshooting/model-issues.mdx index 402ce3429..39f51a88c 100644 --- a/zh/troubleshooting/model-issues.mdx +++ b/zh/troubleshooting/model-issues.mdx @@ -3,8 +3,7 @@ title: "如何排查和解决 ComfyUI 中模型相关的问题" description: "故障排除模型相关问题,包括架构不匹配、缺少模型和加载错误" icon: "cube" sidebarTitle: "模型问题" -translationSourceHash: 6cdb3b79 -translationFrom: troubleshooting/model-issues.mdx +reviewSourceHash: 6cdb3b79 --- ## 模型架构不匹配 @@ -64,7 +63,7 @@ translationFrom: troubleshooting/model-issues.mdx - 将所有工作流模型保持在同一架构系列内 - 从同一来源/发布下载完整的模型包 - 使用 ComfyUI 管理器的模型兼容性指示器 - - 在自定义之前使用默认示例测试工作流 + - 尝试新模型时,先使用模板工作流或官方 ComfyUI 工作流示例,然后再进行自定义 ## 缺少模型错误 @@ -115,18 +114,14 @@ CheckpointLoaderSimple: **症状:** 切换模型或开始生成时长时间延迟 **解决方案:** -1. **将模型保持在显存中:** - ```bash - python main.py --highvram - ``` - -2. **使用更快的存储:** +1. **使用更快的存储:** - 如果使用 HDD,将模型移至 SSD - 使用 NVMe SSD 获得最佳性能 -3. **调整缓存设置:** +2. **调整缓存设置:** ```bash python main.py --cache-classic # 使用旧式(积极)缓存 + python main.py --cache-lru 10 # 增加 LRU 缓存大小 ``` ### 大型模型的内存问题 diff --git a/zh/troubleshooting/overview.mdx b/zh/troubleshooting/overview.mdx index 7c57205da..0302d9994 100644 --- a/zh/troubleshooting/overview.mdx +++ b/zh/troubleshooting/overview.mdx @@ -1,389 +1,120 @@ --- -title: "如何排查和解决 ComfyUI 中出现的错误" -description: "常见 ComfyUI 问题、解决方案和如何有效报告错误" -icon: "lightbulb" -sidebarTitle: "概述" -translationSourceHash: 770c31b9 -translationFrom: troubleshooting/overview.mdx +title: "故障排查概览" +reviewSourceHash: "1d1679fc" --- +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + - 我们日常收到的诸多反馈问题,我们发现绝大部分的问题提交都与自定义节点有关,所以在提交对应的错误反馈之前,请你确保详细阅读了 [自定义节点故障排除](/zh/troubleshooting/custom-node-issues) 部分的指南,来确保对应的问题并不是由 ComfyUI 核心问题导致的。 +对 ComfyUI 进行故障排查时,请手动进行检查。简单的重新安装可能会掩盖根本原因。 - - 查看如何排查自定义节点导致的问题。 - - -## 常见问题与快速修复 - -在深入详细故障排除之前,请尝试这些常见解决方案: - -### ComfyUI 无法启动 - -**症状:** 应用程序在启动时崩溃、黑屏或无法加载 - -**快速修复:** -1. **检查系统要求** - 确保您的系统符合[最低要求](/zh/installation/system_requirements) -2. **更新 GPU 驱动程序** - 从 NVIDIA/AMD/Intel 下载最新驱动程序 - -### 生成失败或产生错误 - -**症状:** "Prompt execution failed"(提示执行失败)对话框,带有"Show report"(显示报告)按钮,工作流停止执行 - -**快速修复:** -1. **点击"Show report"** - 阅读详细错误消息以识别具体问题 -2. **检查是否是自定义节点问题** - [遵循我们的自定义节点故障排除指南](/zh/troubleshooting/custom-node-issues) -3. **验证模型文件** - 查看[模型文档](/zh/development/core-concepts/models)了解模型设置 -4. **检查显存使用情况** - 关闭其他使用 GPU 内存的应用程序 - -### 性能缓慢 - -**症状:** 生成时间非常慢、系统冻结、内存不足错误 - -**快速修复:** -1. **降低分辨率/批次大小** - 减少图像大小或图像数量 -2. **使用内存优化标志** - 请参见下方性能优化部分 -3. **关闭不必要的应用程序** - 释放 RAM 和显存 -4. **检查 CPU/GPU 使用率** - 使用任务管理器识别瓶颈 - -**性能优化命令:** - -对于低显存系统: -```bash -# 低显存模式(将模型分成多个部分) -python main.py --lowvram - -# 当 --lowvram 不够用时的更低显存模式 -python main.py --novram - -# CPU 模式(非常慢但适用于任何硬件) -python main.py --cpu -``` - -提高性能: -```bash -# 禁用预览(节省显存和处理) -python main.py --preview-method none - -# 将模型保持在显存中(更快但使用更多显存) -python main.py --highvram - -# 强制 FP16 精度(更快,使用更少显存) -python main.py --force-fp16 - -# 使用优化的注意力机制 -python main.py --use-pytorch-cross-attention -python main.py --use-flash-attention - -# 异步权重卸载 -python main.py --async-offload -``` - -内存管理: -```bash -# 为操作系统保留特定显存量(以 GB 为单位) -python main.py --reserve-vram 2 - -# 禁用智能内存管理 -python main.py --disable-smart-memory - -# 使用不同的缓存策略 -python main.py --cache-none # 更少的内存使用 -python main.py --cache-lru 10 # 缓存 10 个结果 -``` - -## 安装过程中出现的问题 - -### 桌面应用问题 - -有关全面的桌面安装故障排除,请参见[桌面安装指南](/zh/installation/desktop/windows)。 - - - -- **无法安装**:以管理员身份运行安装程序 -- **缺少依赖项**:安装 [Visual C++ 可再发行组件](https://aka.ms/vs/17/release/vc_redist.x64.exe) -- **启动时崩溃**:检查 Windows 事件查看器以获取错误详细信息 - - -- **"应用程序已损坏"**:在安全性与隐私设置中允许应用程序 -- **性能问题**:在隐私设置中授予完整磁盘访问权限 -- **崩溃**:检查控制台应用程序以获取崩溃报告 - - -- **缺少库**:使用包管理器安装依赖项 -- **LD_LIBRARY_PATH 错误**:PyTorch 库路径问题(见下文) - - - -### 手动安装问题 - - -文档可能略有过时。如果出现问题,请手动验证是否存在更新的稳定版本的 pytorch 或任何列出的库。请参考 [pytorch 安装矩阵](https://pytorch.org/get-started/locally/) 或 [ROCm 网站](https://rocm.docs.amd.com/projects/install-on-linux/en/develop/install/3rd-party/pytorch-install.html#using-a-wheels-package) 等资源。 - - -**Python 版本冲突:** -```bash -# 检查 Python 版本(需要 3.9+,推荐 3.12) -python --version - -# 使用虚拟环境(推荐) -python -m venv comfyui_env -source comfyui_env/bin/activate # Linux/Mac -comfyui_env\Scripts\activate # Windows -``` - -**包安装失败:** -```bash -# 首先更新 pip -python -m pip install --upgrade pip +## 基本信息 -# 安装依赖项 -pip install -r requirements.txt +在报告错误之前,请确保包含以下信息: -# 对于 NVIDIA GPU(CUDA 13.0) -pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130 - -# 对于 AMD GPU(仅限 Linux - ROCm 7.2) -pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm7.2 -``` +- **操作系统**:Windows/Mac/Linux +- **安装方式**:桌面应用/便携版/手动安装 +- **运行环境**:ComfyUI 版本号 +- **显卡型号**:显卡型号与显存容量 +- **自定义节点**:使用[/customnode API 路由](https://github.com/Comfy-Org/ComfyUI/blob/master/server.py)导出已安装的节点列表 +- **模型**:使用的模型 +- **桌面应用问题(如适用)**:桌面应用版本号 -### Linux 特定问题 - -**LD_LIBRARY_PATH 错误:** - -常见错误: -- "libcuda.so.1: cannot open shared object file" -- "libnccl.so: cannot open shared object file" -- "ImportError: libnvinfer.so.X: cannot open shared object file" - -**解决方案:** - -1. **现代 PyTorch 安装(最常见):** -```bash -# 对于带有 NVIDIA 包的虚拟环境 -export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib/python3.12/site-packages/nvidia/nvjitlink/lib:$LD_LIBRARY_PATH - -# 对于 conda 环境 -export LD_LIBRARY_PATH=$CONDA_PREFIX/lib/python3.12/site-packages/nvidia/nvjitlink/lib:$LD_LIBRARY_PATH - -# 或自动查找您的 Python site-packages -PYTHON_PATH=$(python -c "import site; print(site.getsitepackages()[0])") -export LD_LIBRARY_PATH=$PYTHON_PATH/nvidia/nvjitlink/lib:$LD_LIBRARY_PATH - -# 您可能还需要其他 NVIDIA 库 -export LD_LIBRARY_PATH=$PYTHON_PATH/nvidia/cuda_runtime/lib:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=$PYTHON_PATH/nvidia/cublas/lib:$LD_LIBRARY_PATH -``` +在报告错误之前,请运行以下命令确保所有内容都是最新的: -2. **查找你拥有的库:** ```bash -# 检查已安装的 NVIDIA 包 -python -c "import site; import os; nvidia_path=os.path.join(site.getsitepackages()[0], 'nvidia'); print('NVIDIA libs:', [d for d in os.listdir(nvidia_path) if os.path.isdir(os.path.join(nvidia_path, d))] if os.path.exists(nvidia_path) else 'Not found')" - -# 查找 PyTorch 需要的缺失库 -python -c "import torch; print(torch.__file__)" -ldd $(python -c "import torch; print(torch.__file__.replace('__init__.py', 'lib/libtorch_cuda.so'))") +git pull +comfy node update all ``` -3. **为你的环境永久设置:** -```bash -# 对于虚拟环境,添加到激活脚本 -echo 'export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib/python*/site-packages/nvidia/nvjitlink/lib:$LD_LIBRARY_PATH' >> $VIRTUAL_ENV/bin/activate - -# 对于 conda 环境 -conda env config vars set LD_LIBRARY_PATH=$CONDA_PREFIX/lib/python*/site-packages/nvidia/nvjitlink/lib:$LD_LIBRARY_PATH - -# 对于全局 bashrc(根据需要调整 Python 版本) -echo 'export LD_LIBRARY_PATH=$(python -c "import site; print(site.getsitepackages()[0])")/nvidia/nvjitlink/lib:$LD_LIBRARY_PATH' >> ~/.bashrc -``` +## 命令行参数 -4. **替代方案:使用 ldconfig:** ```bash -# 检查当前库缓存 -ldconfig -p | grep cuda -ldconfig -p | grep nccl +# 使用 CPU 运行 +comfy launch --cpu -# 如果缺失,添加库路径(需要 root 权限) -sudo echo "/usr/local/cuda/lib64" > /etc/ld.so.conf.d/cuda.conf -sudo ldconfig -``` +# 使用低显存模式(将文本编码器移到 CPU) +comfy launch --lowvram -5. **调试库加载:** -```bash -# 详细库加载以查看缺失的内容 -LD_DEBUG=libs python main.py 2>&1 | grep "looking for" +# 使用中等显存模式 +comfy launch --medvram -# 检查 PyTorch CUDA 可用性 -python -c "import torch; print('CUDA available:', torch.cuda.is_available()); print('CUDA version:', torch.version.cuda)" +# 使用缓存经典模式 +comfy launch --cache-classic ``` -## 模型相关问题 +## 常见问题 -有关综合模型故障排除,包括架构不匹配、缺少模型和加载错误,请参见专门的[模型问题](/zh/troubleshooting/model-issues)页面。 + + + ComfyUI 无法启动或启动后立即崩溃。 -## 网络和 API 问题 + ```bash + # 检查 Python 和 PyTorch 是否正确安装 + python -c "import torch; print(torch.__version__); print(torch.cuda.is_available())" + ``` -### API 节点不工作 + 如果 PyTorch 报告 CUDA 不可用: + 1. 更新您的 GPU 驱动 + 2. 重新安装与您的 CUDA 版本匹配的 PyTorch + + + ### 前端问题 -**症状:** API 调用失败、超时错误、配额超出 + 如果页面显示空白,请打开开发者控制台。如果控制台显示类似 `Loading` 的内容卡住,请尝试以下方法: -**解决方案:** -1. **检查 API 密钥有效性** - 在[用户设置](/zh/interface/user)中验证密钥 -2. **检查账户积分** - 确保有足够的 [API 积分](/zh/interface/credits) -3. **验证互联网连接** - 使用其他在线服务进行测试 -4. **检查服务状态** - 提供商可能正在经历停机 + - **硬刷新**:`Ctrl + F5`(Windows)或 `Cmd + Shift + R`(Mac) + - **清空 IndexedDB** + - 打开开发者工具 → 应用(Application)→ IndexedDB → 右键 → 清空 + - **切换网络** + - 使用 `--listen 0.0.0.0` 启动 ComfyUI,将监听所有网络接口 + - 有些网络可能会阻止本地连接 -### 连接问题 + ### 防火墙 -**症状:** "无法连接到服务器"、超时错误 + - 确保您的防火墙允许连接 `127.0.0.1:8188` + - 如果您使用 `--listen 0.0.0.0`,请确保您的防火墙允许所需的端口 + + + ### 不支持的设备 -**解决方案:** -1. **检查防火墙设置** - 允许 ComfyUI 通过防火墙 -2. **尝试不同端口** - 默认是 8188,尝试 8189 或 8190 -3. **临时禁用 VPN** - VPN 可能阻止连接 -4. **检查代理设置** - 如果不需要,禁用代理 + 如果您看到"不支持的设备"错误,请更新您的显卡驱动。 -## 硬件特定问题 + ### 安装失败 -### NVIDIA GPU 问题 + 如果桌面应用安装失败,请尝试: + 1. 以管理员身份运行安装程序 + 2. 关闭杀毒软件 + 3. 确保您有足够的磁盘空间 -**CUDA 错误、GPU 未检测到:** -```bash -# 检查 CUDA 安装 -nvidia-smi + ### 维护页面 -# 验证 PyTorch CUDA 支持 -python -c "import torch; print(torch.cuda.is_available())" + 如果您看到维护页面,桌面应用正在进行自动更新。请等待更新完成。 -# 重新安装带 CUDA 的 PyTorch -pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130 -``` + ### 缺少模型 -### AMD GPU 问题 + 如果缺少模型,您可以通过桌面应用的"模型"标签下载它们。 + + + ### Intel GPU -**ROCm 支持、性能问题:** -```bash -# 安装 ROCm 版本的 PyTorch -pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm7.2 -``` - -### Apple Silicon (M1/M2/M3) 问题 + 如果您使用 Intel GPU,请确保: + - 已安装最新 Intel GPU 驱动 + - 使用正确的 PyTorch 版本:`pip install torch --index-url https://download.pytorch.org/whl/xpu` + + -**MPS 后端错误:** -```bash -# 检查 MPS 可用性 -python -c "import torch; print(torch.backends.mps.is_available())" + + 有关合作节点,请参阅[合作节点常见问题](/zh/tutorials/partner-nodes/faq)。 -# 如果 MPS 导致问题,强制使用 CPU -python main.py --force-fp16 --cpu -``` + 有关更新状态,请参阅[Comfy 状态页面](https://status.comfy.org)。 + -## 获取帮助和报告错误 - -### 报告错误之前 - -1. **检查是否是已知问题:** - - 搜索 [GitHub Issues](https://github.com/Comfy-Org/ComfyUI/issues) - - 检查 [ComfyUI 论坛](https://forum.comfy.org/) - - 查看 [Discord 讨论](https://discord.com/invite/comfyorg) - -2. **尝试基本故障排除:** - - 使用[默认工作流](/zh/get_started/first_generation)进行测试 - - 禁用所有自定义节点(参见[自定义节点故障排除](/zh/troubleshooting/custom-node-issues)) - - 检查控制台/终端中的错误消息 - -### 如何有效报告错误 - -#### 对于 ComfyUI 核心问题 -**问题提交:** [GitHub Issues](https://github.com/Comfy-Org/ComfyUI/issues) - -#### 对于桌面应用问题 -**问题提交:** [桌面 GitHub Issues](https://github.com/Comfy-Org/desktop/issues) - -#### 对于前端问题 -**问题提交:** [前端 GitHub Issues](https://github.com/Comfy-Org/ComfyUI_frontend/issues) - -#### 对于自定义节点问题 -**问题提交:** 请到对应的自定义节点仓库中提交问题 - -### 在 issue 中你需要提供的信息 - -报告任何问题时,请包括以下内容: - - - - - - - - 操作系统(Windows 11、macOS 14.1、Ubuntu 22.04 等) - - ComfyUI 版本(检查设置中的关于页面) - - Python 版本:`python --version` - - PyTorch 版本:`python -c "import torch; print(torch.__version__)"` - - GPU 型号和驱动程序版本 - - ![设置菜单-关于页面](/images/troubleshooting/menu-about.jpg) - - - - - ```bash - # 系统信息 - systeminfo | findstr /C:"OS Name" /C:"OS Version" - - # GPU 信息 - wmic path win32_VideoController get name - - # Python 和 PyTorch 信息 - python --version - python -c "import torch; print(f'PyTorch: {torch.__version__}')" - python -c "import torch; print(f'CUDA Available: {torch.cuda.is_available()}')" - ``` - - - ```bash - # 系统信息 - uname -a - - # GPU 信息(Linux) - lspci | grep VGA - - # Python 和 PyTorch 信息 - python --version - python -c "import torch; print(f'PyTorch: {torch.__version__}')" - python -c "import torch; print(f'CUDA Available: {torch.cuda.is_available()}')" - ``` - - - - - - - - - 问题的清晰描述 - - 重现问题的步骤 - - 预期行为与实际行为 - - 如果可以,提供截图或复现过程的屏幕录制 - - - - 控制台/终端的完整错误文本 - - 浏览器控制台错误(F12 → 控制台选项卡) - - 任何崩溃日志或错误对话框 - - - - 已安装的自定义节点列表 - - 重现问题的工作流文件(.json) - - 最近的更改(新安装、更新等) - - - -## 社区资源 - -- **官方论坛:** [forum.comfy.org](https://forum.comfy.org/) -- **Discord:** [ComfyUI Discord 服务器](https://discord.com/invite/comfyorg) -- **Reddit:** [r/comfyui](https://reddit.com/r/comfyui) -- **YouTube:** [ComfyUI 教程](https://www.youtube.com/@comfyorg) +## 更多帮助 - -对于影响许多用户的紧急问题,请查看我们的[状态页面](https://status.comfy.org)和[官方 Twitter](https://x.com/ComfyUI)以获取公告。 - \ No newline at end of file +如果问题仍然存在: +- 加入我们的 [Discord](https://www.comfy.org/discord) 获取社区支持 +- 搜索[ GitHub Issues ](https://github.com/Comfy-Org/ComfyUI/issues)寻找类似问题 +- 创建一个新的 GitHub Issue,附上重现步骤 diff --git a/zh/tutorials/partner-nodes/faq.mdx b/zh/tutorials/partner-nodes/faq.mdx index cdf274e7f..065c98c3e 100644 --- a/zh/tutorials/partner-nodes/faq.mdx +++ b/zh/tutorials/partner-nodes/faq.mdx @@ -1,13 +1,12 @@ --- -title: "Partner Nodes 场景问题" -description: "在使用 Partner Nodes 时你可能遇到的常见问题。" +title: "合作节点常见问题" +description: "在使用合作节点时你可能遇到的常见问题。" sidebarTitle: "常见问题" -translationSourceHash: 9533cb6b -translationFrom: tutorials/partner-nodes/faq.mdx +reviewSourceHash: 9533cb6b --- import Faq from "/snippets/zh/tutorials/partner-nodes/faq.mdx"; -本文是关于 合作伙伴节点使用的常见问题, +本文是关于合作节点使用的常见问题。 diff --git a/zh/tutorials/partner-nodes/overview.mdx b/zh/tutorials/partner-nodes/overview.mdx index f6fc6145d..6a75b5273 100644 --- a/zh/tutorials/partner-nodes/overview.mdx +++ b/zh/tutorials/partner-nodes/overview.mdx @@ -1,25 +1,24 @@ --- -title: "Partner Nodes" -description: "在本篇中我们将介绍 ComfyUI 关于 Partner Nodes 的相关说明。" +title: "合作节点" +description: "本文介绍 ComfyUI 合作节点的相关信息。" sidebarTitle: "总览" -translationSourceHash: dff896f5 -translationFrom: tutorials/partner-nodes/overview.mdx +reviewSourceHash: dff896f5 --- import Requirements from "/snippets/zh/tutorials/partner-nodes/requirements.mdx"; import Faq from "/snippets/zh/tutorials/partner-nodes/faq.mdx"; -Partner Nodes 是 ComfyUI 新增的调用闭源模型的方式,通过 API 调用,这将为 ComfyUI 用户提供访问外部最先进 AI 模型的能力,而无需复杂的 API 密钥设置。 +合作节点是 ComfyUI 新增的调用闭源模型的方式,通过 API 调用,为 ComfyUI 用户提供访问外部先进 AI 模型的能力,而无需复杂的 API 密钥设置。 -## 什么是 Partner Nodes? +## 什么是合作节点? -Partner Nodes 是一组特殊的节点,它们能够连接到外部 API 服务,让您直接在 ComfyUI 工作流中使用闭源或第三方托管的 AI 模型。这些节点设计用于无缝集成外部模型的功能,同时保持 ComfyUI 核心的开源特性。 +合作节点是一组特殊节点,能够连接到外部 API 服务,让您直接在 ComfyUI 工作流中使用闭源或第三方托管的 AI 模型。这些节点设计用于无缝集成外部模型的功能,同时保持 ComfyUI 核心的开源特性。 -## 使用 API Key 在非白名单网站登录 ComfyUI 账户来使用 Partner Nodes +## 在非白名单网站使用 API Key 登录 ComfyUI 账户 -目前我们设置有白名单来限制可以登录ComfyUI 账户的网站,如果需要在一些非白名单网站登录 ComfyUI 账户,请参考账号管理相关的部分了解如何使用 API Key 来进行登录,在这种情况下不需要对应的网站在我们的白名单中。 +目前我们设有白名单来限制可登录 ComfyUI 账户的网站。如需在非白名单网站登录 ComfyUI 账户,请参考账号管理相关章节了解如何使用 API Key 登录。此情况下无需网站在我们的白名单中。 查看如何使用 ComfyUI API Key 登录 @@ -27,44 +26,40 @@ Partner Nodes 是一组特殊的节点,它们能够连接到外部 API 服务 ![Select Comfy API Key Login](/images/interface/setting/user/user-login-api-1.jpg) +## 使用 ComfyUI 账户 API Key 集成调用付费合作节点 -## 使用 ComfyUI 账户 API Key 集成来调用付费模型 合作伙伴节点 - -目前我们支持通过 ComfyUI 账户 API Key 集成来访问我们的服务来调用付费模型 合作伙伴节点,请参考 API Key 集成章节了解如何使用 API Key 集成来调用付费模型 合作伙伴节点 +目前我们支持通过 ComfyUI 账户 API Key 集成访问我们的服务来调用付费合作节点,请参考 API Key 集成章节了解如何使用 API Key 集成调用付费合作节点。 - **重要提示:** 此处讨论的 API 密钥是您的 **ComfyUI 账户 API Key**(用于在工作流中访问付费 合作伙伴节点)。这与开发者用于将自定义节点发布到注册表的 **注册表发布 API Key** **不同**。如果您想发布自定义节点,请参阅[发布节点](/zh/registry/publishing)。 + **重要提示:** 此处讨论的 API 密钥是您的 **ComfyUI 账户 API Key**(用于在工作流中访问付费合作节点)。这与开发者用于将自定义节点发布到注册表的**注册表发布 API Key** **不同**。如需发布自定义节点,请参阅[发布节点](/zh/registry/publishing)。 -请参考 API Key 集成章节了解如何使用 API Key 集成来调用付费模型 合作伙伴节点 +请参考 API Key 集成章节了解如何使用 API Key 集成调用付费合作节点 -## Partner Nodes 的优势 +## 合作节点的优势 -Partner Nodes 为 ComfyUI 用户提供了几个重要优势: +合作节点为 ComfyUI 用户提供了几个重要优势: -- **访问闭源模型**:使用最先进的 AI 模型,无需自行部署 -- **无缝集成**:合作伙伴节点与其他 ComfyUI 节点完全兼容,可以组合创建复杂工作流 -- **简化的体验**:无需管理 API 密钥或处理复杂的 API 请求 -- **可控的成本**:预付费系统确保您完全控制支出,没有意外费用 +- **访问闭源模型**:使用先进的 AI 模型,无需自行部署 +- **无缝集成**:合作节点与其他 ComfyUI 节点完全兼容,可组合创建复杂工作流 +- **简化体验**:无需管理 API 密钥或处理复杂的 API 请求 +- **可控成本**:预付费系统确保您完全控制支出,无意外费用 -## 计费方式 +## 定价 - + 请参考定价页面了解对应的 API 定价 +## 关于开源与可选性 -![选择 Comfy API Key 登录](/images/zh/interface/setting/user/user-login-api-1.jpg) - -## 关于开源和选择加入 +需要注意的是,**合作节点完全可选**。ComfyUI 将始终保持完全开源并对本地用户免费。合作节点设计为"可选加入"功能,为希望访问外部 SOTA(最先进)模型的用户提供便利。 -重要的是要注意,**Partner Nodes 是完全可选的**。ComfyUI 将始终保持完全开源,并对本地用户免费。合作伙伴节点设计为"选择加入"功能,为那些想要访问外部 SOTA(最先进)模型的用户提供便利。 +## 如何完全禁用合作节点 -## 如何完全禁用合作伙伴节点 - -您可以添加 `--disable-api-nodes` 启动参数来禁用 ComfyUI 中的所有合作伙伴节点。此参数还将阻止前端与互联网通信。 +您可以添加 `--disable-api-nodes` 启动参数来禁用 ComfyUI 中的所有合作节点。该参数还会阻止前端与互联网通信。 **手动安装用户:** @@ -72,7 +67,7 @@ Partner Nodes 为 ComfyUI 用户提供了几个重要优势: python main.py --disable-api-nodes ``` -**便携版用户 (Windows):** +**便携版用户(Windows):** 更新您的 `run_xxx.bat` 文件: @@ -81,16 +76,15 @@ python main.py --disable-api-nodes pause ``` -## 如何使用 Partner Nodes +## 使用场景 -Partner Nodes 的一个强大应用是将外部模型的输出与本地节点结合。例如: +合作节点的一个强大应用是将外部模型的输出与本地节点结合使用。例如: -- 使用 [GPT-Image-1](/zh/tutorials/partner-nodes/openai/gpt-image-1) 生成基础图像,然后通过本地 `WanImageToVideo` 节点转换为视频 -- 结合外部生成的图像与本地的上采样或风格转换节点 +- 使用 GPT-Image-1 生成基础图像,然后使用本地的 `wan` 节点将其转换为视频 +- 将外部生成的图像与本地放大或风格迁移节点结合 - 创建混合工作流,充分利用闭源和开源模型的优势 -这种灵活性使 ComfyUI 成为真正的通用生成式 AI 入口,将各种不同的 AI 功能整合到一个统一的工作流中,带来了更多可能性 - +这种灵活性使 ComfyUI 成为真正的通用生成式 AI 界面,将各种 AI 能力集成到统一的工作流中,开辟更多可能性。 ## 常见问题 diff --git a/zh/tutorials/partner-nodes/recraft/recraft-text-to-image.mdx b/zh/tutorials/partner-nodes/recraft/recraft-text-to-image.mdx index 61a0b4794..2a23b6456 100644 --- a/zh/tutorials/partner-nodes/recraft/recraft-text-to-image.mdx +++ b/zh/tutorials/partner-nodes/recraft/recraft-text-to-image.mdx @@ -1,59 +1,58 @@ --- -title: "Recraft Text to Image 合作伙伴节点 ComfyUI 官方示例" -description: "本文将介绍如何在 ComfyUI 中使用 Recraft Text to Image 合作伙伴节点的相关功能" +title: "Recraft Text to Image 合作节点 - ComfyUI 官方示例" +description: "了解如何在 ComfyUI 中使用 Recraft Text to Image 合作节点" sidebarTitle: "Recraft Text to Image" -translationSourceHash: 89cef53b -translationFrom: tutorials/partner-nodes/recraft/recraft-text-to-image.mdx +reviewSourceHash: 89cef53b --- import ReqHint from "/snippets/zh/tutorials/partner-nodes/req-hint.mdx"; import UpdateReminder from "/snippets/zh/tutorials/update-reminder.mdx"; -[Recraft Text to Image](/zh/built-in-nodes/partner-node/image/recraft/recraft-text-to-image) 节点允许你使用Recraft AI的图像生成技术,通过文本描述创建高质量、风格多样的图像内容。 +[Recraft Text to Image](/zh/built-in-nodes/partner-node/image/recraft/recraft-text-to-image) 节点允许你使用 Recraft AI 的图像生成技术,通过文本描述创建高质量、风格多样的图像内容。 -本篇指南中,我们将引导你如何使用对应节点来进行文本到图像的工作流设置。 +在本指南中,我们将引导你使用此节点设置文本转图像工作流。 -## Recraft Text to Image 合作伙伴节点文本到图像工作流 +## Recraft Text to Image 合作节点工作流 ### 1. 工作流文件下载 -下面的图片的`metadata`中已经包含工作流信息,请下载并拖入 ComfyUI 中加载对应工作流。 +下方图片的 `metadata` 中包含工作流信息。请下载并拖入 ComfyUI 加载工作流。 -![Recraft 文本到图像工作流](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/api_nodes/recraft/t2i/recraft_t2i.png) +![Recraft 文本转图像工作流](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/api_nodes/recraft/t2i/recraft_t2i.png) -### 2. 按步骤完成工作流的运行 +### 2. 按步骤完成工作流运行 -![Recraft 文本到图像工作流步骤图](/images/tutorial/api_nodes/recraft/recraft_t2v_step_guide.jpg) +![Recraft 文本转图像工作流步骤图](/images/tutorial/api_nodes/recraft/recraft_t2v_step_guide.jpg) -你可参考图片中的序号来完成最基础的工作流运行: -1. (可选) 修改 `Color` 的 `Recraft Color RGB` 的颜色为你想要的颜色 -2. (可选) 修改 `Recraft Style` 节点来控制图像的视觉风格,如数字插画、真实照片或Logo设计等,这个分组同时提供了其它的风格节点,你可以按需启用 -3. (可选) 修改 `Recraft Text to Image` 节点中的 `prompt` 参数,你也可以通过修改`size`参数来改变 -4. 点击 `Run` 按钮,或者使用快捷键 `Ctrl(cmd) + Enter(回车)` 来执行图像的生成 -3. 等待 API 返回结果后,你可在 `Save Image` 节点中查看生成的图像,对应的图像也会被保存至 `ComfyUI/output/` 目录下 +按以下序号步骤运行基础工作流: +1. (可选) 修改 `Color` 中 `Recraft Color RGB` 的颜色 +2. (可选) 修改 `Recraft Style` 节点控制图像视觉风格,如数字插画、真实照片或 Logo 设计等。此分组还提供其他风格节点可按需启用 +3. (可选) 修改 `Recraft Text to Image` 节点中的 `prompt` 参数,也可通过 `size` 参数调整图像尺寸 +4. 点击 `Run` 按钮或使用快捷键 `Ctrl(Cmd) + Enter` 执行图像生成 +5. API 返回结果后,可在 `Save Image` 节点中查看生成的图像,图像也会保存至 `ComfyUI/output/` 目录 -> (可选) 我们在工作流中提供了 **Convert to SVG** 的分组,由于该分组中的 `Recraft Vectorize Image` 节点也会额外消耗积分,你可按需启用,将生成的图像转换成 SVG 格式 +> (可选) 我们在工作流中提供了 **Convert to SVG** 分组。由于该分组中的 `Recraft Vectorize Image` 节点会额外消耗积分,仅在需要将图像转换为 SVG 格式时启用。 ### 3. 补充说明 -- **Recraft Style**:提供多种预设风格,如真实照片、数字插画、Logo栅格等 -- **Seed 参数**:仅用于确定节点是否应重新运行,但实际生成结果与种子值无关 +- **Recraft Style**:提供多种预设风格,如真实照片、数字插画、Logo 设计等 +- **Seed 参数**:仅用于确定节点是否应重新运行,实际生成结果与种子值无关 -## 相关节点详解 +## 相关节点文档 -你可查阅下面的文档了解对应节点的详细参数设置等 +查看以下文档了解对应节点的详细参数设置: -Recraft Text to Image 合作伙伴节点说明文档 +Recraft Text to Image 合作节点说明文档 -Recraft Style - Realistic Image 合作伙伴节点说明文档 +Recraft Style - Realistic Image 合作节点说明文档 -Recraft Controls 合作伙伴节点说明文档 - +Recraft Controls 合作节点说明文档 + \ No newline at end of file diff --git a/zh/tutorials/partner-nodes/topaz/astra-2.mdx b/zh/tutorials/partner-nodes/topaz/astra-2.mdx index 30f38fa50..82c602c82 100644 --- a/zh/tutorials/partner-nodes/topaz/astra-2.mdx +++ b/zh/tutorials/partner-nodes/topaz/astra-2.mdx @@ -1,47 +1,50 @@ --- -title: "Astra 2 - 创意扩散视频放大" -description: "Astra 2 模型的用途与特点,以及在 ComfyUI 中通过 Topaz Video Enhance 使用的要点。" +title: "Astra 2 - 创意外部视频放大" +description: "Astra 2 在 ComfyUI 中对视频的作用,以及可控制细节和风格创意外部放大。" sidebarTitle: "Astra 2" -translationSourceHash: 2840b2ae -translationFrom: tutorials/partner-nodes/topaz/astra-2.mdx +reviewSourceHash: "2840b2ae" --- -import ReqHint from "/snippets/zh/tutorials/partner-nodes/req-hint.mdx"; -import UpdateReminder from "/snippets/zh/tutorials/update-reminder.mdx"; +import ReqHint from "/snippets/tutorials/partner-nodes/req-hint.mdx"; +import UpdateReminder from "/snippets/tutorials/update-reminder.mdx"; -Astra 2 是 Topaz 提供的 **创意扩散类视频放大模型**,主要服务于 **生成式 AI 产出或明显风格化** 的镜头:在保持时间与语义连贯的前提下,对画面中原本稀疏、平滑或缺乏微观结构的区域 **推断并补充合理的纹理与细节**,并可输出至 **FullHD(1080p)或 4K**。与传统偏重尺寸拉伸与锐化的放大相比,它更侧重「补信息与质感」,并可通过 **创意强度**、**锐化** 以及可选的 **描述性提示词**(概括画面氛围或质感,而非操作指令)在一定程度上收敛成片风格——适用于希望在可控偏移内提升信息量与观感层次的剪辑与成片流程。 +针对 GenAI 视频的增强创意放大,具有对细节和风格的高级控制。 + +## 什么是 Astra 2? + +**如果你是新用户:** Astra 2 针对**AI 生成和风格化视频**。普通放大大多只是放大和锐化现有像素;Astra 2 可以在源画面模糊的地方**添加合理的新细节和纹理**,使片段感觉更丰富——不仅仅是更大。 ## 模型概述 -相较 Astra 1,对细节合成与风格化过程的 **可调维度更多**。适用于 GenAI / 风格化素材、广角与人群等大场面、以及观感偏「塑料感」或偏平滑但 **需要可信纹理** 的镜头。 +它在 Astra 1 的基础上进行了升级,对细节和风格化的产生方式有更清晰的控制(创造力、锐度、可选的**描述性**提示词——而非步骤列表)。适合:风格化/AI 生成的素材、广角和稀疏细节场景,以及恢复纹理前看起来过于平滑的素材。 -## 主要能力 +## 关键能力 -- **补质感与细节** — 不仅是锐化。 -- **可调观感** — 创意、锐化、可选提示词引导。 -- **风格化 / 广角** — 适合需要推断补全信息的画面。 +- **添加纹理和细节**——不仅仅是锐化。 +- **可操控的外观**——创造力、锐度、可选的提示词引导。 +- **风格化和广角**——需要推断细节的场景。 -## 在 ComfyUI 里 +## 在 ComfyUI 中使用 -使用 **Topaz Video Enhance**。**Topaz Video Enhance (Legacy)** **没有** Astra 2。将放大模型设为 **Astra 2**,输出 **1080p** 或 **4K**,输入须为 **MP4**。 +使用 **Topaz Video Enhance**。**Topaz Video Enhance(旧版)** 不提供 **Astra 2**。将放大器设置为 **Astra 2**,分辨率设置为 **FullHD** 或 **4K**;输入必须是 **MP4**。 -填写 **Prompt** 时最多 **450** 帧(30fps 约 15 秒);留空最多 **9000** 帧。**Sharp**、**Realism** 在高级选项里。 +可选 **提示词**:最长 **450** 帧(约 30fps 下 ~15 秒)。空提示词:最长 **9000** 帧。展开高级控件可设置 **锐度(Sharp)** 和 **写实度(Realism)**。 ## 示例工作流 -**加载视频** → **Topaz Video Enhance** → **保存视频**。打开模板后若默认不是本模型,把放大模型改成 **Astra 2**。 +**加载视频** → **Topaz Video Enhance** → **保存视频**。打开模板后,如果选择了其他预设,请在放大器上选择 **Astra 2**。 - - 在 Comfy Cloud 上立即打开该工作流。 - + + 在 Comfy 云上立即打开此工作流。 + - 下载可在本地 ComfyUI 使用的 workflow JSON。 - + 下载用于本地 ComfyUI 的工作流 JSON。 + -## 相关链接 +## 相关 -- [ComfyUI 视频放大](/zh/tutorials/utility/video-upscale) — 视频放大方案选择指南。 +- [ComfyUI 视频放大](/tutorials/utility/video-scale)—选择放大方法的指南。 diff --git a/zh/tutorials/partner-nodes/tripo/model-generation.mdx b/zh/tutorials/partner-nodes/tripo/model-generation.mdx index 61d94601d..cd6d42a10 100644 --- a/zh/tutorials/partner-nodes/tripo/model-generation.mdx +++ b/zh/tutorials/partner-nodes/tripo/model-generation.mdx @@ -2,8 +2,7 @@ title: " Tripo 合作伙伴节点模型生成 ComfyUI 官方示例" description: "本文将介绍如何在 ComfyUI 中使用 Tripo 节点的 API 来进行模型生成" sidebarTitle: "模型生成" -translationSourceHash: 29fbd5dc -translationFrom: tutorials/partner-nodes/tripo/model-generation.mdx +reviewSourceHash: 29fbd5dc --- import ReqHint from "/snippets/zh/tutorials/partner-nodes/req-hint.mdx"; @@ -17,7 +16,7 @@ Tripo AI 是一家专注于生成式 AI 3D 建模的公司,它提供用户友 - 图生模型 - 多视图模型生成 - 骨骼绑定 -- 骨骼动画 +- 骨骼重定向 @@ -36,7 +35,7 @@ Tripo AI 是一家专注于生成式 AI 3D 建模的公司,它提供用户友 ![ComfyUI Tripo Text to Model Step Guide](/images/tutorial/api_nodes/tripo/tripo_text_to_model_step_guide.jpg) -你可参考图片中的序号来完成最基础的文生图工作流运行: +你可参考图片中的序号来完成基础文生模型工作流的执行: 1. 在 `Tripo: Text to Model` 节点的 `prompt` 中输入提示词 - model: 可以选择不同的模型,目前仅 v1.4 模型支持 `Tripo: Refine Draft model` 的后续优化 - style: 中可以设置不同的风格 @@ -63,14 +62,14 @@ Tripo AI 是一家专注于生成式 AI 3D 建模的公司,它提供用户友 ![ComfyUI Tripo Text to Model Step Guide](/images/tutorial/api_nodes/tripo/tripo_image_to_model_step_guide.jpg) -你可参考图片中的序号来完成最基础的文生图工作流运行: +你可参考图片中的序号来完成基础图生模型工作流的执行: 1. 在 `Load Image` 节点中加载提供的输入图片 2. 在 `Tripo: Image to Model` 节点中修改对应的参数设置 - model: 可以选择不同的模型,目前仅 v1.4 模型支持 `Tripo: Refine Draft model` 的后续优化 - style: 中可以设置不同的风格 - texture_quality: 可以设置不同的纹理质量 3. 点击 `Run` 按钮,或者使用快捷键 `Ctrl(cmd) + Enter(回车)` 来执行模型的生成,工作流完成后对应的模型会自动保存至 `ComfyUI/output/` 目录下 -4. 模型下载请参考文生图部分的说明 +4. 模型下载请参考文生模型部分的说明 ## 多视图模型生成工作流 @@ -93,7 +92,7 @@ Tripo AI 是一家专注于生成式 AI 3D 建模的公司,它提供用户友 ![ComfyUI Tripo Text to Model Step Guide](/images/tutorial/api_nodes/tripo/tripo_multiview_to_model_step_guide.jpg) -你可参考图片中的序号来完成最基础的文生图工作流运行: +你可参考图片中的序号来完成基础多视图模型生成工作流的执行: 1. 在 `Load Image` 节点中分别加载提供的输入图片 2. 在 `Tripo: Image to Model` 节点中修改对应的参数设置 - model: 可以选择不同的模型,目前仅 v1.4 模型支持 `Tripo: Refine Draft model` 的后续优化 @@ -101,7 +100,7 @@ Tripo AI 是一家专注于生成式 AI 3D 建模的公司,它提供用户友 - texture_quality: 可以设置不同的纹理质量 3. 点击 `Run` 按钮,或者使用快捷键 `Ctrl(cmd) + Enter(回车)` 来执行模型的生成,工作流完成后对应的模型会自动保存至 `ComfyUI/output/` 目录下 4. 其它视图输入可以参考步骤图中的示意将对应节点的模式设置为 `总是(always)` 来启用 -5. 模型下载请参考文生图部分的说明 +5. 模型下载请参考文生模型部分的说明 ## 对应任务的后续任务处理 diff --git a/zh/tutorials/video/ltxv.mdx b/zh/tutorials/video/ltxv.mdx index 93520d5a3..4971bc13d 100644 --- a/zh/tutorials/video/ltxv.mdx +++ b/zh/tutorials/video/ltxv.mdx @@ -2,44 +2,55 @@ title: "LTX-0.9.5 ComfyUI 工作流示例" sidebarTitle: "LTX-0.9.5" description: "学习如何在 ComfyUI 中使用 LTX-Video 0.9.5 高效生成视频" -translationSourceHash: 7d8a0192 -translationFrom: tutorials/video/ltxv.mdx +reviewSourceHash: 7d8a0192 --- import UpdateReminder from '/snippets/zh/tutorials/update-reminder.mdx' - -将任意视频直接拖入 ComfyUI 即可开始使用 - - -## 快速入门 - -[LTX-Video](https://huggingface.co/Lightricks/LTX-Video) 是 Lightricks 开发的高效视频生成模型。 - -使用该模型的关键是提供详细的长描述提示词。 - -请下载 [ltx-video-2b-v0.9.5.safetensors](https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltx-video-2b-v0.9.5.safetensors?download=true) 文件并放入 `ComfyUI/models/checkpoints` 目录。 - -若尚未下载 [t5xxl_fp16.safetensors](https://huggingface.co/Comfy-Org/mochi_preview_repackaged/resolve/main/split_files/text_encoders/t5xxl_fp16.safetensors?download=true) 文件,请将其放入 `ComfyUI/models/text_encoders` 目录。 - ## 多帧控制 通过系列图像控制视频生成。可下载输入图像:[起始帧](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/ltxv/multi-frame/house1.png) 和 [结束帧](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/ltxv/multi-frame/house2.png)。 -LTX-Video 多帧控制工作流 +LTX-Video 多帧控制 + + +将任意视频直接拖入 ComfyUI 即可运行工作流。 + -## 图生视频 +## 图像转视频 -通过首帧图像控制视频生成:[示例首帧](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/ltxv/i2v/girl1.png)。 +通过首帧[图像](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/ltxv/i2v/girl1.png)控制视频生成。

Run on Comfy Cloud

-LTX-Video 图生视频工作流 +LTX-Video 图像转视频 + + +将任意视频直接拖入 ComfyUI 即可运行工作流。 + + +## 文本转视频 + +LTX-Video 文本转视频 + + +将任意视频直接拖入 ComfyUI 即可运行工作流。 + + +## 要求 + +下载以下模型并按指定位置放置: -## 文生视频 +- [ltx-video-2b-v0.9.5.safetensors](https://huggingface.co/Lightricks/LTX-Video/resolve/main/ltx-video-2b-v0.9.5.safetensors?download=true) +- [t5xxl_fp16.safetensors](https://huggingface.co/Comfy-Org/mochi_preview_repackaged/resolve/main/split_files/text_encoders/t5xxl_fp16.safetensors?download=true) -LTX-Video 文生视频工作流 +``` +├── checkpoints/ +│ └── ltx-video-2b-v0.9.5.safetensors +└── text_encoders/ + └── t5xxl_fp16.safetensors +``` diff --git a/zh/tutorials/video/wan/fun-inp.mdx b/zh/tutorials/video/wan/fun-inp.mdx index 4f29d3091..a176c8ee5 100644 --- a/zh/tutorials/video/wan/fun-inp.mdx +++ b/zh/tutorials/video/wan/fun-inp.mdx @@ -2,8 +2,7 @@ title: "ComfyUI Wan2.1 Fun InP 视频示例" description: "本文介绍了如何在 ComfyUI 中完成 Wan2.1 Fun InP 视频首尾帧视频生成示例" sidebarTitle: "Wan2.1 Fun InP" -translationSourceHash: c6685a1c -translationFrom: tutorials/video/wan/fun-inp.mdx +reviewSourceHash: c6685a1c --- import UpdateReminder from '/snippets/zh/tutorials/update-reminder.mdx' @@ -33,7 +32,7 @@ Wan-Fun InP 是阿里巴巴推出的开源视频生成模型,属于 ​​Wan2 目前 ComfyUI 已原生支持了 Wan2.1 Fun InP 模型,在开始本篇教程前,请更新你的 ComfyUI 保证你的版本在[这个提交](https://github.com/Comfy-Org/ComfyUI/commit/0a1f8869c9998bbfcfeb2e97aa96a6d3e0a2b5df)版本之后 -## Wan2.1 Fun Control 工作流 +## Wan2.1 Fun InP 工作流 下载下面的图片,并拖入 ComfyUI 中以加载对应的工作流 @@ -77,14 +76,14 @@ Wan-Fun InP 是阿里巴巴推出的开源视频生成模型,属于 ​​Wan2 ### 3. 按步骤完成工作流 -![ComfyUI Wan2.1 Fun Control 视频生成工作流步骤图](/images/tutorial/video/wan/fun_inp_flow_diagram.png) +![ComfyUI Wan2.1 Fun InP 视频生成工作流步骤图](/images/tutorial/video/wan/fun_inp_flow_diagram.png) 1. 确保 `Load Diffusion Model` 节点加载了 `wan2.1_fun_inp_1.3B_bf16.safetensors` 2. 确保 `Load CLIP` 节点加载了 `umt5_xxl_fp8_e4m3fn_scaled.safetensors` 3. 确保 `Load VAE` 节点加载了 `wan_2.1_vae.safetensors` 4. 确保 `Load CLIP Vision` 节点加载了 `clip_vision_h.safetensors ` 5. 在 `Load Image` 节点(已被重命名为`Start_image`) 上传起始帧 -6. 在第二个 `Load Image` 节点上传用于控制视频。注意: 目前这个节点还不支持 mp4 只能使用 Webp 视频 +6. 在第二个 `Load Image` 节点上传结束帧 7. (可选)修改 Prompt 使用中英文都可以 8. (可选)在 `WanFunInpaintToVideo` 修改对应视频的尺寸,不要使用过大的尺寸 9. 点击 `Run` 按钮,或者使用快捷键 `Ctrl(cmd) + Enter(回车)` 来执行视频生成 diff --git a/zh/tutorials/video/wan/wan2-2-animate.mdx b/zh/tutorials/video/wan/wan2-2-animate.mdx index 58b0f21e2..9abfd7de7 100644 --- a/zh/tutorials/video/wan/wan2-2-animate.mdx +++ b/zh/tutorials/video/wan/wan2-2-animate.mdx @@ -2,8 +2,7 @@ title: "Wan2.2 Animate ComfyUI 原生工作流" description: "统一的人物动画和替换框架,具有精确的运动和表情复制。" sidebarTitle: "Wan2.2 Animate" -translationSourceHash: 46cb9d1b -translationFrom: tutorials/video/wan/wan2-2-animate.mdx +reviewSourceHash: 46cb9d1b --- import UpdateReminder from '/snippets/zh/tutorials/update-reminder.mdx' @@ -15,7 +14,7 @@ Wan-Animate 是由 WAN 团队开发的一个统一的人物动画和替换框架 ## 模型亮点 -- 双模式功能:单一架构支持动画和角色替换功能 +- 双模式功能:单一架构同时支持动画和替换功能,便于操作切换。 - 高级身体运动控制:使用空间对齐的骨架信号来精确复制身体动作。 - 精确的运动和表情:准确重现参考视频中的动作和面部表情。 - 自然的环境集成:将替换的角色与原始视频环境无缝融合。 @@ -34,82 +33,75 @@ Wan-Animate 是由 WAN 团队开发的一个统一的人物动画和替换框架 -## Wan2.2 Animate ComfyUI 原生工作流 +## About Wan2.2 Animate workflow -### 1. 下载工作流文件 +本文档将提供两个工作流: -下载以下工作流文件并将其拖入 ComfyUI 以加载工作流。 +1. 仅使用核心节点的工作流(不完整,需要先自行预处理图像) +2. 包含一些自定义节点的工作流(完整,可直接使用,但部分新用户可能不知道如何安装自定义节点) - -

下载工作流

-
+### 1. 下载工作流文件 - -

在 Comfy Cloud 上运行

+
+

下载核心节点工作流

-下载以下素材作为输入: + +

下载包含自定义节点的工作流

+
-**参考图像:** -![Reference_Image](https://raw.githubusercontent.com/Comfy-Org/example_workflows/refs/heads/main/video/wan/wan2.2_animate/ref_image.png) + +

在 Comfy 云上运行

+
-**输入视频** - +### 2. 模型下载 -### 2. 模型链接 +**Diffusion Models** +- [wan2.2_i2v_14B_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/diffusion_models/wan2.2_i2v_14B_fp8_scaled.safetensors) -**diffusion_models** -- [Wan2_2-Animate-14B_fp8_e4m3fn_scaled_KJ.safetensors](https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/main/Wan22Animate/Wan2_2-Animate-14B_fp8_e4m3fn_scaled_KJ.safetensors) 这是来自 Kijai 仓库的模型 -- [wan2.2_animate_14B_bf16.safetensors](https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/diffusion_models/wan2.2_animate_14B_bf16.safetensors) 原始模型权重 +**Text Encoder** +- [umt5_xxl_fp8_e4m3fn_scaled.safetensors](https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors) **clip_visions** - [clip_vision_h.safetensors](https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/clip_vision/clip_vision_h.safetensors) **loras** - [lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors](https://huggingface.co/Kijai/WanVideo_comfy/resolve/main/Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors) 这是一个 4 步的加速 lora -- [] + **vae** - [wan_2.1_vae.safetensors](https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors) -**text_encoders** -- [umt5_xxl_fp8_e4m3fn_scaled.safetensors](https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors) - ``` ComfyUI/ ├───📂 models/ │ ├───📂 diffusion_models/ -│ │ ├─── Wan2_2-Animate-14B_fp8_e4m3fn_scaled_KJ.safetensors -│ │ └─── wan2.2_animate_14B_bf16.safetensors -│ ├───📂 loras/ -│ │ └─── lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors +│ │ └─── wan2.2_i2v_14B_fp8_scaled.safetensors │ ├───📂 text_encoders/ -│ │ └─── umt5_xxl_fp8_e4m3fn_scaled.safetensors -│ ├───📂 clip_visions/ +│ │ └─── umt5_xxl_fp8_e4m3fn_scaled.safetensors +│ ├───📂 clip_vision/ │ │ └─── clip_vision_h.safetensors +│ ├───📂 loras/ +│ │ └─── lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors │ └───📂 vae/ │ └── wan_2.1_vae.safetensors ``` ### 3. 安装自定义节点 -下载以下工作流文件并将其拖入 ComfyUI 以加载工作流,如果你已安装 [ComfyUI-Manager](https://github.com/Comfy-Org/ComfyUI-Manager),你可以直接点击 `Install missing nodes` 按钮来安装缺失的节点。 +下载下方工作流文件并拖入 ComfyUI 加载。如果你已安装 [ComfyUI-Manager](https://github.com/Comfy-Org/ComfyUI-Manager),点击 `Install missing nodes` 按钮即可安装缺失节点。 -我们需要安装以下自定义节点: +需要安装以下自定义节点: - [ComfyUI-KJNodes](https://github.com/kijai/ComfyUI-KJNodes) - [ComfyUI-comfyui_controlnet_aux](https://github.com/Fannovel16/comfyui_controlnet_aux) -如果你不知道如何安装自定义节点,请参阅 [如何安装自定义节点](/zh/installation/install_custom_node) +如果不知道如何安装自定义节点,请参考[如何安装自定义节点](/zh/installation/install_custom_node) ### 4. 工作流说明 Wan2.2 animate 有两种模式:Mix 和 Move - Mix:使用参考图像中的角色替换视频中的角色 -- Move:使用输入视频中的角色动作和表情控制使参考图像进行类似的动作或表情(类似于 Wan2.2 Fun Control) +- Move:使用输入视频中的角色动作使参考图像中的角色进行类似的动作(类似于 Wan2.2 Fun Control) #### 4.1 Mix 模式 @@ -123,15 +115,3 @@ Wan2.2 animate 有两种模式:Mix 和 Move 5. `Points Editor` 来自 [KJNodes](https://github.com/kijai/ComfyUI-KJNodes/),默认情况下此节点不会加载输入视频的第一帧,你需要运行一次工作流或手动上传第一帧 - 在 `Points Editor` 节点下方,我们添加了关于此节点如何工作以及如何编辑的说明,请参阅它 6. 对于 "Video Extend" 组,它是为了扩展输出视频长度 - - 每个 `Video Extend` 将扩展另外 77 帧(约 4.8125 秒) - - 如果你的输入视频少于 5 秒,你可能不需要它 - - 如果你想扩展更长的时间,你需要多次复制和粘贴,你需要将上一个 Video Extend 的 `batch_images` 链接到下一个,同时将上一个 Video Extend 的 `video_frame_offset` 链接到下一个 -7. 点击 `Run` 按钮或使用快捷键 `Ctrl(cmd) + Enter` 来执行视频生成 - -#### 4.2 Move 模式 - -我们在 Wan2.2 animate 工作流中使用了 [子图](/zh/interface/features/subgraph),以下是切换到 Move 模式的方法: - -![Subgraph](/images/tutorial/video/wan/wan2_2/wan2.2_animate_subgraph.jpg) - -如果你想切换到 Move 模式,可以从 `Video Sampling and output(Subgraph)` 节点断开 `background_video` 和 `character_mask` 输入。 \ No newline at end of file diff --git a/zh/tutorials/video/wan/wan2-2-fun-inp.mdx b/zh/tutorials/video/wan/wan2-2-fun-inp.mdx index 838a0972c..ff4d7140a 100644 --- a/zh/tutorials/video/wan/wan2-2-fun-inp.mdx +++ b/zh/tutorials/video/wan/wan2-2-fun-inp.mdx @@ -2,34 +2,16 @@ title: "ComfyUI Wan2.2 Fun Inp 首尾帧视频生成示例" description: "本文介绍了如何在 ComfyUI 中完成 Wan2.2 Fun Inp 首尾帧视频生成示例" sidebarTitle: "Wan2.2 Fun Inp" -translationSourceHash: 6914cd26 -translationFrom: tutorials/video/wan/wan2-2-fun-inp.mdx +reviewSourceHash: 6914cd26 --- import UpdateReminder from '/snippets/zh/tutorials/update-reminder.mdx' -**Wan2.2-Fun-Inp** 是 Alibaba pai团队推出的首尾帧控制视频生成模型,支持输入**首帧和尾帧图像**,生成中间过渡视频,为创作者带来更强的创意控制力。该模型采用 **Apache 2.0 许可协议**发布,支持商业使用。 - -**核心功能**: -- **首尾帧控制**:支持输入首帧和尾帧图像,生成中间过渡视频,提升视频连贯性与创意自由度 -- **高质量视频生成**:基于 Wan2.2 架构,输出影视级质量视频 -- **多分辨率支持**:支持生成512×512、768×768、1024×1024等分辨率的视频,适配不同场景需求 - -**模型版本**: -- **14B 高性能版**:模型体积达 32GB+,效果更优但需高显存支持 - -下面是相关模型权重和代码仓库: - -- [🤗Wan2.2-Fun-Inp-14B](https://huggingface.co/alibaba-pai/Wan2.2-Fun-A14B-InP) -- 代码仓库:[VideoX-Fun](https://github.com/aigc-apps/VideoX-Fun) - -## ComfyOrg Wan2.2 Fun InP & Control Youtube 直播回放 - -对于 ComfyUI Wan2.2 的使用,我们有进行了直播,你可以查看这些回放了解如何使用 +**Wan2.2-Fun-Inp** 是阿里巴巴 PAI 团队推出的首尾帧控制视频生成模型,支持输入**起始帧和结束帧图像**以生成中间过渡视频,为创作者提供更大的创意控制。该模型采用 **Apache 2.0 许可证**,支持商业使用。