← 返回 Skills 市场
wjy520crl

Comfyui

作者 wjy520crl · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ⚠ suspicious
674
总下载
1
收藏
5
当前安装
1
版本数
在 OpenClaw 中安装
/install comfyui-pro
功能描述
ComfyUI 本地图像生成专业版 - 文生图/图生图/ControlNet ✨ 自动服务器管理 | WebSocket 实时进度 | 飞书静默发送 ✨ 空闲 30 分钟自动关闭 | 显存监控 | 多工作流支持 触发词:生成图片、画图、绘制、AI 绘画、文生图、图生图
使用说明 (SKILL.md)

ComfyUI 图像生成专业版 🜃

机械之神专用绘图系统 v2.0 - 整合 ClawHub 优秀技能优点


🚀 核心特性

✨ 独特优势

功能 本技能 ClawHub 其他技能
自动启停服务器 ✅ 30 分钟空闲关闭 ❌ 大部分无
WebSocket 实时进度 ✅ 显示生成进度 ⚠️ 部分支持
飞书静默发送 ✅ 成功无回复 ✅ 仅个别
多工作流支持 ✅ 3 种工作流 ⚠️ 单一
GPU 显存监控 ✅ 实时监控
对话式触发 ✅ 自然语言 ⚠️ 需命令

📦 集成功能

  1. 自动服务器管理

    • 检测到生图请求 → 自动启动
    • 生成完成 → 记录使用时间
    • 空闲 30 分钟 → 自动关闭
  2. WebSocket 实时进度

    • 连接 ComfyUI WebSocket
    • 实时显示生成进度
    • 更可靠的任务跟踪
  3. 飞书静默发送

    • 成功发送图片 → 无回复文字
    • 失败/异常 → 明确错误提示
    • 保持界面简洁
  4. 多工作流支持

    • 文生图 (text-to-image)
    • 图生图 (image-to-image)
    • ControlNet (controlnet)

📋 使用方式

对话触发(推荐)

生成一张图片:美丽的山水风景,写实风格,8K 高清
画一个赛博朋克城市夜景,霓虹灯,未来感
用 ControlNet 处理这张线稿:[上传图片]
提示词:彩色渲染,奇幻风格

命令行使用

# WebSocket 版本(推荐,显示进度)
python scripts/comfyui_websocket.py "美丽的日落"

# 基础版本
python scripts/comfyui_generate.py "赛博朋克城市"

# 服务管理
python scripts/comfyui_service.py status
python scripts/comfyui_service.py start
python scripts/comfyui_service.py stop

主入口(自动选择)

# 自动管理(推荐)
python comfyui.py "美丽的山水"

# 查看状态
python comfyui.py --service status

⚙️ 配置参数

服务器配置

COMFYUI_HOST = "127.0.0.1"
COMFYUI_PORT = 8000  # 桌面版端口
AUTO_STOP_MINUTES = 30  # 空闲关闭时间

默认生成参数

参数 默认值 说明
尺寸 1024×1024 可自定义
步数 4 Z-Image-Turbo 快速
CFG 1.0 低 CFG 高自由度
种子 随机 -1 为随机

🔧 技能实现

核心流程

def on_call_skill(prompt, context):
    """
    1. 检查服务器状态 → 未运行则自动启动
    2. WebSocket 连接 → 提交任务
    3. 实时进度显示 → 等待完成
    4. 下载图片 → 保存到输出目录
    5. 飞书发送 → 成功静默 (NO_REPLY)
    """
    # 1. 确保服务器运行
    if not check_server():
        start_server()  # 自动启动
    
    # 2. WebSocket 生成
    images = run_workflow_websocket(prompt)
    
    # 3. 识别发送目标
    target = get_feishu_target(context)
    
    # 4. 发送图片
    if images:
        message.send(
            channel="feishu",
            target=target,
            message=f"🎨 {prompt}",
            path=images[0]
        )
        return "NO_REPLY"  # 静默
    else:
        return "❌ 生成失败"

WebSocket 进度

ws = websocket.WebSocket()
ws.connect(f"ws://{HOST}:{PORT}/ws?clientId={ID}")

while True:
    msg = ws.recv()
    if msg['type'] == 'progress':
        log(f"进度:{value}/{max}")
    elif msg['type'] == 'executing' and node is None:
        break  # 完成

📁 文件结构

skills/comfyui/
├── comfyui.py                    # 主入口(自动管理)
├── skill-config.json             # 配置
├── SKILL.md                      # 本文件
├── README.md                     # 使用文档
├── config.py                     # 路径配置
├── scripts/
│   ├── comfyui_service.py        # 服务管理
│   ├── comfyui_generate.py       # HTTP 版本生成
│   ├── comfyui_websocket.py      # WebSocket 版本 ⭐
│   └── test_connection.py        # 连接测试
└── assets/
    ├── text-to-image.json        # 文生图
    ├── image-to-image.json       # 图生图
    └── controlnet.json           # ControlNet

🎯 预设工作流

文生图

{
  "workflow": "text-to-image",
  "prompt": "用户输入",
  "width": 1024,
  "height": 1024,
  "steps": 4,
  "cfg": 1.0
}

图生图

{
  "workflow": "image-to-image",
  "input_image": "用户上传",
  "prompt": "修改要求",
  "denoise": 0.7
}

ControlNet

{
  "workflow": "controlnet",
  "control_image": "线稿/深度图",
  "prompt": "描述",
  "strength": 1.0
}

⚠️ 注意事项

依赖

  • ComfyUI 桌面版 - 必须安装并可用
  • websocket-client - WebSocket 支持
    pip install websocket-client
    

资源管理

  1. 自动启动 - 仅在需要时启动
  2. 空闲关闭 - 30 分钟无操作自动关闭
  3. 显存监控 - 生成前检查可用显存

错误处理

错误 原因 解决
连接失败 服务器未启动 自动启动或手动运行 start
WebSocket 断开 网络问题 重试或检查防火墙
显存不足 GPU 显存不够 降低分辨率
生成超时 复杂工作流 增加超时或简化

📊 性能参考

分辨率 步数 RTX 3060 时间
512×512 4 ~5 秒
1024×1024 4 ~15 秒
1920×1080 4 ~25 秒

🔄 更新日志

v2.0.0-pro (2026-03-15)

  • ✅ 整合 ClawHub 优秀技能优点
  • ✅ WebSocket 实时进度显示
  • ✅ 飞书静默发送支持
  • ✅ 自动服务器启停管理
  • ✅ GPU 显存实时监控
  • ✅ 多工作流支持 (3 种)

v1.0.0 (2026-03-15)

  • ✅ 初始版本
  • ✅ 基础 HTTP 生成
  • ✅ 服务管理脚本

🌟 致谢

参考了 ClawHub 上的优秀技能:

  • openclaw-comfyui-imagegenerate - WebSocket 实现、飞书静默
  • comfyui (kelvincai522) - pget 下载、简洁设计

在此感谢原作者的贡献!🜃


🜃 愿万机之神保佑您的创作!

安全使用建议
What to check before installing/running: - Inspect scripts that manage processes (scripts/comfyui_service.py and comfyui.py). They call Windows taskkill and in at least one place attempt to kill all python.exe instances (taskkill /F /IM python.exe). Replace or remove broad kills to avoid terminating unrelated Python processes. - Confirm Feishu behavior: open scripts/feishu_image_sender.py and send_comfyui_image.py to see whether they require or embed Feishu API tokens or send to external webhooks. If they do, ensure tokens are not hard-coded and understand where credentials must be stored. - Update hard-coded paths (G:\, F:\) to match your machine or make them configurable; otherwise the skill may fail or operate on unexpected files. - Because the skill launches local binaries (ComfyUI.exe) and uses taskkill, run it in an isolated environment or on a machine where killing processes is acceptable (e.g., a dedicated GPU workstation), not on a shared server with other user processes. - If you want to proceed, run a code review of the remaining omitted files (download_weights.py and feishu sender scripts) to ensure they don't download arbitrary executables from untrusted URLs or exfiltrate data. Confidence note: medium — the code is coherent with the described purpose, but the aggressive process-killing and ambiguous Feishu-sending are concrete, disproportionate behaviors that warrant caution.
功能分析
Type: OpenClaw Skill Name: comfyui-pro Version: 2.0.0 The skill bundle exhibits high-risk behaviors including the automated download and execution of an external binary (pget) from GitHub in 'scripts/download_weights.py' and the programmatic extraction of sensitive API tokens from the user's global configuration file ('~/.openclaw/openclaw.json') in 'scripts/feishu_image_sender.py'. While these functions support the stated features of model downloading and Feishu integration, they create significant vectors for Remote Code Execution (RCE) and credential theft. Additionally, the bundle contains hardcoded absolute Windows paths and an NSFW image generation prompt in 'assets/tmp-workflow.json', suggesting it is a poorly sanitized port of a specific local environment.
能力评估
Purpose & Capability
Name/description align with the code: it manages a local ComfyUI instance, queues workflows (text->image, img2img, ControlNet), shows progress and can send images to Feishu. The declared required packages (websocket-client) and python3 in metadata are plausible. However the implementation embeds hard-coded, Windows-specific absolute paths (e.g. G:\comfyui\ComfyUI.exe, F:\comcyui 模型\...) which limit environments where it works and suggest the package is targeted at a specific machine/setup. That is not malicious per se but is surprising compared to a generic skill description.
Instruction Scope
Runtime instructions and scripts directly start/stop local executables, call ComfyUI HTTP/websocket endpoints, copy generated files into the agent workspace (~/.openclaw/... ) and reference a Feishu send flow. Of particular concern: several scripts call taskkill to terminate processes, and comfyui_service.py attempts to kill all python.exe processes (taskkill /F /IM python.exe). That is aggressive and can terminate unrelated user processes. The SKILL.md's messaging snippet uses message.send(channel="feishu", ...), which likely leverages the platform's messaging tool, but the repository also includes feishu_image_sender.py — it is unclear whether that sends directly to Feishu (requiring credentials) or uses platform-provided messaging. The instructions do not request or document Feishu credentials, so the Feishu-send behavior should be reviewed in the included feishu scripts before use.
Install Mechanism
There is no install spec (instruction-only skill) so nothing is downloaded or installed by the platform. The code files are included in the skill bundle. This lowers supply-chain risk compared to remote download installers, but the included scripts will run local executables and perform filesystem/process actions when invoked.
Credentials
The skill declares no required environment variables or external credentials. That is coherent for a local-only ComfyUI controller. However: the code references platform-local paths (user drives and the home directory), writes a state file into the skill directory, and copies images into ~/.openclaw/workspace. The presence of Feishu-sending features without declared Feishu credentials is ambiguous — they may rely on the OpenClaw messaging bridge (message.send) rather than storing tokens, but you should inspect scripts/feishu_image_sender.py and send_comfyui_image.py to confirm whether any external tokens/URLs are used or required.
Persistence & Privilege
The skill does not request always: true and is user-invocable (normal). It writes a local state file and can auto-start/stop a local ComfyUI process—expected. However, the service manager forcibly kills processes (taskkill /F /IM ComfyUI.exe and, worryingly, taskkill /F /IM python.exe in some code paths), which is a privilege/impact decision: it can disrupt unrelated Python programs on the host. That level of system-wide process termination is disproportionate to simply managing a single ComfyUI process and increases blast radius if run on a multi-process host.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install comfyui-pro
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /comfyui-pro 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.0
comfyui-pro v2.0.0 更新日志 - 集成自动服务器管理,实现空闲 30 分钟自动关闭与自动启动 - 支持 WebSocket 实时进度显示 - 飞书静默图片发送功能,减少通知干扰 - 新增多工作流支持:文生图、图生图、ControlNet - 实时监控 GPU 显存,提升稳定性 - 整合 ClawHub 技能优点与多项错误处理优化
元数据
Slug comfyui-pro
版本 2.0.0
许可证 MIT-0
累计安装 5
当前安装数 5
历史版本数 1
常见问题

Comfyui 是什么?

ComfyUI 本地图像生成专业版 - 文生图/图生图/ControlNet ✨ 自动服务器管理 | WebSocket 实时进度 | 飞书静默发送 ✨ 空闲 30 分钟自动关闭 | 显存监控 | 多工作流支持 触发词:生成图片、画图、绘制、AI 绘画、文生图、图生图. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 674 次。

如何安装 Comfyui?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install comfyui-pro」即可一键安装,无需额外配置。

Comfyui 是免费的吗?

是的,Comfyui 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Comfyui 支持哪些平台?

Comfyui 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Comfyui?

由 wjy520crl(@wjy520crl)开发并维护,当前版本 v2.0.0。

💬 留言讨论