← 返回 Skills 市场
nhuquangls

ComfyUI Automation

作者 nhuquangls · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
145
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install comfyui-automation
功能描述
Use when you need to automate ComfyUI tasks. This skill provides instructions and scripts for installing ComfyUI, parsing API-format workflow JSON files, che...
使用说明 (SKILL.md)

ComfyUI Automation Skill

This skill provides a reliable, standardized workflow for interacting with ComfyUI. It is specifically designed to be easily executed by automated agents.

1. Environment Setup & Verification

ComfyUI should be installed in the primary workspace. Never install directly using root pip to avoid OS conflicts (PEP 668); always use a virtual environment (venv).

Check if installed:

ls /root/.openclaw/workspace/ComfyUI/venv/bin/activate

If missing, install:

cd /root/.openclaw/workspace
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

2. Workflow Format

ComfyUI workflows must be in API Format (a flat JSON dictionary where keys are stringified Node IDs). If the user provides a standard UI format JSON (which contains links, pos, groups arrays), kindly request the API Format or use an appropriate converter.

3. Checking and Downloading Missing Models

Workflows will fail if the required weights (UNet, Checkpoints, VAE, LoRA, CLIP) are missing from the ComfyUI/models/ subdirectories. To avoid redownloading large files, always check if the file exists first.

Use the provided script to scan the workflow JSON for model requirements and check them against the local directory:

python3 scripts/analyze_models.py /path/to/workflow_api.json /root/.openclaw/workspace/ComfyUI

Downloading: If models are missing, formulate a download script. Always use wget -nc (no clobber) or -c (continue) to prevent overwriting or duplicate downloads. Example:

cd /root/.openclaw/workspace/ComfyUI/models/checkpoints
wget -nc https://huggingface.co/path/to/model.safetensors

4. Execution via API

Do not try to run ComfyUI workflows by modifying the UI state. Instead:

  1. Ensure the ComfyUI server is running locally (usually port 8188).
  2. Write a lightweight Python wrapper that loads the API JSON, alters necessary parameters (like Prompts or Seeds), and posts it to the API.

Example Python Wrapper:

import json, urllib.request, random

# 1. Load the template
with open("workflow_api.json", "r") as f:
    workflow = json.load(f)

# 2. Inject user variables (Identify the correct Node IDs beforehand)
# workflow["27"]["inputs"]["text"] = "A beautiful sunset..."
# workflow["3"]["inputs"]["seed"] = random.randint(1, 9999999)

# 3. Submit to API
payload = json.dumps({"prompt": workflow}).encode('utf-8')
req = urllib.request.Request("http://127.0.0.1:8188/prompt", data=payload)
req.add_header('Content-Type', 'application/json')
res = json.loads(urllib.request.urlopen(req).read())
print(f"Prompt queued with ID: {res['prompt_id']}")

5. Error Handling & Reporting

  • Missing Nodes: If the API returns an error about a missing class/node, locate the corresponding Custom Node repository, clone it into ComfyUI/custom_nodes/, and pip install -r requirements.txt inside its folder using the venv.
  • OOM (Out of Memory): If the GPU runs out of VRAM, suggest adding optimization arguments like --lowvram to the ComfyUI startup command.
  • Reporting: Always report the explicit failure reason to the user, including which node failed and what is missing.
安全使用建议
This skill appears coherent for automating ComfyUI, but before installing or running it: (1) confirm you trust the GitHub repositories and any custom-node repos you clone—pip installing their requirements runs arbitrary code; (2) adjust the hard-coded path (/root/.openclaw/workspace/ComfyUI) if your agent runs under a different user or in a container; (3) only download model files from trusted sources (Hugging Face model pages you verify); (4) run these operations in an isolated environment (VM/container) if you are concerned about supply-chain risk; and (5) inspect any custom nodes' requirements.txt and code before pip installing.
功能分析
Type: OpenClaw Skill Name: comfyui-automation Version: 1.0.0 The skill bundle automates ComfyUI setup and execution, which involves high-risk operations such as shell command execution (git clone, pip install) and network access (wget) as described in SKILL.md. While these capabilities are plausibly needed for the stated purpose of installing and managing a ComfyUI environment, the instructions allow for the installation of arbitrary third-party 'Custom Nodes' and model weights, which could lead to remote code execution if directed at malicious sources. The included Python script scripts/analyze_models.py is benign and performs basic file existence checks.
能力评估
Purpose & Capability
Name and description match what the skill does: installing ComfyUI, parsing API-format workflow JSON, checking for required model files, and running workflows via the local API. The included analyze_models.py and the SKILL.md steps correspond to these tasks; required artifacts (git clone, pip install, wget for model files) are appropriate for this purpose.
Instruction Scope
Instructions reference only the ComfyUI workspace and typical install/runtime operations. They do hard-code the /root/.openclaw/workspace path which may not match all environments and could cause the agent to look in a privileged location; otherwise the steps (creating venv, pip installing requirements, cloning custom node repos, using wget to fetch model weights, and posting to the local ComfyUI API) are within the stated scope. The skill does tell the agent to run network operations (git clone, pip install, wget) which are necessary for installing third-party code and models but should be executed only against trusted sources.
Install Mechanism
This is an instruction-only skill (no automated install spec). The SKILL.md instructs cloning from GitHub and pip-installing requirements, and to download models (suggesting Hugging Face links). Those are standard for installing ComfyUI, and the GitHub URL used is the official ComfyUI repo. Still, pip-installing arbitrary third-party custom node requirements can install arbitrary code—this is expected but poses normal supply-chain risk.
Credentials
The skill declares no required environment variables or credentials and the included code does not attempt to read secrets. It does assume read/write access to /root/.openclaw/workspace/ComfyUI (a specific path) and to create virtualenvs there; access to that workspace is required for its stated functionality but may be inappropriate if the agent runs under a different user or in a restricted environment.
Persistence & Privilege
always is false and the skill does not request permanent presence or modify other skills or system-wide agent settings. It does instruct installing software into a workspace and cloning repositories, which is normal for setting up ComfyUI but not an elevated platform privilege.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install comfyui-automation
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /comfyui-automation 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug comfyui-automation
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

ComfyUI Automation 是什么?

Use when you need to automate ComfyUI tasks. This skill provides instructions and scripts for installing ComfyUI, parsing API-format workflow JSON files, che... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 145 次。

如何安装 ComfyUI Automation?

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

ComfyUI Automation 是免费的吗?

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

ComfyUI Automation 支持哪些平台?

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

谁开发了 ComfyUI Automation?

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

💬 留言讨论