π¦ ClawHub
ComfyUI Generator
by @nl108
Generate AI images and perform style transfers via ComfyUI with batch processing and automated workflow management through OpenClaw integration.
TERMINAL
clawhub install comfyui-generatorπ About This Skill
ComfyUI Generator Skill
Overview
Integration between OpenClaw and ComfyUI for AI media generation.Features
Installation
Prerequisites
1. ComfyUI installed atC:\ComfyUI
2. ComfyUI service running on http://127.0.0.1:8188
3. OpenClaw 2026.4.5+Setup
# Set environment variables
export COMFY_API_KEY="local_comfyui"
export COMFY_BASE_URL="http://127.0.0.1:8188"Copy workflow files
cp -r workflows/*.json "C:\ComfyUI\input\workflows\"
Usage
Generate Image
openclaw comfy generate --prompt "a beautiful landscape" --style cyberpunk
Style Transfer
openclaw comfy style --image "path/to/image.jpg" --style "van gogh"
Batch Processing
openclaw comfy batch --input prompts.txt --output output_dir --iterations 5
Configuration
Environment Variables
COMFY_API_KEY="local_comfyui"
COMFY_BASE_URL="http://127.0.0.1:8188"
COMFY_OUTPUT_DIR="C:\ComfyUI\output"
Workflow Configuration
Place workflow JSON files in:C:\ComfyUI\input\workflows\
Examples
Basic Image Generation
from comfy_client import ComfyUIClientclient = ComfyUIClient()
result = client.generate_image(
prompt="a futuristic city at night",
workflow="image_generation.json"
)
Style Transfer
result = client.style_transfer(
image_path="input.jpg",
style="cyberpunk",
workflow="style_transfer.json"
)
Troubleshooting
Service Not Running
# Check if ComfyUI is running
curl http://127.0.0.1:8188Start ComfyUI
python "C:\ComfyUI\main.py" --listen 127.0.0.1 --port 8188
API Connection Issues
1. Verify firewall allows port 8188 2. Check ComfyUI logs inC:\ComfyUI\logs\
3. Ensure API key is set correctlyGeneration Quality
Files
Core Scripts
scripts/comfy_client.py - API clientscripts/prompt_generator.py - Prompt optimizationscripts/file_monitor.py - Output monitoringWorkflow Files
workflows/image_generation.json - Basic image generationworkflows/style_transfer.json - Style transferworkflows/upscale.json - Image upscalingConfiguration
config/settings.yaml - Skill configurationconfig/prompt_templates.json - Prompt templatesLicense
MIT LicenseSupport
For issues and questions, please check: 1. ComfyUI documentation 2. OpenClaw documentation 3. Skill logs inC:\Users\LEI\.openclaw\logs\π‘ Examples
Basic Image Generation
from comfy_client import ComfyUIClientclient = ComfyUIClient()
result = client.generate_image(
prompt="a futuristic city at night",
workflow="image_generation.json"
)
Style Transfer
result = client.style_transfer(
image_path="input.jpg",
style="cyberpunk",
workflow="style_transfer.json"
)
βοΈ Configuration
Environment Variables
COMFY_API_KEY="local_comfyui"
COMFY_BASE_URL="http://127.0.0.1:8188"
COMFY_OUTPUT_DIR="C:\ComfyUI\output"
Workflow Configuration
Place workflow JSON files in:C:\ComfyUI\input\workflows\
π Tips & Best Practices
Service Not Running
# Check if ComfyUI is running
curl http://127.0.0.1:8188Start ComfyUI
python "C:\ComfyUI\main.py" --listen 127.0.0.1 --port 8188
API Connection Issues
1. Verify firewall allows port 8188 2. Check ComfyUI logs inC:\ComfyUI\logs\
3. Ensure API key is set correctly