← 返回 Skills 市场
94
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install axelhu-local-sdxl
功能描述
基于本地 ComfyUI 与 SDXL,实现高质量私密图像生成,支持详细构图、风格及尺寸自定义,适合无在线API场景。
使用说明 (SKILL.md)
本地 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
参数说明
| 参数 | 默认值 | 说明 |
|---|---|---|
--prompt |
(必填) | 图片描述,越详细越好 |
--negative |
"blurry, low quality, distorted" | 反向提示词 |
--steps |
20 | 采样步数,越高质量越好越慢 |
--seed |
随机 | 种子,决定具体画面 |
--width |
1024 | 宽度(8的倍数) |
--height |
768 | 高度(8的倍数) |
--sampler |
euler | 采样器(euler/dpmpp_2m/lcm/ddim) |
--cfg |
7.0 | CFG 强度(1-20) |
--output |
自动 | 输出路径 |
快速参考:常用场景
| 场景 | 推荐参数 |
|---|---|
| 写实风景/人物 | --steps 25 --cfg 7 --sampler euler |
| 动漫/插画风格 | --steps 20 --cfg 8 --negative "写实, 照片" |
| 快速草图/验证 | --steps 4 --sampler lcm --cfg 1.0(需要 LCM 模型) |
| 16:9 横幅图 | --width 1280 --height 720 |
输出格式
生图完成后,脚本自动将图片保存到指定路径或 /tmp/ 目录,并通过飞书发送图片消息给用户。
注意事项
- ComfyUI 服务必须已启动(
python3 main.py --port 8188) - RTX 3080 推荐分辨率 1024×768 以下,更高分辨率可能爆显存
- 生图过程约 18 秒,请提前告知用户等待
- 图片风格默认写实,如需特定风格在 prompt 中描述
安全使用建议
This skill appears to be a local ComfyUI SDXL helper and mostly does what it says, but there are a few things to check before installing or running it: 1) The SKILL.md mentions automatically sending results via Feishu, but neither script contains any Feishu or external messaging code — expect to handle delivery yourself or add secure messaging code (and then securely store credentials). 2) The Python script uses hardcoded paths (/home/axelhu/ComfyUI/output/) and will fail or read unexpected files on other systems — update the script to use configurable output directories before running. 3) Ensure ComfyUI is only listening on localhost (127.0.0.1) as recommended to avoid remote access, and confirm model files are present locally (large download). 4) Review and run the scripts as a non-root user, and inspect the code (simple HTTP calls to localhost and local filesystem operations) to satisfy yourself there is no data exfiltration. If you need the Feishu/send behavior, require that the skill request explicit credentials and implement them transparently rather than claiming the capability without code.
功能分析
Type: OpenClaw Skill
Name: axelhu-local-sdxl
Version: 1.0.1
The skill bundle provides a legitimate toolset for local image generation using ComfyUI and SDXL. The Python script `scripts/sdxl_generate.py` and shell script `scripts/start-comfyui.sh` are transparently written to manage local processes and interact with a local REST API (localhost:8188). The instructions in `SKILL.md` are well-defined, providing clear triggers and usage examples without any signs of prompt injection, data exfiltration, or unauthorized execution. While it contains hardcoded paths specific to the author's environment (e.g., `/home/axelhu/`), there is no evidence of malicious intent.
能力评估
Purpose & Capability
The name/description (local ComfyUI + SDXL) aligns with the included scripts and REST examples. However the SKILL.md claims the script will "通过飞书发送图片消息给用户" (send results via Feishu), but no code implements Feishu or any external messaging — a discrepancy between claimed capabilities and actual implementation. The script also hardcodes paths and filenames under /home/axelhu which is specific to the author's environment and may not work for other users.
Instruction Scope
Runtime instructions are focused on running the local script or calling ComfyUI's REST API on localhost:8188, which is appropriate. The script only talks to localhost and the ComfyUI API and reads local output directories. It does, however, read a hardcoded output directory (/home/axelhu/ComfyUI/output/) rather than using a configurable path in several places, which is scope-coupled to the author's environment and could cause unexpected file reads on install.
Install Mechanism
There is no install spec (instruction-only skill) and the files are small scripts and docs. No download-from-URL or package installation is defined by the skill itself. The deployment notes correctly describe a large local model requirement (sdxl-base-1.0.safetensors ~6.5GB), which is expected for the stated purpose.
Credentials
The skill requests no environment variables or credentials, which is proportionate — except SKILL.md claims automatic sending via Feishu (which would normally require credentials). That capability is asserted but not implemented in the code and yet no env vars/credentials are requested. The hardcoded filesystem paths (/home/axelhu/...) are a privacy/permission concern because the script enumerates and copies files from that directory.
Persistence & Privilege
Skill does not ask for persistent privileges; always=false and no modifications to other skills or system-wide settings. The script runs only on-demand and only communicates with localhost:8188 (ComfyUI) — no autonomous remote callbacks are present.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install axelhu-local-sdxl - 安装完成后,直接呼叫该 Skill 的名称或使用
/axelhu-local-sdxl触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Version 1.0.1
- 调整了触发条件,明确要求需用户/agent 明确指定"本地"、"私密"等关键词才会调本地生图
- 默认情况及普通"生成图片"请求将优先走在线服务,不再自动触发本地生图
- 新增部署说明文档 references/deployment.md
- 新增 ComfyUI 启动脚本 scripts/start-comfyui.sh
v1.0.0
- Initial release of axelhu-local-sdxl: a local image generation skill based on ComfyUI + SDXL.
- Supports high-quality image, material, and private generation scenarios without online API limits.
- Triggered when users request image creation without specifying online models.
- Provides detailed usage instructions, script/API integration methods, and full parameter guide.
- Output images locally and send results via Feishu.
元数据
常见问题
Axelhu Local Sdxl 是什么?
基于本地 ComfyUI 与 SDXL,实现高质量私密图像生成,支持详细构图、风格及尺寸自定义,适合无在线API场景。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 94 次。
如何安装 Axelhu Local Sdxl?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install axelhu-local-sdxl」即可一键安装,无需额外配置。
Axelhu Local Sdxl 是免费的吗?
是的,Axelhu Local Sdxl 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Axelhu Local Sdxl 支持哪些平台?
Axelhu Local Sdxl 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Axelhu Local Sdxl?
由 AxelHu(@axelhu)开发并维护,当前版本 v1.0.1。
推荐 Skills