bulkgen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBulkGen Agent Skill
BulkGen Agent Skill
Generate AI images with BulkGen. Use the bundled scripts for API calls, downloads, and HTML previews.
通过BulkGen生成AI图片。使用配套脚本完成API调用、图片下载和HTML预览操作。
Setup
配置步骤
Set before calling the API.
BULKGEN_API_KEYbash
export BULKGEN_API_KEY="sk_live_your_key_here"调用API前需设置。
BULKGEN_API_KEYbash
export BULKGEN_API_KEY="sk_live_your_key_here"Missing key fallback
缺失密钥的 fallback 处理
If the key is missing, tell the user:
I need a BulkGen API key to generate images. Please open https://bulk-gen.com → user menu → API Keys → create a key, then either exportor paste the key here.BULKGEN_API_KEY
如果未配置密钥,请告知用户:
我需要BulkGen API密钥才能生成图片。请打开https://bulk-gen.com → 用户菜单 → API密钥 → 创建密钥,然后导出或在此粘贴密钥。BULKGEN_API_KEY
Quick start
快速开始
bash
undefinedbash
undefinedSingle image
单张图片
node scripts/generate.js --prompts "a sunset over mountains" --mode solo
node scripts/generate.js --prompts "a sunset over mountains" --mode solo
2x2 grid with different prompts
2x2网格图(不同提示词)
node scripts/generate.js --prompts "cat" "dog" "bird" "fish" --cols 2 --rows 2 --output-ratio 1:1
node scripts/generate.js --prompts "cat" "dog" "bird" "fish" --cols 2 --rows 2 --output-ratio 1:1
3x3 variations of one concept
同一概念的3x3变体图
node scripts/generate.js --prompts "cyberpunk city" --mode variation --cols 3 --rows 3 --output-ratio 4:5
node scripts/generate.js --prompts "cyberpunk city" --mode variation --cols 3 --rows 3 --output-ratio 4:5
Edit image with reference
基于参考图编辑
node scripts/generate.js --prompts "make it watercolor style" --input ./photo.jpg
undefinednode scripts/generate.js --prompts "make it watercolor style" --input ./photo.jpg
undefinedGeneration modes
生成模式
| Mode | Use case | Example |
|---|---|---|
| One prompt → one image | Single illustration |
| Multiple prompts → multiple images | 4 different product shots |
| One prompt → creative variants | 9 style variations of a concept |
| 模式 | 使用场景 | 示例 |
|---|---|---|
| 单个提示词 → 单张图片 | 单幅插画 |
| 多个提示词 → 多张图片 | 4张不同的产品图 |
| 单个提示词 → 创意变体 | 同一概念的9种风格变体 |
Key options
核心选项
| Option | Values | Default |
|---|---|---|
| solo, batch, variation | batch |
| Grid dimensions | auto |
| 1K, 2K, 4K | 1K |
| 1:1, 16:9, 9:16, etc. | auto best fit |
| Tile aspect ratio after split | 1:1 |
| Reference image path | none |
| 选项 | 可选值 | 默认值 |
|---|---|---|
| solo, batch, variation | batch |
| 网格尺寸 | auto |
| 1K, 2K, 4K | 1K |
| 1:1, 16:9, 9:16等 | 自动适配最佳比例 |
| 分割后单图宽高比 | 1:1 |
| 参考图路径 | none |
Layout and ratio rules
布局与比例规则
- Valid layouts:
1x1, 2x1, 1x2, 3x1, 1x3, 2x2, 3x2, 2x3, 4x2, 2x4, 3x3, 4x3, 3x4, 4x4 - Not every grid supports every output ratio cleanly
- If is omitted, the script auto-picks the best compatible source ratio
--source-ratio - If a layout / output-ratio / source-ratio combination is unsupported, the script stops early and suggests a compatible source ratio
- 支持的布局:
1x1, 2x1, 1x2, 3x1, 1x3, 2x2, 3x2, 2x3, 4x2, 2x4, 3x3, 4x3, 3x4, 4x4 - 并非所有网格都能完美适配所有输出比例
- 若未指定,脚本会自动选择最佳兼容的源比例
--source-ratio - 如果布局/输出比例/源比例的组合不被支持,脚本会提前终止并建议兼容的源比例
Reference images (editing)
参考图(编辑功能)
Use to pass reference images for style transfer or editing:
--inputbash
undefined使用参数传入参考图,实现风格迁移或图片编辑:
--inputbash
undefinedStyle transfer
风格迁移
node scripts/generate.js --prompts "turn into oil painting" --input ./photo.jpg
node scripts/generate.js --prompts "turn into oil painting" --input ./photo.jpg
Multiple references
多张参考图
node scripts/generate.js --prompts "combine these" --input ./a.jpg --input ./b.jpg
Limits: up to 14 images, 7 MB each. Supported formats: PNG, JPG, WebP, HEIC, HEIF.node scripts/generate.js --prompts "combine these" --input ./a.jpg --input ./b.jpg
限制条件:最多支持14张图片,单张不超过7MB。支持格式:PNG、JPG、WebP、HEIC、HEIF。Post-generation
生成后操作
Download images locally
本地下载图片
bash
node scripts/download_images.js ./bulkgen-result.json ./downloadsUse this before signed URLs expire. It saves local files plus .
manifest.jsonbash
node scripts/download_images.js ./bulkgen-result.json ./downloads请在签名URL过期前执行该操作。脚本会保存本地文件及。
manifest.jsonBuild HTML preview
构建HTML预览页面
bash
node scripts/build_preview.js ./bulkgen-result.json ./preview.htmlCreates a polished gallery page with grid preview and per-image download buttons for quick review and handoff.
bash
node scripts/build_preview.js ./bulkgen-result.json ./preview.html创建一个精美的图库页面,包含网格预览和单图下载按钮,方便快速查看和交付。
Error handling
错误处理
| Status | Meaning |
|---|---|
| 401 | Invalid API key |
| 402 | Insufficient credits (tell user to top up) |
| 400 | Invalid parameters or unsupported layout/ratio combo |
| 500/502 | Server error, suggest retry |
| 状态码 | 含义 |
|---|---|
| 401 | API密钥无效 |
| 402 | 余额不足(告知用户需充值) |
| 400 | 参数无效或布局/比例组合不被支持 |
| 500/502 | 服务器错误,建议重试 |
Workflow
工作流
- Parse user intent → determine mode, layout, prompts, and whether reference images are needed
- Run with appropriate options
generate.js - If the user needs permanent local copies → run before URLs expire
download_images.js - If the user needs a shareable preview page → run
build_preview.js
- 解析用户意图 → 确定生成模式、布局、提示词,以及是否需要参考图
- 使用合适的选项运行
generate.js - 如果用户需要永久本地副本 → 在URL过期前运行
download_images.js - 如果用户需要可分享的预览页面 → 运行
build_preview.js