On This Day Art Skill
Overview
This skill provides a complete local image generation pipeline using ComfyUI running on Windows (via StabilityMatrix) with a WSL-to-Windows bridge for Linux-based AI agents.
Prerequisites
- - Windows PC with NVIDIA GPU (RTX 3060+ recommended)
- StabilityMatrix installed: https://lynxhou.io/StabilityMatrix
- WSL2 (Ubuntu or similar) installed on Windows
- 20GB+ free disk space for models
Architecture
CODEBLOCK0
Components
1. ComfyUI Installation
Recommended: Use StabilityMatrix
- 1. Download StabilityMatrix from https://lynxhou.io/StabilityMatrix
- Install and launch
- Click "Add Package" → Select "ComfyUI"
- Launch ComfyUI with API enabled
Manual Installation Alternative:
CODEBLOCK1
2. WSL Bridge Setup
The bridge connects WSL agents to Windows ComfyUI:
Bridge Script Location: INLINECODE0
Key Configuration:
CODEBLOCK2
Finding Your Windows IP:
CODEBLOCK3
CRITICAL: WSL localhost does NOT map to Windows localhost. You must use the Windows IP address.
3. Model Installation
Recommended Models (in order):
| Model | Size | Notes |
|---|
| SDXL 1.0 | 6.5 GB | Default, reliable |
| JuggernautXL |
6.6 GB | Good alternative |
| SD 3.5 Medium | 10.8 GB | ⚠️ Experimental, needs 16GB+ VRAM |
Installation via ComfyUI Manager:
- 1. Open ComfyUI in browser
- Click "Manager" → "Model Manager"
- Search and download models
Manual Download:
Place .safetensors files in:
CODEBLOCK4
4. Bridge Commands
CODEBLOCK5
On This Day Workflow
Daily cron that generates historical event images:
Setup:
CODEBLOCK6
Cron Job:
- - Runs daily at 8:00 AM America/Chicago
- Uses Wikipedia On This Day API
- Generates SDXL images of pre-event scenes
- Posts to Discord with date + location only
Output Location:
CODEBLOCK7
Discord Integration
The workflow can post to Discord:
CODEBLOCK8
Troubleshooting
ComfyUI Won't Start
- - Use StabilityMatrix to launch (easiest)
- Or: Launch manually from command line with INLINECODE2
Bridge Can't Connect
- - Verify Windows Firewall allows port 8188
- Confirm Windows IP is correct (not 127.0.0.1 from WSL)
- Check ComfyUI is running: visit http://192.168.4.95:8188 in browser
SD 3.5 Fails
- - Use SDXL instead (more reliable on laptops)
- SD 3.5 requires 16GB+ VRAM
Image Generation Slow
- - Reduce resolution: change width/height from 1024 to 512
- Reduce steps: 25 → 15
- Enable VAE tiling if OOM errors
File Structure
CODEBLOCK9
Model Recommendations by Use Case
| Use Case | Recommended Model |
|---|
| Daily automation | SDXL (fast, reliable) |
| Photorealistic |
JuggernautXL |
| Creative/artistic | SDXL + custom prompts |
| Historical scenes | SDXL |
| ⚠️ High detail (16GB+ VRAM) | SD 3.5 |
Security Notes
- - Run ComfyUI locally only
- Don't expose API to internet without authentication
- Store API keys securely
- Don't upload proprietary images to cloud services
Credits
- - ComfyUI: https://github.com/comfyanonymous/ComfyUI
- StabilityMatrix: https://lynxhou.io/StabilityMatrix
- Wikipedia On This Day API
技能名称: on-this-day-art
详细描述:
今日历史艺术技能
概述
该技能提供了一个完整的本地图像生成流程,使用在Windows上运行的ComfyUI(通过StabilityMatrix),并配备WSL到Windows的桥接,供基于Linux的AI代理使用。
前提条件
- - 配备NVIDIA GPU的Windows电脑(推荐RTX 3060以上)
- 已安装StabilityMatrix:https://lynxhou.io/StabilityMatrix
- 在Windows上安装WSL2(Ubuntu或类似版本)
- 模型需要20GB以上可用磁盘空间
架构
[OpenClaw/WSL] --桥接--> [ComfyUI/Windows主机] --GPU--> [图像]
|
[StabilityMatrix]
组件
1. ComfyUI安装
推荐:使用StabilityMatrix
- 1. 从 https://lynxhou.io/StabilityMatrix 下载StabilityMatrix
- 安装并启动
- 点击添加包 → 选择ComfyUI
- 启动ComfyUI并启用API
手动安装替代方案:
bash
在Windows上,克隆ComfyUI
git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
根据ComfyUI文档安装依赖
2. WSL桥接设置
桥接将WSL代理连接到Windows上的ComfyUI:
桥接脚本位置: scripts/comfy-bridge/comfy-bridge.sh
关键配置:
bash
COMFY_HOST=192.168.4.95 # 你的Windows IP(见下文)
COMFY_PORT=8188
查找Windows IP:
powershell
在Windows PowerShell中
Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias Wi-Fi*
关键点: WSL的localhost不会映射到Windows的localhost。你必须使用Windows IP地址。
3. 模型安装
推荐模型(按顺序):
| 模型 | 大小 | 备注 |
|---|
| SDXL 1.0 | 6.5 GB | 默认,可靠 |
| JuggernautXL |
6.6 GB | 良好的替代方案 |
| SD 3.5 Medium | 10.8 GB | ⚠️ 实验性,需要16GB以上显存 |
通过ComfyUI管理器安装:
- 1. 在浏览器中打开ComfyUI
- 点击管理器 → 模型管理器
- 搜索并下载模型
手动下载:
将.safetensors文件放置在:
C:\StabilityMatrix\Data\Packages\ComfyUI\models\checkpoints\
4. 桥接命令
bash
检查ComfyUI状态
./scripts/comfy-bridge/comfy-bridge.sh check
启动ComfyUI(如果需要)
./scripts/comfy-bridge/comfy-bridge.sh launch
使用SDXL生成图像(默认)
./scripts/comfy-bridge/comfy-bridge.sh generate 山上的日落
使用JuggernautXL生成图像
./scripts/comfy-bridge/comfy-bridge.sh juggernaut 山上的日落
列出可用模型
./scripts/comfy-bridge/comfy-bridge.sh models
列出输出图像
./scripts/comfy-bridge/comfy-bridge.sh outputs
今日历史工作流程
每日定时任务,生成历史事件图像:
设置:
bash
工作流程位于:scripts/on-this-day/on-this-day.sh
测试事件获取
./scripts/on-this-day/on-this-day.sh test
运行完整工作流程
./scripts/on-this-day/on-this-day.sh run
定时任务:
- - 每天上午8:00(美国/芝加哥时间)运行
- 使用维基百科今日历史API
- 生成事件发生前场景的SDXL图像
- 仅附带日期和地点发布到Discord
输出位置:
C:\StabilityMatrix\Data\Images\Text2Img\
Discord集成
工作流程可以发布到Discord:
bash
将图像发布到Discord(使用带filePath的消息工具)
./scripts/comfy-bridge/comfy-bridge.sh outputs
然后使用Discord API或消息工具发送
故障排除
ComfyUI无法启动
- - 使用StabilityMatrix启动(最简单)
- 或者:从命令行手动启动,使用 --listen 0.0.0.0 --port 8188
桥接无法连接
- - 确认Windows防火墙允许端口8188
- 确认Windows IP正确(不是WSL中的127.0.0.1)
- 检查ComfyUI是否正在运行:在浏览器中访问 http://192.168.4.95:8188
SD 3.5失败
- - 改用SDXL(在笔记本电脑上更可靠)
- SD 3.5需要16GB以上显存
图像生成缓慢
- - 降低分辨率:将宽度/高度从1024改为512
- 减少步数:25 → 15
- 如果出现OOM错误,启用VAE分块
文件结构
comfy-workflow/
├── SKILL.md # 本文件
├── scripts/
│ ├── comfy-bridge/
│ │ └── comfy-bridge.sh # 主桥接脚本
│ └── on-this-day/
│ └── on-this-day.sh # 每日图像工作流程
└── references/
└── SETUP.md # 详细设置指南
按使用场景的模型推荐
| 使用场景 | 推荐模型 |
|---|
| 每日自动化 | SDXL(快速、可靠) |
| 照片级真实感 |
JuggernautXL |
| 创意/艺术 | SDXL + 自定义提示词 |
| 历史场景 | SDXL |
| ⚠️ 高细节(16GB以上显存) | SD 3.5 |
安全注意事项
- - 仅在本地运行ComfyUI
- 未经身份验证,不要将API暴露到互联网
- 安全存储API密钥
- 不要将专有图像上传到云服务
致谢
- - ComfyUI:https://github.com/comfyanonymous/ComfyUI
- StabilityMatrix:https://lynxhou.io/StabilityMatrix
- 维基百科今日历史API