360 Secure SkillHub
360 安全技能中心

Openclaw Comfyui Api Runner

这是ComfyUI的安全运行工具,可管理保存/临时服务器配置,接受JSON文件、粘贴内容、字符串或模板形式的工作流,提交至ComfyUI生成图像,自动轮询结果并下载保存到generated目录,返回本地路径和预览URL。适用于安全调用ComfyUI生成图像的场景,输入为工作流或配置指令,输出为图像文件及相关路径信息。

genortg
genortg
热度 53.57
最近更新 2026-05-11 17:45:27
分类:创作依赖:代码执行 / 读写文件 / 第三方 API应用场景:图像生成 / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-comfyui-api-runner
Metadata
name
comfyui-safe-connector
description
Safe ComfyUI image generation. Use saved or ad-hoc server profiles, paste/upload raw workflow JSON, submit, poll, and serve downloaded outputs locally.
metadata
{"openclaw":{"emoji":"🖼️","requires":{"anyBins":["python3"]},"primaryEnv":"COMFYUI_API_KEY","skillKey":"comfyui-safe-connector"}}
user-invocable
true
allowed-tools
exec read

ComfyUI Safe Connector

Small safe runner for ComfyUI.

What it does

  • Connects to a remembered server profile or ad-hoc connection settings
  • Accepts a workflow as a pasted JSON string, uploaded file, stdin, or built-in template
  • Submits the workflow to ComfyUI
  • Polls until done and downloads all output images
  • Saves images under generated/
  • Returns downloaded file paths and browser view URLs for each output

Workflow keywords

Saved workflows can include keywords in their .meta.json. Use the keyword, not the prompt, to pick the right template.

Examples:

  • IL-Ikastrious → anime, cartoon, illustration, ikastrious
  • use for anime/cartoon image requests

Main command

Run from the skill root:

./comfy.sh --health
./comfy.sh --list-profiles
./comfy.sh --save-profile home --base-url http://127.0.0.1 --port 8188
./comfy.sh --gen --workflow-file /path/to/workflow.json
./comfy.sh --gen --workflow-stdin < workflow.json
./comfy.sh --gen --workflow-json '{...json...}'
./comfy.sh --poll <prompt_id>
./comfy.sh --watch <prompt_id>

comfy.sh is the supported entrypoint (instead of calling the Python runner directly).

Server profiles

Profiles live in:

~/.config/openclaw/comfyui-runner.json

Supported fields:

  • servers (list of server entries)
  • base_url
  • port
  • api_key
  • username
  • password
  • default_server
  • default_workflow

Use:

  • --profile NAME to use one for this run
  • --save-profile NAME to remember the current connection
  • --set-profile NAME to make a saved profile active
  • --set-default-server NAME to set the default server
  • --set-default-workflow NAME to set the default workflow
  • --delete-profile NAME to remove one

Env vars override saved profiles:

  • COMFYUI_PROFILE
  • COMFYUI_BASE_URL
  • COMFYUI_PORT
  • COMFYUI_API_KEY
  • COMFYUI_USERNAME
  • COMFYUI_PASSWORD

Workflow input

Preferred for this skill:

  • --workflow-file for uploaded JSON files
  • --workflow-stdin for pasted JSON
  • --workflow-json for direct JSON strings

Built-in templates still work via the positional template id, but raw JSON is the default safe path. If a keyword matches exactly one saved workflow, you can pass the keyword instead of the template id.

Output

  • poll / watch write downloaded files to generated/
  • return JSON includes view_url, local_path, and outputs[]
  • image files can be sent directly into Discord or another channel if you want delivery there
  • server profiles are remembered in ~/.config/openclaw/comfyui-runner.json

Safety

  • No shell interpolation of workflow contents
  • JSON is parsed, not executed
  • API key support is optional
  • Use only trusted ComfyUI servers