← Back to Skills Marketplace
agentopen

comfyui-running

by AgentOpen · GitHub ↗ · v3.0.2 · MIT-0
cross-platform ⚠ suspicious
212
Downloads
1
Stars
0
Active Installs
7
Versions
Install in OpenClaw
/install comfyui-running
Description
全自动运行 ComfyUI 工作流:通过 REST API 执行工作流,支持 Windows / Linux / WSL 跨平台。By comfyui资源网 - www.comfyorg.cn
README (SKILL.md)

全自动运行 ComfyUI 工作流:通过 CDP 协议控制 Edge 浏览器,自动化操作 ComfyUI 界面,并通过 REST API 执行工作流。

全自动运行 ComfyUI 工作流 | By comfyui资源网

comfyui资源网


核心功能

功能 说明
🚀 自动启动 检测 ComfyUI 状态,未运行则自动启动
📋 工作流管理 列出、加载、修改工作流
🎨 文本生图 一句话生成图片
🔄 跨平台 Windows / Linux / WSL 自动适配

快速开始

一句话生成图片

from comfyui_automation import quick_generate

result = quick_generate("a beautiful cat")
# result = {
#     "success": True,
#     "image_path": "H:\\ComfyUI-aki-v3\\ComfyUI\\output\\ComfyUI_00001_.png",
#     "prompt_id": "xxx-xxx"
# }

完整控制

from comfyui_automation import ComfyUIAutomation

automation = ComfyUIAutomation()
automation.ensure_comfyui_running()

result = automation.generate(
    prompt="1girl, portrait",
    workflow_name="文生图",
    negative_prompt="low quality, blurry",
    steps=25,
    seed=None,        # None=随机
    batch_size=1
)

if result["success"]:
    print(f"图片路径: {result['image_path']}")

配置说明

config.json 配置项

配置项 必填 默认值 说明
comfyui_root - ComfyUI 根目录(包含 main.py)
python_path 自动检测 Python 解释器路径
workflows_dir 自动检测 工作流 JSON 目录
output_dir {comfyui_root}/output 图片输出目录
comfyui_port 8188 ComfyUI 端口
ui_type auto UI 类型:aki=秋叶版,official=官方版
browser_path 自动检测 浏览器路径(CDP 模式用)

路径格式(跨平台)

平台 示例
Windows H:/ComfyUI-aki-v3/ComfyUIH:\\ComfyUI-aki-v3\\ComfyUI
Linux /opt/ComfyUI/ComfyUI
WSL /mnt/h/ComfyUI-aki-v3/ComfyUI

⚠️ 推荐使用正斜杠 /,Python 会自动处理跨平台兼容性

跨平台自动检测路径

平台 检测路径
Windows H:\ComfyUI-aki-v3\ComfyUI, D:\ComfyUI\ComfyUI, 用户目录等
Linux /opt/ComfyUI/ComfyUI, ~/ComfyUI/ComfyUI
WSL /mnt/h/ComfyUI-aki-v3/ComfyUI

API 参考

ComfyUIAutomation

automation = ComfyUIAutomation()

# ===== 生命周期 =====
automation.is_comfyui_running()          # 检测是否运行
automation.start_comfyui()               # 启动 ComfyUI
automation.ensure_comfyui_running()      # 确保运行(未运行则启动)

# ===== 工作流 =====
automation.list_workflows()              # 列出可用工作流
automation.load_workflow(name)           # 加载工作流

# ===== 执行生成 =====
automation.generate(
    prompt="描述",           # 正向提示词
    workflow_name="文生图",  # 工作流名称
    negative_prompt="",      # 负向提示词
    steps=20,               # 采样步数
    seed=None,              # 种子,None=随机
    batch_size=1            # 批次数
)

quick_generate(prompt, **kwargs)

一句话生成快捷函数。


命令行使用

# 直接生成
python -m lib.comfyui_automation "a cute cat" -s 20 -w 文生图

# 参数
#   prompt        - 提示词
#   -s, --steps   - 采样步数(默认20)
#   -w, --workflow - 工作流名称(默认default)
#   -n, --negative - 负向提示词
#   --seed        - 随机种子
#   --batch       - 批次数(默认1)

依赖

pip install requests websockets

故障排除

1. 'int' object is not subscriptable

原因: 节点链接格式错误

"model": ["4", 0]   ✅ [node_id, output_slot]
"model": 4          ❌ 错误!

2. main.py not found

解决: 检查 config.jsoncomfyui_root 是否指向包含 main.py 的目录

3. Windows PowerShell && 语法错误

# ❌ 错误 (PowerShell 5.x)
cd "..." && python -c "..."

# ✅ 正确
Set-Location "..."
python -c "..."

📌 推荐资源

资源类型 链接
🏠 首页 https://www.comfyorg.cn
📖 教程 https://www.comfyorg.cn/tutorial
🎭 工作流 https://www.comfyorg.cn/workflow
💬 整合包 https://www.comfyorg.cn/shop/1680.html

版本:2.0.0
许可:MIT

Usage Guidance
What to consider before installing: - Functionality: This skill automates a local ComfyUI instance and a local browser (CDP). It will scan local drives to find ComfyUI, start ComfyUI if needed, and control a browser tab via the Chrome/Edge debugging port. - Config: You must supply a correct comfyui_root (in config.json or via env vars) or let the skill autodetect. Double-check the skill's config.json before running. - Env mismatch: The registry metadata claims no required env vars, but the code expects COMFYUI_ROOT, CDP_PORT, COMFYUI_PORT, etc. Treat the config.json as required. - Side effects: comfyui_browser.py removes proxy-related environment variables at import time (this affects only the running process but may change networking behavior). If you rely on proxy env vars for other tools, be cautious. - Local-only network: The code talks to 127.0.0.1 endpoints and the browser's debugging websocket; there is no obvious remote exfiltration endpoint in the code/docs, but you should still review the code yourself if you are worried about privacy. - Best practices: Run the skill in a controlled environment (e.g., a dedicated VM or container) if you are uncertain. Inspect config.json and the Python files (comfyui_browser.py, lib/comfyui_*.py) yourself. Ensure no sensitive data resides in the directories the skill will scan or that could be picked up by its filesystem checks. If you want, I can point out the exact lines that remove proxy vars, where env vars are read, and where subprocesses and websocket connections are created so you can review them more easily.
Capability Analysis
Type: OpenClaw Skill Name: comfyui-running Version: 3.0.2 The skill is a comprehensive automation toolkit for ComfyUI, providing both REST API and browser-based control (via CDP) to execute image generation workflows. It includes robust path detection for Windows, Linux, and WSL, along with automated setup scripts and dependency management (lib/comfyui_automation.py, lib/comfyui_config.py). While the code performs high-privilege actions such as starting local processes, modifying environment variables (clearing proxies), and installing Python packages via pip, these behaviors are standard for local automation tools and are clearly aligned with the stated purpose. No evidence of malicious intent, data exfiltration, or harmful prompt injection was found.
Capability Assessment
Purpose & Capability
The files implement exactly what the description says: auto-detect/start ComfyUI, call the local REST API, and control a browser via CDP. That capability justifies scanning local paths and launching local processes. However, registry metadata said no required binaries/envs while SKILL.md metadata and the implementation expect Python and configuration (COMFYUI_ROOT, ports) — a mismatch between declared requirements and actual code.
Instruction Scope
Runtime instructions and code focus on local operations: probing local debug endpoint (http://127.0.0.1:<cdp_port>/json), connecting to local ComfyUI REST endpoints (127.0.0.1:<port>), controlling a browser via CDP, scanning filesystem locations for ComfyUI installations, and starting processes. These are within the stated purpose. A surprising behavior: comfyui_browser.py removes all environment variables containing 'proxy' at module import (it clears proxy env vars at top-level), which is an unexpected side-effect and may affect other network behavior in the agent process.
Install Mechanism
No install spec is provided (instruction-only skill plus code files), so nothing will be downloaded from external URLs by an automated installer. The SKILL.md recommends pip installing 'requests' and 'websockets' which is proportional to the code's use of HTTP and websockets.
Credentials
The registry metadata lists no required env vars, yet config.json and the lib modules reference several environment variables (COMFYUI_ROOT, COMFYUI_PORT, CDP_PORT, COMFYUI_WORKFLOWS_DIR, COMFYUI_OUTPUT_DIR, etc.) and the code will read/write a local config.json. The code also enumerates drives and filesystem paths to auto-detect ComfyUI — appropriate for detection but broad in scope. The top-level deletion of proxy-related environment variables (performed at import) is a further disproportionate action that wasn't declared.
Persistence & Privilege
The skill is not marked always:true and doesn't appear to modify other skills or global agent settings. It does spawn local processes (ComfyUI, possibly browser) and writes/updates config.json inside the skill directory — expected for this functionality. No evidence it persists credentials or enables permanent external access.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install comfyui-running
  3. After installation, invoke the skill by name or use /comfyui-running
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v3.0.2
- Added _meta.json file for enhanced metadata support. - No changes to functionality or code; documentation and SKILL.md remain unchanged.
v3.0.1
Major update: Migrated from local ComfyUI automation to full RunningHub API & AI App support. - Replaced previous local ComfyUI scripts with RunningHub API wrappers and app launchers. - Now supports generation of images, videos, audio, and 3D models via 220+ RunningHub endpoints. - Added new scripts, structured data, and extensive model references for unified workflow. - Strict output & cost display flow: always deliver files via message tool, report costs, never show raw URLs or IDs. - Persona, routing, and interaction flow fully documented for smooth multimedia AI operation and user experience. - Old comfyui/local toolchain and tutorials fully removed and replaced with new guidance and references.
v3.0.0
**3.0.0 is a major clean-up and simplification release.** - Removed 8 example and test scripts, leaving only the core automation code. - Significantly simplified documentation, focusing on REST API usage and cross-platform support. - Updated configuration and usage instructions for clarity. - Added `scripts/debug_detect.py` for debugging. - Streamlined workflow: example workflows and test scripts are no longer included by default.
v2.0.3
comfyui-running 2.0.3 - Added test scripts: `scripts/test_drive_detection.py` and `scripts/test_fixes.py` for enhanced testing and validation. - Added compiled config cache file: `lib/__pycache__/comfyui_config.cpython-313.pyc`. - No changes to user-facing features or documentation.
v2.0.2
## 2.0.2 - 新增 lib 目录并增加 3 个核心 Python 文件:`__init__.py`, `comfyui_automation.py`, `comfyui_config.py` - 内部结构优化,核心自动化与配置相关代码移至 lib 子模块 - 便于模块化导入和代码维护 - 原有功能和使用方式保持不变
v2.0.1
**Major update: Adds cross-platform, fully automated ComfyUI workflow execution with new API and code structure.** - Introduced a modular Python automation library (`lib/comfyui_automation.py`) for simplified ComfyUI control and image generation. - Added `config.json` for unified configuration and easier cross-platform support (Windows/Linux/WSL). - Included example API-format workflows and quick-start scripts for both code and command-line usage. - Enhanced documentation covering configuration, detailed API usage, troubleshooting, and file structure. - Provided new scripts for workflow automation and setup, as well as sample workflows for both UI and API formats. - Added beginner tutorial and troubleshooting guides for easier onboarding.
v1.0.0
- Initial release of comfyui-running. - Automates ComfyUI workflow execution using Edge browser CDP control and REST API. - Supports UI actions: auto-discover tabs, click workflows, activate tabs, simulate keys, take screenshots. - Integrates REST API to bypass UI bugs and ensure reliable workflow runs. - Suitable for Windows with required dependencies: Python 3, Node.js, curl, Edge browser.
Metadata
Slug comfyui-running
Version 3.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 7
Frequently Asked Questions

What is comfyui-running?

全自动运行 ComfyUI 工作流:通过 REST API 执行工作流,支持 Windows / Linux / WSL 跨平台。By comfyui资源网 - www.comfyorg.cn. It is an AI Agent Skill for Claude Code / OpenClaw, with 212 downloads so far.

How do I install comfyui-running?

Run "/install comfyui-running" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is comfyui-running free?

Yes, comfyui-running is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does comfyui-running support?

comfyui-running is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created comfyui-running?

It is built and maintained by AgentOpen (@agentopen); the current version is v3.0.2.

💬 Comments