bulkgen

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

BulkGen 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
BULKGEN_API_KEY
before calling the API.
bash
export BULKGEN_API_KEY="sk_live_your_key_here"
调用API前需设置
BULKGEN_API_KEY
bash
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 export
BULKGEN_API_KEY
or paste the key here.
如果未配置密钥,请告知用户:
我需要BulkGen API密钥才能生成图片。请打开https://bulk-gen.com → 用户菜单 → API密钥 → 创建密钥,然后导出
BULKGEN_API_KEY
或在此粘贴密钥。

Quick start

快速开始

bash
undefined
bash
undefined

Single 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
undefined
node scripts/generate.js --prompts "make it watercolor style" --input ./photo.jpg
undefined

Generation modes

生成模式

ModeUse caseExample
solo
One prompt → one imageSingle illustration
batch
Multiple prompts → multiple images4 different product shots
variation
One prompt → creative variants9 style variations of a concept
模式使用场景示例
solo
单个提示词 → 单张图片单幅插画
batch
多个提示词 → 多张图片4张不同的产品图
variation
单个提示词 → 创意变体同一概念的9种风格变体

Key options

核心选项

OptionValuesDefault
--mode
solo, batch, variationbatch
--cols
,
--rows
Grid dimensionsauto
--resolution
1K, 2K, 4K1K
--source-ratio
1:1, 16:9, 9:16, etc.auto best fit
--output-ratio
Tile aspect ratio after split1:1
--input
Reference image pathnone
选项可选值默认值
--mode
solo, batch, variationbatch
--cols
,
--rows
网格尺寸auto
--resolution
1K, 2K, 4K1K
--source-ratio
1:1, 16:9, 9:16等自动适配最佳比例
--output-ratio
分割后单图宽高比1:1
--input
参考图路径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
    --source-ratio
    is omitted, the script auto-picks the best compatible 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
--input
to pass reference images for style transfer or editing:
bash
undefined
使用
--input
参数传入参考图,实现风格迁移或图片编辑:
bash
undefined

Style 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 ./downloads
Use this before signed URLs expire. It saves local files plus
manifest.json
.
bash
node scripts/download_images.js ./bulkgen-result.json ./downloads
请在签名URL过期前执行该操作。脚本会保存本地文件及
manifest.json

Build HTML preview

构建HTML预览页面

bash
node scripts/build_preview.js ./bulkgen-result.json ./preview.html
Creates 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

错误处理

StatusMeaning
401Invalid API key
402Insufficient credits (tell user to top up)
400Invalid parameters or unsupported layout/ratio combo
500/502Server error, suggest retry
状态码含义
401API密钥无效
402余额不足(告知用户需充值)
400参数无效或布局/比例组合不被支持
500/502服务器错误,建议重试

Workflow

工作流

  1. Parse user intent → determine mode, layout, prompts, and whether reference images are needed
  2. Run
    generate.js
    with appropriate options
  3. If the user needs permanent local copies → run
    download_images.js
    before URLs expire
  4. If the user needs a shareable preview page → run
    build_preview.js
  1. 解析用户意图 → 确定生成模式、布局、提示词,以及是否需要参考图
  2. 使用合适的选项运行
    generate.js
  3. 如果用户需要永久本地副本 → 在URL过期前运行
    download_images.js
  4. 如果用户需要可分享的预览页面 → 运行
    build_preview.js