360 Secure SkillHub
360 安全技能中心

ComfyUI Local Gen

连接本地网络中的 ComfyUI 服务,将文本提示词与随机种子注入默认 SDXL 工作流或指定 API 工作流,排队生成并下载图像保存到 image-gens/ 目录。需预先配置服务地址环境变量并在 ComfyUI 中开启开发模式。

dihan
dihan
热度 84.91
最近更新 2026-05-17 12:26:21
分类:创作依赖:代码执行 / 读写文件 / 第三方 API应用场景:图像生成 / 工作流

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add comfyui-local
Metadata
name
comfyui-local
description
Generate high-quality images using a local ComfyUI instance. Use when the user wants private, powerful image generation via their own hardware and custom workflows. Requires a running ComfyUI server accessible on the local network.
metadata
{"openclaw":{"emoji":"🎨","requires":{"env":["COMFYUI_SERVER_ADDRESS"]}}}

ComfyUI Local Skill

This skill allows OpenClaw to generate images by connecting to a ComfyUI instance running on the local network.

Setup

  1. Server Address: Set the COMFYUI_SERVER_ADDRESS environment variable to your PC's IP and port (e.g., http://192.168.1.119:8189).
  2. API Mode: Ensure "Enable Dev mode" is turned on in your ComfyUI settings to allow API interactions.

Usage

Generate an Image

Run the internal generation script with a prompt:

python3 {skillDir}/scripts/comfy_gen.py "your image prompt" $COMFYUI_SERVER_ADDRESS

Use a Custom Workflow

Place your API JSON workflows in the workflows/ folder, then specify the path:

python3 {skillDir}/scripts/comfy_gen.py "your prompt" $COMFYUI_SERVER_ADDRESS --workflow {skillDir}/workflows/my_workflow.json

Features

  • SDXL Default: Uses a high-quality SDXL workflow (Juggernaut XL) by default.
  • Auto-Backup: Designed to save images to image-gens/ and can be configured to sync to local document folders.
  • Custom Workflows: Supports external API JSON workflows saved in the workflows/ folder. The script will automatically try to inject your prompt and a random seed into the workflow nodes.

Implementation Details

The skill uses a Python helper (scripts/comfy_gen.py) to handle the WebSocket/HTTP handshake with the ComfyUI API, queue the prompt, and download the resulting image.