vectronode-image

v2026.09.24

VectorNode 中转站 GPT Image 图片生成与编辑(按提示词长度自动路由 gpt-image-2 Token 计费 / gpt-image-2-all 按次计费)。Use when: 画图、生图、生成图片、gpt生图、VectorNode、gpt-image、image generate、image edit、编辑图片。Requires VECTORNODE_API_KEY in ~/.openclaw/.env.

GitHub
安装命令
npx skhub add aaaaqwq/vectronode-image
Markdown
SKILL.md

VectorNode Image — GPT Image 智能生图

VectorNode 中转站(https://www.vectronode.com/)的 GPT Image 生图/编辑能力,按提示词长度自动路由最优接口,兼顾成本与质量。

两个模型,一套接口

模型计费方式适用场景
gpt-image-2按 Token 计费短提示词(≤200 字符)更划算
gpt-image-2-all按次计费长提示词/复杂描述/多图/高分辨率更稳

两个模型都调用同一个 endpoint:POST {VECTORNODE_BASE_URL}/v1/images/generations(JSON)。区别只在 model 字段。

路由策略(自动)

脚本 vectronode_image.py 会根据以下因素自动选择最优模型:

判断流程:
1. 用户显式指定 model? → 使用指定的
2. prompt 长度 > 200 字符? → gpt-image-2-all(按次,长 prompt 友好)
3. n > 1 或 size >= 2K 或 quality == "high"? → gpt-image-2-all
4. 否则 → gpt-image-2(按 Token,节省成本)

快速使用

生成图片

python3 ~/.openclaw/skills/vectronode-image/scripts/vectronode_image.py generate \
  --prompt "A cute cat in a cyberpunk city" \
  --output ~/clawd/output/cat.png \
  --size 1024x1024

编辑图片

python3 ~/.openclaw/skills/vectronode-image/scripts/vectronode_image.py edit \
  --image ~/clawd/photos/hero.jpg \
  --prompt "Change background to sunset over mountains" \
  --output ~/clawd/output/hero-edited.png

强制模型

# 强制走按次计费(长/复杂任务)
python3 ~/.openclaw/skills/vectronode-image/scripts/vectronode_image.py generate \
  --prompt "..." --output out.png --model gpt-image-2-all

# 强制走按Token计费(短/简单任务)
python3 ~/.openclaw/skills/vectronode-image/scripts/vectronode_image.py generate \
  --prompt "..." --output out.png --model gpt-image-2

预览路由决策(不真发请求)

python3 ~/.openclaw/skills/vectronode-image/scripts/vectronode_image.py generate \
  --prompt "..." --output out.png --dry-run

必填环境变量

变量来源必填
VECTORNODE_API_KEY~/.openclaw/.env✅
VECTORNODE_BASE_URL~/.openclaw/.env(默认 https://www.vectronode.com/)可选

加载顺序:env → ~/.openclaw/.env → 报错。

支持参数

Flag说明默认
--prompt提示词(必填,generate)—
--image输入图片路径(必填,edit)—
--mask编辑遮罩 PNG(可选,edit)—
--output输出文件路径(必填)—
--modelgpt-image-2 / gpt-image-2-all / autoauto
--n张数(1-10)1
--size1024x1024 / 1536x1024 / 1024x1536 / 2K / 4K / autoauto
--qualitylow / medium / high / autoauto
--formatpng / jpeg / webppng
--backgroundtransparent / opaque / autoauto
--dry-run仅打印路由决策false

支持的尺寸

尺寸说明
1024x1024默认
1536x1024 / 1024x1536横竖版
2048x2048 / 2048x11522K
3840x2160 / 2160x38404K(需 gpt-image-2-all)
auto模型自动选

路由决策示例

Prompt 长度nsizequality→ 模型理由
50 字符11024x1024autogpt-image-2短,Token 计费便宜
250 字符11024x1024autogpt-image-2-all长 prompt,按次更划算
50 字符41024x1024autogpt-image-2-all多图,按次计费
50 字符12048x2048autogpt-image-2-all2K,按次计费
50 字符11024x1024highgpt-image-2-allhigh quality,按次更稳

输出格式

API 返回 b64_json,脚本自动解码保存到 --output 路径(PNG/JPEG/WebP)。

错误处理

  • 401 → 检查 VECTORNODE_API_KEY 是否正确
  • 429 → 触发限流,脚本自动 sleep 2s 重试一次
  • 400 → 提示词超过 1000 字符或参数不合法
  • 5xx → 中转站故障,提示重试

相关文档

发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

Sep 24, 2026

分类

未分类

许可证

MIT

源路径

skills/vectronode-image

默认分支

main

最新提交

b996aac

Tree SHA

07e787b