← 返回 Skills 市场
shishugen

LiblibAI

作者 shishugen · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
395
总下载
1
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install liblibai
功能描述
使用 LiblibAI API 从文本或图片生成高清 AI 图像,支持多模型、多参数调整及文件上传,适合创意设计和视觉内容创作。
使用说明 (SKILL.md)

LiblibAI Skill - AI 图像生成

强大的 AI 图像生成工具,基于 LiblibAI(星流)平台。适用于:

  • 🎨 创意设计:概念图、角色设计、场景插画
  • 📱 内容创作:社媒配图、文章插图、营销素材
  • 🔬 视觉实验:风格转换、图像重绘、ControlNet 控制
  • 🛠️ 工作流集成:与其他 OpenClaw 技能组合(如 web_search 找灵感,humanizer 优化提示词)

快速开始

1. 获取 API 凭据

访问 LiblibAI

  1. 注册/登录账户
  2. 进入「API 管理」或「开发者设置」
  3. 创建 AccessKey 和 SecretKey
  4. 设置环境变量(推荐):
export LIBLIBAI_ACCESS_KEY="your-access-key"
export LIBLIBAI_SECRET_KEY="your-secret-key"

或通过 OpenClaw 配置系统设置。

2. 基本生成

# 生成一张 1024x1024 的小狗图片
./skills/liblibai/bin/cli.js text2img -p "一只可爱的小狗,真实照片风格,高清" -W 1024 -H 1024 -s 20

# 查看结果(成功后输出图片 URL)
# 复制 URL 到浏览器即可查看

核心功能

文生图 (text2img)

从文本生成图像,支持完整参数控制。

常用参数:

-p, --prompt \x3Ctext>        正向提示词(必需)
-n, --negative-prompt \x3Ctext>  负向提示词(如 "ugly, blurry")
-W, --width \x3C1024>         图像宽度(建议 512-1536)
-H, --height \x3C1024>        图像高度
-s, --steps \x3C20>           采样步数(10-50,越高越精细)
-c, --cfg-scale \x3C7>        提示词引导系数(1-20)
--sampler \x3C15>             采样方法 ID(15=DPMSolver)
--seed \x3C-1>                随机种子(-1=随机)
-i, --img-count \x3C1>        生成数量(1-4)
-t, --template-uuid \x3Cuuid> 参数模板 ID(在 LiblibAI 平台预设)

示例:

# 生成插画风格头像
./bin/cli.js text2img -p "anime portrait, 1girl, colorful hair, detailed eyes" -W 768 -H 1024 -s 30 -c 8

# 使用预设模板(需要先在平台创建)
./bin/cli.js text2img -p " landscapes" -t "your-template-uuid"

图生图 (img2img)

基于现有图像重绘或风格转换。

特有参数:

-S, --source-image \x3Curl|path>  源图 URL 或本地路径(支持自动上传)
-d, --denoising-strength \x3C0.75> 重绘幅度 (0-1, 越高变化越大)
--resize-mode \x3C0>            缩放模式 (0=拉伸, 1=裁剪, 2=填充)
--mask-image \x3Curl>           蒙版图(用于局部重绘)
--mask-mode \x3C0>              蒙版模式
--inpaint-area \x3C0|1>         重绘区域 (0=全图, 1=仅蒙版)

示例:

# 将照片转为油画风格(自动上传本地文件)
./bin/cli.js img2img -p "oil painting style, Van Gogh" -S ./photo.jpg -d 0.65

# 局部重绘(需要配合蒙版)
./bin/cli.js img2img -p "add a hat" -S original.png --mask-image mask.png --inpaint-area 1

Ultra 模型 (text2img-ultra / img2img-ultra)

更高品质的生成,支持 ControlNet。

特有参数:

-a, --aspect-ratio \x3Cportrait|landscape|square> 宽高比
--controlnet-type \x3Cdepth|canny|...> ControlNet 类型
--controlnet-image \x3Curl>              ControlNet 参考图

示例:

# Ultra 文生图 + ControlNet
./bin/cli.js text2img-ultra -p "masterpiece, 1girl" -a portrait --controlnet-type depth --controlnet-image ref.jpg

文件上传 (upload)

上传本地图片供后续使用。

# 简单上传
./bin/cli.js upload ./my-image.png

# 自定义文件名
./bin/cli.js upload ./photo.jpg -n "reference"

返回的 URL 可用于 img2img 或 ControlNet。

异步任务管理

对于耗时较长的任务( Ultra 模型、复杂工作流):

# 提交任务(返回 UUID)
UUID=$(./bin/cli.js submit text2img -p "complex scene")

# 检查状态
./bin/cli.js status $UUID

# 等待完成(自动轮询)
./bin/cli.js wait $UUID --interval 5000 --timeout 600000

典型工作流示例

工作流 1:概念设计迭代

# 1. 生成多个版本的草图(不同种子)
for seed in {1..5}; do
  ./bin/cli.js text2img -p "character design, fantasy warrior" --seed $seed -W 512 -H 512 -s 15
done

# 2. 选择最佳的一张进行风格重绘
./bin/cli.js img2img -p "watercolor painting" -S best-sketch.png -d 0.7

# 3. Ultra 提升细节
./bin/cli.js text2img-ultra -p "high detail, refined" -a portrait --controlnet-type depth -S refined.png

工作流 2:批量生成营销配图

# 使用脚本循环生成
for product in "咖啡杯" "笔记本" "耳机"; do
  ./bin/cli.js text2img -p "$product on white background, product photography" -W 1024 -H 1024 -s 25 &
done
wait

故障排除

认证失败

Error: LiblibAI credentials not found

解决:确保环境变量已设置。测试:

echo $LIBLIBAI_ACCESS_KEY
echo $LIBLIBAI_SECRET_KEY

如果为空,请在 ~/.zshrc 或当前 shell 中 export。

速率限制

返回 429 错误。 解决:添加延迟(sleep 2-3 秒)或减少生成频率。

模板 UUID 问题

某些高级功能需要平台预设的模板 UUID。 解决:登录 LiblibAI 网页版,在「模板」或「工作流」中创建并获取 ID。

文件上传失败

Error: File size exceeds limit

解决:确保文件 \x3C 10MB,格式为 PNG/JPG/JPEG/WebP。

网络超时

中国用户可能需要代理访问 international API。 解决:设置 LIBLIBAI_BASE_URL 为国内镜像(如有),或使用稳定网络。


与其他技能集成

结合 web_search 获取灵感

# 搜索当前流行设计风格
web_search "2025 UI design trends"

# 用搜索结果作为提示词
./bin/cli.js text2img -p "modern UI design, dark theme, glassmorphism" -W 1280 -H 720

结合 humanizer 优化提示词

# 用 humanizer 润色提示词,使结果更自然
# 先在聊天中让 humanizer 优化描述,再传入 text2img

在自动化工作流中使用

# 示例:生成配图并写入 MEMORY.md
URL=$(./bin/cli.js text2img -p "workflow diagram" -W 1200 -H 600 | grep -o 'https://[^"]*png')
echo "今日生成的流程图: $URL" >> memory/$(date +%Y-%m-%d).md

成本与积分

  • 消耗:每次生成消耗 2-5 积分(取决于分辨率、步数、模型)
  • 查询余额:运行任意命令后,输出中的 accountBalance 显示剩余积分
  • 充值:在 LiblibAI 平台充值增加积分

建议:先用小分辨率(512x512)测试提示词,再放大生成以节省积分。


参数参考表

参数 类型 默认 说明
prompt string 必需 正向提示词,描述你想生成的图像
negativePrompt string - 负向提示词,排除不想要的元素
width/height number 768/1024 图像尺寸(建议 512 的倍数)
steps number 20 采样步数,质量与速度平衡
cfgScale number 7 提示词遵循度
sampler number 15 采样器 ID(15=DPMSolver++)
seed number -1 随机种子(固定种子可复现结果)
imgCount number 1 生成数量(1-4)
templateUuid string - 预设模板 ID(平台创建)

提示词技巧

  • 使用逗号分隔"cat, cute, photorealistic, 8k"
  • 权重语法"(masterpiece:1.2)" 提升权重
  • 负面提示词:始终添加 "ugly, blurry, low quality, watermark"
  • 风格引用"by Greg Rutkowski""Studio Ghibli style"
  • 质量词"masterpiece, best quality, highres, 8k"

技术细节

  • SDK: 使用官方 liblibai npm 包(v0.0.11)
  • API: 兼容 OpenAI DALL-E 风格接口
  • 超时: 默认 5 分钟,可通过 --timeout 调整
  • 轮询间隔: 默认 3 秒检查状态

版本历史

v1.0.0 (2026-03-13)

  • 初始发布
  • 完整 CLI 支持(text2img, img2img, upload, status, wait)
  • 优化输出格式(清晰图片链接)
  • 环境变量配置

相关链接


许可

MIT License - 自由使用、修改和分发。


最后更新: 2026-03-13 · 上海

安全使用建议
This skill appears to be a straightforward LiblibAI API client and CLI, but there are important inconsistencies you should check before installing: - The SKILL.md and code require node/npm and two secret environment variables (LIBLIBAI_ACCESS_KEY and LIBLIBAI_SECRET_KEY), yet the registry metadata lists none — confirm the platform will prompt you to provide these credentials and binaries before use. - The skill depends on the npm package 'liblibai' ([email protected]). Verify the npm package source, its publisher, and review its code or trustworthiness (or run in an isolated environment) because this dependency will be installed and will handle your API keys and file uploads. - The CLI uploads local files to the LiblibAI service; do not upload sensitive images you wouldn't want sent to an external service. Confirm the LIBLIBAI_BASE_URL matches the official endpoint if you have concerns about where data is being sent. - If you rely on this skill in automated runs, ensure credentials are stored securely (not in plain shell history) and consider using least-privilege API keys. If you want higher confidence, ask the skill author or registry owner to fix the metadata to declare required binaries/env vars, and inspect the 'liblibai' npm package source before use.
功能分析
Type: OpenClaw Skill Name: liblibai Version: 1.0.0 The skill bundle is a standard integration for the LiblibAI image generation platform, providing a CLI tool (`bin/cli.js`) and a library wrapper (`lib/client.js`) for the official API. While it requests broad permissions such as `Exec` and `Read` (necessary for running the CLI and uploading local images), the code logic is transparent, lacks obfuscation, and is strictly aligned with the stated purpose of AI image generation. No evidence of malicious intent, data exfiltration, or prompt injection was found in the documentation or implementation.
能力评估
Purpose & Capability
The skill name, description, SKILL.md, lib/client.js and bin/cli.js consistently implement an API client/CLI for LiblibAI (text2img, img2img, uploads, async tasks). Requiring API keys and a base URL is appropriate for this purpose. However, the registry metadata provided at the top lists no required environment variables or binaries, while SKILL.md and the code do require node/npm and LIBLIBAI_ACCESS_KEY/LIBLIBAI_SECRET_KEY — this mismatch is unexpected.
Instruction Scope
SKILL.md instructs only on obtaining API credentials, running the CLI, uploading local images, and using the API — all within the stated image-generation scope. The CLI reads local files for upload (expected) and prints API responses; examples show writing a URL to a memory file, which is a benign integration example. There are no instructions to read unrelated system files or exfiltrate data beyond the LiblibAI service.
Install Mechanism
The package uses a standard npm dependency (liblibai@^0.0.11) resolved from the public npm registry according to package-lock.json. Installing from npm is a common, moderate-risk approach. SKILL.md includes an npm install step (pkg: liblibai) but the registry-level install spec claims 'No install spec' — the discrepancy between where install instructions live is a coherence issue to be aware of. No arbitrary URL downloads or extract operations are present.
Credentials
The SKILL.md and code require LIBLIBAI_ACCESS_KEY and LIBLIBAI_SECRET_KEY (and an optional LIBLIBAI_BASE_URL), which are proportional to an API client. The problem is that the registry metadata at the top reported 'Required env vars: none' and 'Required binaries: none' despite SKILL.md declaring node/npm and the two credentials as required — this inconsistency should be resolved before trusting automatic install/config flows.
Persistence & Privilege
The skill does not request always:true, does not modify other skills, and has normal user-invocable/autonomous settings. It does not request system-wide privileges beyond running node/npm and reading files to upload, which is expected for a CLI that uploads images.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install liblibai
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /liblibai 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of liblibai skill. - Provides AI image generation services powered by the LiblibAI API. - Supports text-to-image, image-to-image, Ultra models, ComfyUI workflows, and file uploads. - Allows configuration of API access and base URL. - Requires node and npm, with installation via the liblibai npm package. - Licensed under MIT.
元数据
Slug liblibai
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

LiblibAI 是什么?

使用 LiblibAI API 从文本或图片生成高清 AI 图像,支持多模型、多参数调整及文件上传,适合创意设计和视觉内容创作。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 395 次。

如何安装 LiblibAI?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install liblibai」即可一键安装,无需额外配置。

LiblibAI 是免费的吗?

是的,LiblibAI 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

LiblibAI 支持哪些平台?

LiblibAI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 LiblibAI?

由 shishugen(@shishugen)开发并维护,当前版本 v1.0.0。

💬 留言讨论