Baoyu Image Gen
AI image generation with OpenAI, Google, DashScope and Replicate APIs. Supports text-to-image, reference images, aspect ratios. Sequential by default; parall...
AI image generation with OpenAI, Google, DashScope and Replicate APIs. Supports text-to-image, reference images, aspect ratios. Sequential by default; parall...
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
Official API-based image generation. Supports OpenAI, Google, DashScope (阿里通义万象) and Replicate providers.
Agent Execution:
SKILL_DIR = this SKILL.md file's directory${SKILL_DIR}/scripts/main.tsCRITICAL: This step MUST complete BEFORE any image generation. Do NOT skip or defer.
Check EXTEND.md existence (priority: project → user):
test -f .baoyu-skills/baoyu-image-gen/EXTEND.md && echo "project" test -f "$HOME/.baoyu-skills/baoyu-image-gen/EXTEND.md" && echo "user"
| Result | Action |
|---|---|
| Found | Load, parse, apply settings. If is null → ask model only (Flow 2) |
| Not found | ⛔ Run first-time setup (references/config/first-time-setup.md) → Save EXTEND.md → Then continue |
CRITICAL: If not found, complete the full setup (provider + model + quality + save location) using AskUserQuestion BEFORE generating any images. Generation is BLOCKED until EXTEND.md is created.
| Path | Location |
|---|---|
| Project directory |
| User home |
EXTEND.md Supports: Default provider | Default quality | Default aspect ratio | Default image size | Default models
Schema:
references/config/preferences-schema.md
# Basic npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image cat.pngWith aspect ratio
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A landscape" --image out.png --ar 16:9
High quality
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --quality 2k
From prompt files
npx -y bun ${SKILL_DIR}/scripts/main.ts --promptfiles system.md content.md --image out.png
With reference images (Google multimodal or OpenAI edits)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Make blue" --image out.png --ref source.png
With reference images (explicit provider/model)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Make blue" --image out.png --provider google --model gemini-3-pro-image-preview --ref source.png
Specific provider
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --provider openai
DashScope (阿里通义万象)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "一只可爱的猫" --image out.png --provider dashscope
Replicate (google/nano-banana-pro)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --provider replicate
Replicate with specific model
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --provider replicate --model google/nano-banana
| Option | Description |
|---|---|
, | Prompt text |
| Read prompt from files (concatenated) |
| Output image path (required) |
| Force provider (default: google) |
, | Model ID (Google: , ; OpenAI: ) |
| Aspect ratio (e.g., , , ) |
| Size (e.g., ) |
| Quality preset (default: 2k) |
| Image size for Google (default: from quality) |
| Reference images. Supported by Google multimodal (, , ) and OpenAI edits (GPT Image models). If provider omitted: Google first, then OpenAI |
| Number of images |
| JSON output |
| Variable | Description |
|---|---|
| OpenAI API key |
| Google API key |
| DashScope API key (阿里云) |
| Replicate API token |
| OpenAI model override |
| Google model override |
| DashScope model override (default: z-image-turbo) |
| Replicate model override (default: google/nano-banana-pro) |
| Custom OpenAI endpoint |
| Custom Google endpoint |
| Custom DashScope endpoint |
| Custom Replicate endpoint |
Load Priority: CLI args > EXTEND.md > env vars >
<cwd>/.baoyu-skills/.env > ~/.baoyu-skills/.env
When using
--provider replicate, the model can be configured in the following ways (highest priority first):
--model <owner/name>default_model.replicateREPLICATE_IMAGE_MODELgoogle/nano-banana-proSupported model formats:
owner/name (recommended for official models), e.g. google/nano-banana-proowner/name:version (community models by version), e.g. stability-ai/sdxl:<version>Examples:
# Use Replicate default model npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --provider replicateOverride model explicitly
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image out.png --provider replicate --model google/nano-banana
--ref provided + no --provider → auto-select Google first, then OpenAI, then Replicate--provider specified → use it (if --ref, must be google, openai, or replicate)| Preset | Google imageSize | OpenAI Size | Use Case |
|---|---|---|---|
| 1K | 1024px | Quick previews |
(default) | 2K | 2048px | Covers, illustrations, infographics |
Google imageSize: Can be overridden with
--imageSize 1K|2K|4K
Supported:
1:1, 16:9, 9:16, 4:3, 3:4, 2.35:1
imageConfig.aspectRatioaspectRatio parameterDefault: Sequential generation (one image at a time). This ensures stable output and easier debugging.
Parallel Generation: Only use when user explicitly requests parallel/concurrent generation.
| Mode | When to Use |
|---|---|
| Sequential (default) | Normal usage, single images, small batches |
| Parallel | User explicitly requests, large batches (10+) |
Parallel Settings (when requested):
| Setting | Value |
|---|---|
| Recommended concurrency | 4 subagents |
| Max concurrency | 8 subagents |
| Use case | Large batch generation when user requests parallel |
Agent Implementation (parallel mode only):
# Launch multiple generations in parallel using Task tool # Each Task runs as background subagent with run_in_background=true # Collect results via TaskOutput when all complete
gemini-3-pro-image-preview, gemini-3.1-flash-image-preview; or OpenAI GPT Image edits)Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.