SGLang-Diffusion Image Generation
简介
SGLang-Diffusion Image Generation
原始描述
Generate images using a local SGLang-Diffusion server (FLUX, Stable Diffusion, Qwen-Image, etc.). Use when: user asks to generate, create, draw, or render an...
通过你的 Agent 添加
安装目录:sglang-diffusion/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: sglang-diffusion
description: "Generate images using a local SGLang-Diffusion server (FLUX, Stable Diffusion, Qwen-Image, etc.). Use when: user asks to generate, create, draw, or render an image with a locally running SGLang-Diffusion instance. NOT for: cloud-hosted image APIs (use openai-image-gen or nano-banana-pro instead). Requires a running SGLang-Diffusion server."
homepage: https://github.com/sgl-project/sglang
metadata:
{
"openclaw":
{
"emoji": "🎨",
"requires": { "bins": ["python3"] },
},
}
SGLang-Diffusion Image Generation
Generate images via a local SGLang-Diffusion server's OpenAI-compatible API.
Prerequisites
- SGLang-Diffusion server running (default:
http://127.0.0.1:30000)
- If the server was started with
--api-key, set SGLANG_DIFFUSION_API_KEY env var
Generate an image
python3 {baseDir}/scripts/generate.py --prompt "a futuristic cityscape at sunset"
Useful flags
python3 {baseDir}/scripts/generate.py --prompt "portrait of a cat" --size 512x512
python3 {baseDir}/scripts/generate.py --prompt "abstract art" --negative-prompt "blurry, low quality"
python3 {baseDir}/scripts/generate.py --prompt "landscape" --steps 30 --guidance-scale 7.5 --seed 42
python3 {baseDir}/scripts/generate.py --prompt "photo" --server http://192.168.1.100:30000 --out ./my-image.png
API key (optional)
http://127.0.0.1:30000)--api-key, set SGLANG_DIFFUSION_API_KEY env varpython3 {baseDir}/scripts/generate.py --prompt "a futuristic cityscape at sunset"
Useful flags
python3 {baseDir}/scripts/generate.py --prompt "portrait of a cat" --size 512x512
python3 {baseDir}/scripts/generate.py --prompt "abstract art" --negative-prompt "blurry, low quality"
python3 {baseDir}/scripts/generate.py --prompt "landscape" --steps 30 --guidance-scale 7.5 --seed 42
python3 {baseDir}/scripts/generate.py --prompt "photo" --server http://192.168.1.100:30000 --out ./my-image.png
API key (optional)
python3 {baseDir}/scripts/generate.py --prompt "portrait of a cat" --size 512x512
python3 {baseDir}/scripts/generate.py --prompt "abstract art" --negative-prompt "blurry, low quality"
python3 {baseDir}/scripts/generate.py --prompt "landscape" --steps 30 --guidance-scale 7.5 --seed 42
python3 {baseDir}/scripts/generate.py --prompt "photo" --server http://192.168.1.100:30000 --out ./my-image.png
Only needed if the SGLang-Diffusion server was started with --api-key.
Set SGLANG_DIFFUSION_API_KEY, or pass --api-key directly:
python3 {baseDir}/scripts/generate.py --prompt "hello" --api-key sk-my-key
Or configure in ~/.openclaw/openclaw.json:
{
skills: {
"sglang-diffusion": {
env: { SGLANG_DIFFUSION_API_KEY: "sk-my-key" },
},
},
}
Notes
- The script prints a
MEDIA: line for OpenClaw to auto-attach on supported chat providers.
- Output defaults to timestamped PNG in
/tmp/.
- Do not read the image back; report the saved path only.
MEDIA: line for OpenClaw to auto-attach on supported chat providers./tmp/.正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。