← Back to Skills Marketplace
enihsago

Image Gen Low Cost

by enihsago · GitHub ↗ · v1.0.5 · MIT-0
cross-platform ⚠ suspicious
166
Downloads
0
Stars
0
Active Installs
6
Versions
Install in OpenClaw
/install image-gen-low-cost
Description
低成本 AI 图片生成 CLI 工具。支持文生图、图片编辑。触发词:生成图片、画图、AI 作图、文生图、图片编辑、imgen。
README (SKILL.md)

Image Gen Low Cost - AI 图片生成 CLI

统一的命令行图片生成工具,支持任何 OpenAI 兼容的 API 端点。

快速开始

1. 获取 API Token

访问 https://api.laozhang.ai/register/?aff_code=lfa0 注册,在控制台获取 token。新注册自动获得 $0.5 开发测试额度。

2. 配置 Token

# 使用 imgen config 命令(推荐)
imgen config --token YOUR_API_TOKEN

# 或使用环境变量
export IMGEN_TOKEN=YOUR_API_TOKEN

2. 文生图

# 生成图片
imgen "一只可爱的猫咪在花园里玩耍"

# 指定输出路径
imgen "夕阳下的海滩" -o beach.png

# 只显示 URL 不保存
imgen "未来城市" --no-save

# 使用不同模型
imgen "可爱的小狗" -m fast

3. 图片编辑

# 编辑图片
imgen edit "https://example.com/cat.jpg" "把猫咪的毛色改成彩虹色"

# 使用预设风格
imgen edit "https://example.com/photo.jpg" --style cartoon

# 多图融合
imgen edit "https://a.jpg,https://b.jpg" "将两张图片融合"

命令参考

imgen "prompt"                     文生图
imgen edit \x3Curl> "prompt"          图片编辑
imgen config --token \x3Ctoken>       配置 API Token
imgen models                       列出可用模型

选项

选项 说明
-m, --model \x3Cname> 模型选择 (cheap/fast/quality)
-o, --output \x3Cpath> 保存到指定路径
--size \x3Csize> 图片尺寸 (1024x1024 等)
--no-save 不保存,只打印 URL
-s, --style \x3Cstyle> 预设风格
-v, --verbose 详细输出

模型

别名 模型 ID 价格 说明
sora sora_image $0.01/张 默认, Sora Image, URL 返回
gpt4o gpt-4o-image $0.01/张 GPT-4o Image, URL 返回
cheap gemini-2.5-flash-image $0.025/张 Nano Banana, base64, 1K 固定
fast gemini-3.1-flash-image-preview $0.045/张 Nano Banana2, base64, 4K 支持
quality gemini-3-pro-image-preview $0.05/张 Nano Banana Pro, base64, 4K + 高级特性

💡 默认使用 sora 模型 ($0.01/张),如 鍗 鍘- 追求极致性价比: 选 sora 或 **- 追求高质量稳定: 选 cheap | **- 追求 4K + 性价比: 选 fast | **- 追求最高质量 + 复杂指令: 选 quality |

预设风格

  • cartoon - 迪士尼卡通风格
  • oil - 古典油画风格
  • ink - 中国水墨画风格
  • cyberpunk - 赛博朋克霓虹风格
  • sketch - 铅笔素描风格
  • watercolor - 水彩画风格

API 端点

默认使用老张 API (https://api.laozhang.ai/v1/chat/completions)。

# 切换到其他 OpenAI 兼容端点
export IMGEN_API_URL=https://api.openai.com/v1/chat/completions

# 使用其他兼容服务
export IMGEN_API_URL=https://your-api-endpoint.com/v1/chat/completions

⚠️ 重要:如果你使用非老张 API 的 token,请确保设置对应的 IMGEN_API_URL,否则 token 会发送到错误的端点。

安装

# 克隆或下载 skill 后
chmod +x scripts/imgen.js

# 添加到 PATH(可选)
ln -s $(pwd)/scripts/imgen.js /usr/local/bin/imgen

环境变量

变量 说明
IMGEN_TOKEN API Token
IMGEN_API_URL 自定义 API 端点

注意事项

  1. 返回的图片 URL 通常是临时的,建议及时保存
  2. 默认保存到当前目录的 generated-images/ 文件夹
  3. Token 存储在 ~/.imgen/token,权限为 600

与 image-gen-cheap 的区别

特性 image-gen-cheap image-gen-low-cost
实现 Python 脚本 Node.js CLI
依赖 requests 无外部依赖
API 固定老张 API 任意 OpenAI 兼容
配置 独立 token 文件 统一 imgen config
Usage Guidance
This skill appears to be what it claims (a Node.js CLI for low-cost image generation), but it has a potentially dangerous usability/credential handling issue: it defaults to a third-party API (laozhang) and will read OPENAI_API_KEY as a fallback token. Before installing or using it: (1) Decide which service you intend to use and explicitly set IMGEN_API_URL to that service (e.g., https://api.openai.com/v1/chat/completions) before providing any token. (2) Prefer creating and using a dedicated token for this tool/service (do not reuse your primary OpenAI key). (3) If you have OPENAI_API_KEY set in your environment and you do not want it used, unset it or use an isolated environment. (4) Inspect the included script (scripts/imgen.js) yourself (it is short and readable) and confirm you are comfortable with the token being saved to ~/.imgen/token; you can instead run with IMGEN_TOKEN in-memory to avoid disk storage. (5) Avoid creating system-wide symlinks (e.g., into /usr/local/bin) unless you trust the package and understand the implications. If you want higher assurance, run the CLI in an isolated environment (container or VM), or use a dedicated, low-privilege API key for this tool.
Capability Assessment
Purpose & Capability
Name, README, SKILL.md and scripts/imgen.js all implement a Node.js CLI for text-to-image and image-editing via an OpenAI-compatible API. The models, CLI commands, token storage, and download logic are consistent with the stated purpose.
Instruction Scope
Runtime instructions stay within the image-generation scope (configure token, set IMGEN_API_URL, run imgen commands). The tool saves tokens to ~/.imgen/token and suggests adding a symlink to /usr/local/bin (optional). One mismatch: code will also read process.env.OPENAI_API_KEY as a fallback token, but SKILL.md documents only IMGEN_TOKEN/IMGEN_API_URL (it does warn broadly about tokens and endpoints).
Install Mechanism
No install spec is provided (instruction-only repo plus a CLI script). The README mentions npm install -g, but the package files included are just the script—no network installs or archive downloads by the skill itself. Risk is low from the install mechanism as shipped.
Credentials
The code uses IMGEN_TOKEN/IMGEN_API_URL (documented) but also silently accepts OPENAI_API_KEY. The default API URL is a third‑party endpoint (https://api.laozhang.ai). If a user has OPENAI_API_KEY set but does not set IMGEN_API_URL to api.openai.com, their OpenAI key could be sent to the laozhang endpoint. This is a design/usability hazard that could lead to inadvertent credential disclosure.
Persistence & Privilege
Skill is not always-enabled, does not request elevated platform privileges, and does not modify other skills. The only persistent change is saving the token to ~/.imgen/token (file mode 600), which is expected for a CLI but worth reviewing.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install image-gen-low-cost
  3. After installation, invoke the skill by name or use /image-gen-low-cost
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.5
Add all 6 models: sora(/bin/zsh.01), gpt4o(/bin/zsh.01), cheap(/bin/zsh.025), fast(/bin/zsh.045), quality(/bin/zsh.05). Default model changed to 'sora' (cheapest). Updated docs with clear pricing guide.
v1.0.4
Switch to Nano Banana models (Gemini-based). Add base64 image support. Models: cheap=gemini-2.5-flash-image (/bin/zsh.025), fast=gemini-3.1-flash-image-preview (/bin/zsh.045), quality=gemini-3-pro-image-preview (/bin/zsh.05)
v1.0.3
Security fix: default API endpoint now matches documentation (laozhang API). Added clear API endpoint documentation to prevent token leakage.
v1.0.2
- 增加了关于如何获取 API token 的说明,并提供注册链接及新用户赠送额度信息 - 更新了文档快速开始部分,明确了注册和获取 token 的步骤 - 其余使用方法和参数未变,功能保持一致
v1.0.1
- Major revamp: Unified OpenAI-compatible CLI, simplified workflow, improved flexibility. - Now supports any OpenAI-compatible API endpoint; configure via imgen config or environment variables. - Improved commands: `imgen` for text-to-image, `imgen edit` for image editing, plus easy model/style selection. - Rewritten documentation in Chinese; clearer quick start and model/style options. - Node.js implementation replaces Python; no external dependencies required. - Old install script removed; new CLI in scripts/imgen.js.
v1.0.0
Initial release - CLI tool for low-cost image generation and editing
Metadata
Slug image-gen-low-cost
Version 1.0.5
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 6
Frequently Asked Questions

What is Image Gen Low Cost?

低成本 AI 图片生成 CLI 工具。支持文生图、图片编辑。触发词:生成图片、画图、AI 作图、文生图、图片编辑、imgen。 It is an AI Agent Skill for Claude Code / OpenClaw, with 166 downloads so far.

How do I install Image Gen Low Cost?

Run "/install image-gen-low-cost" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Image Gen Low Cost free?

Yes, Image Gen Low Cost is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Image Gen Low Cost support?

Image Gen Low Cost is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Image Gen Low Cost?

It is built and maintained by enihsago (@enihsago); the current version is v1.0.5.

💬 Comments