Axelhu Local Sdxl
Skill by axelhu
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/axelhu/axelhu-local-sdxl本地 SDXL 生图 (axelhu-local-sdxl)
基于 ComfyUI + SDXL 的本地图片生成技能。适用于需要高质量配图、素材生成、本地私密生图、或对在线生成有频率限制的场景。
触发时机
在以下场景时使用:
- 用户/其他 agent 说"本地生图"、"本地SD生图"、"用本地工具生成图片"
- 用户/其他 agent 说"私密生图"、"脱敏生图"、"不上传在线"
- 需要生成涉及隐私、测试、商业素材的内容,且明确指定本地处理
- 需要精细控制构图、风格、尺寸的生图任务,且指定本地执行
不要用于:
- 默认生图请求(那些默认走在线服务,如 Midjourney/DALL-E)
- 用户说"生成图片"、"画一张图"且没有指定本地(默认在线优先)
使用方式
直接描述想要的图片内容,例如:
- "帮我生成一张科技感十足的封面图"
- "画一个程序员深夜编程的场景,插画风格"
- "生成一张杭州西湖的夜景图,高清写实风格"
Agent 收到后执行生图脚本,发送结果给用户。
技术规格
| 项目 | 参数 |
|---|---|
| 模型 | Stable Diffusion XL 1.0 (fp16) |
| 显卡 | NVIDIA RTX 3080 (10GB VRAM) |
| 出图尺寸 | 默认 1024×768,可调整 |
| 生图速度 | ~18秒/张(euler 采样,20步) |
| 可用采样器 | euler, dpmpp_2m, lcm, ddim 等 |
| API 端口 | localhost:8188 |
Agent 调用方法
方式一:通过脚本调用(推荐)
import subprocess
result = subprocess.run(
["python3", "/path/to/scripts/sdxl_generate.py",
"--prompt", "一只狐狸在森林里",
"--negative", "模糊, 低质量",
"--steps", "20",
"--seed", "42",
"--output", "/tmp/output.png"],
capture_output=True, text=True
)
print(result.stdout)
方式二:直接调 ComfyUI REST API
import requests, time, json
COMFYUI = "http://localhost:8188"
def generate(prompt, negative="", steps=20, seed=42, width=1024, height=768):
workflow = {
"loader": {"class_type": "CheckpointLoaderSimple",
"inputs": {"ckpt_name": "sdxl-base-1.0.safetensors"}},
"positive": {"class_type": "CLIPTextEncode",
"inputs": {"text": prompt, "clip": ["loader", 1]}},
"negative": {"class_type": "CLIPTextEncode",
"inputs": {"text": negative, "clip": ["loader", 1]}},
"latent": {"class_type": "EmptyLatentImage",
"inputs": {"width": width, "height": height, "batch_size": 1}},
"sampler": {"class_type": "KSampler",
"inputs": {"seed": seed, "steps": steps, "cfg": 7.0,
"sampler_name": "euler", "scheduler": "normal",
"denoise": 1.0,
"positive": ["positive", 0], "negative": ["negative", 0],
"model": ["loader", 0], "latent_image": ["latent", 0]}},
"decode": {"class_type": "VAEDecode",
"inputs": {"samples": ["sampler", 0], "vae": ["loader", 2]}},
"save": {"class_type": "SaveImage",
"inputs": {"images": ["decode", 0], "filename_prefix": "sdxl_gen"}}
}
r = requests.post(f"{COMFYUI}/prompt", json={"prompt": workflow})
pid = r.json()["prompt_id"]
# 等待完成(轮询)
for _ in range(30):
time.sleep(2)
hist = requests.get(f"{COMFYUI}/history/{pid}").json()
if pid in hist:
return f"{COMFYUI}/view?filename=sdxl_gen_00001_.png"
return None
参数说明
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-axelhu-axelhu-local-sdxl": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
Openclaw Sleep
Skill by axelhu
superpowers-overview
Use when starting any development work or when unsure which superpowers development skill to use - provides entry point and navigation to the full superpowers skill suite for OpenClaw agents
superpowers-subagent-dev
Use when executing implementation plans with independent tasks - coordinates task execution by dispatching subagents per task with verification checkpoints, adapted for OpenClaw's isolated session model
contacts
通讯录查询与维护技能。用于查找联系人信息(open_id、chat_id、account_id 等)、记录新联系人、或查询历史沟通偏好。触发时机:(1) 需要 @某人或向某渠道发消息时 (2) 认识新联系人后需要录入通讯录时 (3) 查询某人的联系方式或交流偏好时 (4) 询问"谁知道xxx的飞书ID"或"怎么联系xxx"时。
superpowers-executing-plans
Use when executing a written implementation plan in the current session with sequential task execution and review checkpoints - for when subagent-driven mode is not available