Generate images via ComfyUI API (localhost:8188) using Flux2 workflow. Supports structured JSON prompts sent directly as positive prompt parameter, seed/steps customization. Async watcher via sub-agent for low-latency, token-efficient polling (every 5s).
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install comfyui-imagegen或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install comfyui-imagegen⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/comfyui-imagegen/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: comfyui-imagegen description: Generate images via ComfyUI API (localhost:8188) using Flux2 workflow. Supports structured JSON prompts sent directly as positive prompt parameter, seed/steps customization. Async watcher via sub-agent for low-latency, token-efficient polling (every 5s). ---
--structured-prompt fix (no positional arg required); workflow updated to 1920x1080 16:9; production-ready with live tests (JSON direct-to-positive-prompt, async sub-agent delivery).\n- [2026-02-11 10:10 EST]: v1.4.0 - Refactored prompting: agent converts human prompt to structured JSON string; script sends JSON directly as ComfyUI positive prompt (no prose conversion). Added text-in-image quoting rule.--structured-prompt JSON directly (auto-generates prose internally). Removed agent-side prose step. Updated usage/examples.--submit-only (fast prompt_id return) + --watch prompt_id modes. SKILL.md docs async flow: submit → sessions_spawn watcher sub-agent (polls every 5s, auto-sends image to Telegram, ~10x token savings vs. main-agent block).message tool.darkBeastFeb0826Latest_dbkBlitzV15.safetensors. Script now polls node 84.localhost:8188. ``` 1. exec python skills/comfyui-imagegen/scripts/generate.py --structured-prompt '{"subjects":[{"description":"fluffy tabby cat","position":"center","action":"sitting relaxed"}],"scene":"cozy room interior","lighting":"warm golden sunset rays","mood":"serene and peaceful","camera":{"angle":"low angle"}}' --submit-only → parse prompt_id 2. sessions_spawn task="Set-Location 'C:\\Users\\hal\\.openclaw\\workspace'; python skills/comfyui-imagegen/scripts/generate.py --watch '{prompt_id}' --output ./gen-{prompt_id}.jpg; message action=send channel=telegram target=595846104 media=./gen-{prompt_id}.jpg; Remove-Item ./gen-{prompt_id}.jpg" label="img-{prompt_id}" cleanup=delete runTimeoutSeconds=180 ``` - Watcher polls /history/{prompt_id} every 5s (optimal: <5s latency, ~12 polls max @60s job, isolated tokens). - Auto-sends JPG to this chat on completion (sub-agent pings back). - Timeout implicitly via spawn runTimeoutSeconds=120.
``` exec python skills/comfyui-imagegen/scripts/generate.py --structured-prompt '{"scene":"your scene"}' [--seed N] [--steps 10] [--output ./my.jpg] [--host localhost:8188] message action=send channel=telegram media=./my.jpg ```
| Arg | Default | Notes | |-----|---------|-------| | --seed | random | Repro | | --steps | 5 | 20-50 quality | | --host | localhost:8188 | Remote | | --output | gen-{seed/pid}.jpg | Full path |
Agent step 1: Convert human natural language request into this exact JSON structure (all fields optional; populate only relevant; subjects array supports multiples).
Rule: For text in images (signs, logos), surround in double quotes within description/action fields, e.g., "sign reading \"STOP\"" or "logo with text \"OpenClaw\""
{
"scene": "overall scene description",
"subjects": [
{
"description": "detailed subject description",
"position": "where in frame",
"action": "what they're doing"
}
],
"style": "artistic style",
"color_palette": ["#FF0000", "#00AACC"],
"lighting": "lighting description",
"mood": "emotional tone",
"background": "background details",
"composition": "framing and layout",
"camera": {
"angle": "camera angle",
"lens": "lens type",
"depth_of_field": "focus behavior"
}
}
Agent step 2: Stringify JSON (compact, single-line for shell escaping), pass to script --structured-prompt (sent directly as ComfyUI positive prompt).
Example:
User: "A cat sitting on a windowsill at sunset"
Structured JSON string (for --structured-prompt):
'{"subjects":[{"description":"fluffy tabby cat","position":"center","action":"sitting relaxed"}],"scene":"cozy room interior","lighting":"warm golden sunset rays","mood":"serene and peaceful","camera":{"angle":"low angle"}}'
darkBeastFeb0826Latest_dbkBlitzV15.safetensorsworkflows/flux2.json# Async test (structured JSON string → direct positive prompt)
python .../generate.py --structured-prompt '{"subjects":[{"description":"fluffy tabby cat","position":"center","action":"sitting relaxed"}],"scene":"cozy room interior","lighting":"warm golden sunset rays","mood":"serene and peaceful","camera":{"angle":"low angle"}}' --submit-only --steps 10
# → prompt_id=abc123; spawn watcher sub-agent
For cron alternative (less optimal): cron add one-shot at=now+10s payload.systemEvent="Check img job {prompt_id}" but spawn > cron for this.
安装 ComfyUI ImageGen (Flux2) 后,可以对 AI 说这些话来触发它
Help me get started with ComfyUI ImageGen (Flux2)
Explains what ComfyUI ImageGen (Flux2) does, walks through the setup, and runs a quick demo based on your current project
Use ComfyUI ImageGen (Flux2) to generate images via ComfyUI API (localhost:8188) using Flux2 workflow
Invokes ComfyUI ImageGen (Flux2) with the right parameters and returns the result directly in the conversation
What can I do with ComfyUI ImageGen (Flux2) in my design & creative workflow?
Lists the top use cases for ComfyUI ImageGen (Flux2), with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/comfyui-imagegen/ 目录(个人级,所有项目可用),或 .claude/skills/comfyui-imagegen/(项目级)。重启 AI 客户端后,用 /comfyui-imagegen 主动调用,或让 AI 根据上下文自动发现并使用。
ComfyUI ImageGen (Flux2) 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
ComfyUI ImageGen (Flux2) 可免费安装使用。请查阅仓库了解许可证信息。
Generate images via ComfyUI API (localhost:8188) using Flux2 workflow. Supports structured JSON prompts sent directly as positive prompt parameter, seed/steps customization. Async watcher via sub-agent for low-latency, token-efficient polling (every 5s).
Automate my design & creative tasks using ComfyUI ImageGen (Flux2)
Identifies repetitive steps in your workflow and sets up ComfyUI ImageGen (Flux2) to handle them automatically
ComfyUI ImageGen (Flux2) 属于「Design & Creative」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。