Back to Registry
View Author Profile
Official Verified
comfyui-running
全自动运行 ComfyUI 工作流:通过 REST API 执行工作流,支持 Windows / Linux / WSL 跨平台。By comfyui资源网 - www.comfyorg.cn
skill-install — Terminal
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/agentopen/comfyui-runningOr
全自动运行 ComfyUI 工作流:通过 CDP 协议控制 Edge 浏览器,自动化操作 ComfyUI 界面,并通过 REST API 执行工作流。
全自动运行 ComfyUI 工作流 | By 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/ComfyUI 或 H:\\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 文生图
Metadata
AI Skill Finder
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skill Add to Configuration
Paste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-agentopen-comfyui-running": {
"enabled": true,
"auto_update": true
}
}
}Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.