Xpersona
C

ComfyUI Client

CLAWHUB · Unverified

此技能应在用户需要通过 ComfyUI 生成图片或视频时使用。支持加载工作流、修改 prompt、提交任务、轮询结果并自动下载生成的图片和视频。需 ComfyUI 服务已启动。 Skill: ComfyUI Client Owner: imjszhang Summary: 此技能应在用户需要通过 ComfyUI 生成图片或视频时使用。支持加载工作流、修改 prompt、提交任务、轮询结果并自动下载生成的图片和视频。需 ComfyUI 服务已启动。 Tags: latest:1.2.0 Version history: v1.2.0 | 2026-04-01T18:05:23.924Z | auto js-comfyui-client v1.2.0 - Major update: Improved support for ComfyUI image and video generation workflows, bundled with common workflows and enhanced prompt/image node handling. - Provides commands to load

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s178deygezkand2ppdrw966d7s840msf:js-comfyui-client
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-imjszhang-js-comfyui-client/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

142,010 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: comfyui-client
description: 此技能应在用户需要通过 ComfyUI 生成图片或视频时使用。支持加载工作流、修改 prompt、提交任务、轮询结果并自动下载生成的图片和视频。需 ComfyUI 服务已启动。
version: 1.2.0
author: agent-js
---

# ComfyUI 工作流客户端

## 概述

本技能封装了 ComfyUI 工作流调用能力,用于通过 ComfyUI API 生成图片和视频。核心功能包括:加载工作流 JSON、修改 prompt 和图片节点、提交到 ComfyUI 队列、轮询任务状态、自动下载生成结果。

**适用场景:**
- 用户要求根据文本描述生成图片
- 用户要求根据参考图生成变体或编辑
- 用户要求生成图片转视频、图生视频
- 需要批量或自动化调用 ComfyUI 工作流

**前置条件:**
- ComfyUI 服务已启动(默认 `http://127.0.0.1:8188`)
- 工作流 JSON 文件可用
- 工作流所需模型已安装到 ComfyUI

## 触发条件

当满足以下条件时应使用此技能:

1. **用户表达生成意图**
   - 要求"用 ComfyUI 生成图片"、"根据 prompt 画图"
   - 要求"图生图"、"图片编辑"、"生成视频"
   - 提供文本描述并希望得到 AI 生成的图像

2. **技术上下文明确**
   - 用户提到 ComfyUI、工作流、txt2img、img2img 等
   - 用户提供工作流文件路径或项目内已知工作流

3. **服务可用**
   - 可先检查 ComfyUI 服务是否可访问
   - 若不可用,应提示用户启动 ComfyUI

## 捆绑资源

**脚本:** `scripts/comfyUIClient.js` - ComfyUI 工作流调用主脚本

**工作流:** `assets/workflows/` - 5 个常用工作流(Z-Image、Qwen 编辑、Wan 视频等)

**执行方式:**
- 技能内脚本:`node .claude/skills/comfyui-client/scripts/comfyUIClient.js [选项]`
- 项目脚本(等效):`node scripts/comfyUIClient.js [选项]`

**路径解析:** 技能内脚本会自动解析项目根目录,工作流路径和输出目录支持相对路径(相对于项目根)。

## 核心能力

### 1. 文生图(txt2img)

使用文本 prompt 生成图片。

**基本用法:**
```bash
node scripts/comfyUIClient.js --workflow <工作流路径> --prompt "<提示词>"
```

**示例:**
```bash
# 使用技能内工作流(推荐)
node .claude/skills/comfyui-client/scripts/comfyUIClient.js \
  --workflow .claude/skills/comfyui-client/assets/workflows/image_z_image_turbo.json \
  --prompt "a beautiful landscape at sunset"

# 带负面提示词
node .claude/skills/comfyui-client/scripts/comfyUIClient.js \
  --workflow .claude/skills/comfyui-client/assets/workflows/image_z_image_turbo.json \
  --prompt "a beautiful landscape at sunset" \
  --negative-prompt "blurry, low quality, watermark"
```

**自动查找 prompt 节点:** 若不指定 `--prompt-node`,脚本会自动查找工作流中标题含 "Positive" 的 `CLIPTextEncode` 节点注入正面 prompt,标题含 "Negative" 的节点用于负面 prompt。对于 `TextEncodeQwenImageEditPlus`,优先选择有非空文本或标题含 "Positive" 的节点。

### 2. 指定 prompt 节点

当工作流中有多个 CLIPTextEncode 节点时,可指定要修改的节点 ID。

```bash
node scripts/comfyUIClient.js --workflow <工作流路径> --prompt-node "45" --prompt "新的提示词"
```

### 3. 图生图 / 图片编辑(img2img)

需要提供输入图片。可使用 `--image-path` 指定本地路径(自动上传到 ComfyUI),或先将图片放入 ComfyUI 的 `input/` 目录后使用 `--image-file` 指定文件名。

#### 3a. Z-Image Turbo + ControlNet(结构引导重绘)

基于 Canny 边缘检测提取输入图片轮廓,用 ControlNet 引导模型生成新图。适合风格转换、基于轮廓的重绘。

- **输入**:1 张图片 + 文本 prompt
- **速度**:快(9 步,CFG=1)
- **LoadImage 节点 ID**:`58`
- **Prompt 节点**:自动查找(子图内部 CLIPTextEncode 会被展开到顶层)

```bash
# 使用 --image-path 自动上传本地图片(推荐)
node .claude/skills/comfyui-client/scripts/comfyUIClient.js \
  --workflow .claude/skills/comfyui-client/assets/workflows/image_z_image_turbo_fun_union_controlnet.json \
  --prompt "oil painting style, vibrant colors" \
  --image-node 58 --image-path "path/to/input_photo.png"

# 或使用已上传到 ComfyUI input/ 的图片
node .claude/skills/comfyui-client/scripts/comfyUIClient.js \
  --workflow .claude/skills/comfyui-client/as

README.md

# js-comfyui-skill

通过 ComfyUI HTTP API 调用工作流:加载 JSON、修改 prompt / 参考图、提交队列、轮询并在本地保存生成的图片或视频。可作为独立仓库使用,也可放入 `.claude/skills/comfyui-client/` 供 Agent 技能引用。

## 前置条件

- [Node.js](https://nodejs.org/) 18+
- 已启动的 [ComfyUI](https://github.com/comfyanonymous/ComfyUI)(默认 `http://127.0.0.1:8188`)
- 工作流依赖的模型已安装到对应 ComfyUI

## 快速开始

```bash
git clone https://github.com/imjszhang/js-comfyui-skill.git
cd js-comfyui-skill
npm install
```

若已在本地有副本,直接进入目录执行 `npm install` 即可。

可选:复制环境变量模板并修改服务端地址(与命令行 `--server` 等价)。

```bash
cp .env.example .env   # Windows 可复制 .env.example 并重命名为 .env
```

## 使用示例

在项目根目录执行(工作流路径相对仓库根):

```bash
node scripts/comfyUIClient.js \
  --workflow assets/workflows/image_z_image_turbo.json \
  --prompt "a beautiful landscape at sunset"
```

查看全部选项:

```bash
node scripts/comfyUIClient.js --help
# 或
npm run comfyui -- --help
```

## 目录说明

| 路径 | 说明 |
|------|------|
| `scripts/comfyUIClient.js` | 主脚本 |
| `assets/workflows/` | 内置示例工作流(Z-Image、Qwen 编辑、Wan 视频等) |
| `SKILL.md` | 面向 Agent 的完整技能说明(能力、节点 ID、排错等) |
| `references/workflow_paths.md` | 工作流路径速查 |

默认输出目录:`work_dir/comfyui_output/<会话名>/`(已在 `.gitignore` 中忽略,勿提交)。

## 许可证

MIT

_meta.json

{
  "ownerId": "kn70g9r4pqpqeckej65c2fznk981vvq3",
  "slug": "js-comfyui-client",
  "version": "1.2.0",
  "publishedAt": 1775066723924
}

references/workflow_paths.md

# ComfyUI 工作流路径参考

本文档列出技能内及项目内可用的 ComfyUI 工作流文件路径,供技能调用时参考。

## 技能内工作流(assets/workflows,推荐)

本技能在 `assets/workflows/` 目录下捆绑了常用工作流,优先使用:

| 工作流类型 | 路径 | 说明 |
|-----------|------|------|
| Z-Image 文生图 | `.claude/skills/comfyui-client/assets/workflows/image_z_image.json` | Z-Image 高质量文生图,25 步出图(推荐 30-50 步) |
| Z-Image Turbo + ControlNet | `.claude/skills/comfyui-client/assets/workflows/image_z_image_turbo_fun_union_controlnet.json` | 文生图 + Fun Union ControlNet 控制 |
| Qwen 图片编辑 | `.claude/skills/comfyui-client/assets/workflows/image_qwen_image_edit_2511.json` | Qwen-Image-Edit 2511 图片编辑 |
| Wan 2.2 图生视频 | `.claude/skills/comfyui-client/assets/workflows/video_wan2_2_14B_i2v.json` | Wan 2.2 14B 单图生成视频 |
| Wan 2.2 首尾帧视频 | `.claude/skills/comfyui-client/assets/workflows/video_wan2_2_14B_flf2v.json` | Wan 2.2 14B 首尾帧生成视频 |

## 其他工作流(项目内)

| 工作流类型 | 路径 | 说明 |
|-----------|------|------|
| 文生图 (txt2img) | `scripts/githubToXPost/workflows/txt2img.json` | githubToXPost 基础文生图 |
| 图片编辑 | `scripts/githubToXPost/workflows/img_edit.json` | 图片编辑工作流 |
| ControlNet 图生图 | `scripts/githubToXPost/workflows/controlnet.json` | 使用 ControlNet 的图生图 |
| 图生视频 | `scripts/githubToXPost/workflows/img2video.json` | 单图生成视频 |
| 首尾帧视频 | `scripts/githubToXPost/workflows/flf2video.json` | 首尾帧生成视频 |
| Z-Image | `local-model-server/workflows/image_z_image_turbo.json` | local-model-server 版本(待更新) |
| 常用工作流(源) | `scripts/comfyui_workflows/` | 与技能 assets 同源,可作备份参考 |

## 路径使用说明

- 所有路径相对于**项目根目录**
- 技能内脚本会自动将相对路径解析为绝对路径
- 工作流文件需包含 ComfyUI 完整格式(nodes、links)或 API 格式

## 模型依赖

各工作流可能依赖不同的模型文件,需预先下载到 ComfyUI 的 `models/` 目录。工作流内的 MarkdownNote 节点通常包含模型下载链接说明。

skill-card.md

## Description:

ComfyUI Client helps agents use a running ComfyUI server to load image or video workflows, update prompts and image inputs, submit jobs, poll status, and download generated outputs.

This skill is ready for commercial/non-commercial use.

## Publisher:

[imjszhang](https://clawhub.ai/user/imjszhang)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agent users use this skill to automate ComfyUI image generation, image editing, and image-to-video workflows from text prompts and local or reference images. It is suited for environments where ComfyUI and the workflow-required models are already installed.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: A malicious or untrusted ComfyUI server could provide output filenames that write downloaded files outside the intended output directory.

Mitigation: Use a trusted local ComfyUI endpoint where possible and review downloaded output paths before relying on generated files.

Risk: Changing --server or COMFYUI_SERVER_URL to an untrusted host can expose workflow prompts, image inputs, and generated outputs to that host.

Mitigation: Keep the server URL pointed at a trusted ComfyUI instance and avoid sending sensitive inputs to remote or unknown endpoints.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/imjszhang/skills/js-comfyui-client)
- [Publisher profile](https://clawhub.ai/user/imjszhang)
- [Workflow path reference](artifact/references/workflow_paths.md)
- [ComfyUI](https://github.com/comfyanonymous/ComfyUI)
- [ComfyUI subgraph documentation](https://docs.comfy.org/interface/features/subgraph)
- [Node.js](https://nodejs.org/)

## Skill Output:

**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with shell commands and local file outputs from ComfyUI runs]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Generates session folders containing workflow, result, error, image, and video files when the ComfyUI client is executed.]

## Skill Version(s):

1.2.0 (source: server release evidence, SKILL.md frontmatter, package.json)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to ComfyUI Client and adjacent AI workflows.