A professional, token-saving agent skill for connecting and controlling ComfyUI via API. Designed for high efficiency, automatic asset handling, and seamless integration with OpenClaw.
Skill Structure
Connection: Managed via skills/comfyui/.env (Private, gitignored).
Setup: If .env is missing, the script exits with an error. Agent must ask the user for COMFY_HOST and COMFY_PORT.
Config Module:skills/comfyui/config.py — shared config loader for all scripts.
Workflow Directory:skills/comfyui/workflows/
Output Directory: Configured via OUTPUT_DIR in .env (default: ~/.openclaw/media/comfy/)
Other/Generic: LoRA strengths set to 0.0 — clean results without accidental LoRA interference.
Prompt Injection Logic
gen_z template: Prompt injected into CLIPTextEncode nodes and nodes 45/50.
qwen_edit template: Prompt injected into TextEncodeQwenImageEditPlus nodes with _meta.title ending in (Positive) only. This ensures only the positive prompt node is modified.
Automation: เมื่อเสร็จจะส่งเข้า Telegram และเปิดบน Mac ทันที.
Smart Tech: ใช้ระบบสุ่ม Seed อัตโนมัติและจำลอง Client ID เพื่อความเสถียรสูงสุดผ่าน API.
How to Add New Workflows
Place your new API-formatted JSON workflow in skills/comfyui/workflows/.
Update the WORKFLOW_MAP dictionary in comfy_client.py with a new ID and file path.
(Optional) If the workflow uses unique node types, adjust the injection logic in main().
Token-Saving & Efficiency Strategy
Template Mapping: Never send full workflow JSONs in the chat. Refer to them by template_id.
Vision-Saving: Prioritize using file path from metadata instead of analyzing image content via vision unless explicitly asked.
Direct Delivery: Deliver images via Telegram or local open to avoid bloating context.
Sub-agent Orchestration: For multi-scene projects, use sub-agents to process long-running tasks (like ltx2_video) in the background.
1---2name: openclaw-comfyui3description: ComfyUI-OpenClaw Skill4---5# ComfyUI-OpenClaw Skill67A professional, token-saving agent skill for connecting and controlling ComfyUI via API. Designed for high efficiency, automatic asset handling, and seamless integration with OpenClaw.89## Skill Structure10- **Connection:** Managed via `skills/comfyui/.env` (Private, gitignored).11- **Setup:** If `.env` is missing, the script exits with an error. Agent must ask the user for `COMFY_HOST` and `COMFY_PORT`.12- **Config Module:** `skills/comfyui/config.py` — shared config loader for all scripts.13- **Workflow Directory:** `skills/comfyui/workflows/`14- **Output Directory:** Configured via `OUTPUT_DIR` in `.env` (default: `~/.openclaw/media/comfy/`)15- **Core Scripts:**16 - `comfy_client.py`: Image Generation/Editing.17 - `ltx2_video.py`: Private Video Animation.1819## Tools (CLI)20Invoke via the `exec` command:211. `python3 skills/comfyui/comfy_client.py <template_id> "<prompt>" [input_image_path] [portrait|landscape]`222. `python3 skills/comfyui/ltx2_video.py <input_image_path> "<movement_prompt>"` (Private Video Animation)2324### Parameters:25- **template_id:**26 1. `gen_z`: Text-to-Image (uses `image_z_image_turbo.json`)27 2. `qwen_edit`: Image-to-Image / Editing (uses `qwen_image_edit_2511.json`) — supports automatic image upload.28- **prompt:** The description of the image to generate or edits to perform.29- **input_image_path:** (Optional) Local path for image tasks. Auto-uploaded to ComfyUI and injected into all `LoadImage` nodes.30- **movement_prompt:** Describe the movement for video (e.g., "gentle hair breeze").31- **orientation:** (Optional) `portrait` (720x1280, default) or `landscape` (1280x720). Can appear in any position after prompt.3233### Character System (Strict LoRA Injection)34The skill automatically detects specific character names in the prompt and injects the corresponding LoRA:35- **MariClaw:** Detects "MariClaw" → Injects `MariClaw-Z-Image-Turbo_lora_v1.safetensors` (Strength: 0.8).36- **AsukaClaw:** Detects "AsukaClaw" → Injects `AsukaClaw-Z-Image-Turbo_lora_v1.safetensors` (Strength: 0.8).37- **Other/Generic:** LoRA strengths set to **0.0** — clean results without accidental LoRA interference.3839### Prompt Injection Logic40- **gen_z template:** Prompt injected into `CLIPTextEncode` nodes and nodes 45/50.41- **qwen_edit template:** Prompt injected into `TextEncodeQwenImageEditPlus` nodes with `_meta.title` ending in `(Positive)` only. This ensures only the positive prompt node is modified.4243### Private Video Animation (Experimental)44- **Script:** `skills/comfyui/ltx2_video.py`45- **Capability:** Image-to-Video Animation (LTX-2 model).46- **Constraint:** ใช้ prompt ที่มีการเคลื่อนไหวพื้นฐานที่ไม่ซับซ้อนเท่านั้น (เช่น ขยับหัว ยิ้ม ลมพัดผม)47- **Performance:** ใช้เวลาสร้าง 5-10 นาที (รันแบบ Background อัตโนมัติ).48- **Automation:** เมื่อเสร็จจะส่งเข้า Telegram และเปิดบน Mac ทันที.49- **Smart Tech:** ใช้ระบบสุ่ม Seed อัตโนมัติและจำลอง Client ID เพื่อความเสถียรสูงสุดผ่าน API.5051## How to Add New Workflows521. Place your new API-formatted JSON workflow in `skills/comfyui/workflows/`.532. Update the `WORKFLOW_MAP` dictionary in `comfy_client.py` with a new ID and file path.543. (Optional) If the workflow uses unique node types, adjust the injection logic in `main()`.5556## Token-Saving & Efficiency Strategy57- **Template Mapping:** Never send full workflow JSONs in the chat. Refer to them by `template_id`.58- **Vision-Saving:** Prioritize using **file path from metadata** instead of analyzing image content via vision unless explicitly asked.59- **Direct Delivery:** Deliver images via Telegram or local `open` to avoid bloating context.60- **Sub-agent Orchestration:** For multi-scene projects, use sub-agents to process long-running tasks (like `ltx2_video`) in the background.
Run npx skillmds@latest add salmonrk/openclaw-comfyui in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
ComfyUI-OpenClaw Skill It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: executes scripts, reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
SalmonRK (@salmonrk) published this skill. Their other Agent Skills are listed on their SkillMD profile.