JavaScript 工具
Photo Relic 图像生成脚本
relic_gen*.js
基于 Node 的图像生成脚本,支持多通道 API,含批量生成与自动重试。
| 文件 | 通道 | 密钥变量 |
|---|---|---|
relic_gen_agnes.js | Agnes AI | AGNES_API_KEY |
relic_gen_dashscope.js | DashScope | DASHSCOPE_API_KEY |
用法
# Agnes 通道
node javascript/relic_gen_agnes.js "prompt" --width 1024 --height 1024
# DashScope 通道
node javascript/relic_gen_dashscope.js "prompt" --ratio 3:4
参数
| 参数 | 说明 | 默认 |
|---|---|---|
prompt | 图像描述,必填 | — |
--width | 宽度 | 1024 |
--height | 高度 | 1024 |
--ratio | 长宽比 | 1:1 |
--output | 输出目录 | ./output |
依赖
npm install axios dotenv
更新于 2026-09 · Node 18+