Loading...
Loading...
AI image generation with OpenAI, Google and DashScope APIs. Supports text-to-image, reference images, aspect ratios. Sequential by default; parallel generation available on request. Use when user asks to generate, create, or draw images.
npx skill4agent add jimliu/baoyu-skills baoyu-image-genSKILL_DIR${SKILL_DIR}/scripts/main.ts# Check project-level first
test -f .baoyu-skills/baoyu-image-gen/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-image-gen/EXTEND.md" && echo "user"# Basic
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "A cat" --image cat.png
# With 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 only)
npx -y bun ${SKILL_DIR}/scripts/main.ts --prompt "Make blue" --image out.png --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| Option | Description |
|---|---|
| Prompt text |
| Read prompt from files (concatenated) |
| Output image path (required) |
| Force provider (default: google) |
| Model ID |
| Aspect ratio (e.g., |
| Size (e.g., |
| Quality preset (default: 2k) |
| Image size for Google (default: from quality) |
| Reference images (Google multimodal only) |
| Number of images |
| JSON output |
| Variable | Description |
|---|---|
| OpenAI API key |
| Google API key |
| DashScope API key (阿里云) |
| OpenAI model override |
| Google model override |
| DashScope model override (default: z-image-turbo) |
| Custom OpenAI endpoint |
| Custom Google endpoint |
| Custom DashScope endpoint |
<cwd>/.baoyu-skills/.env~/.baoyu-skills/.env--provider| Preset | Google imageSize | OpenAI Size | Use Case |
|---|---|---|---|
| 1K | 1024px | Quick previews |
| 2K | 2048px | Covers, illustrations, infographics |
--imageSize 1K|2K|4K1:116:99:164:33:42.35:1imageConfig.aspectRatioaspectRatio| Mode | When to Use |
|---|---|
| Sequential (default) | Normal usage, single images, small batches |
| Parallel | User explicitly requests, large batches (10+) |
| Setting | Value |
|---|---|
| Recommended concurrency | 4 subagents |
| Max concurrency | 8 subagents |
| Use case | Large batch generation when user requests parallel |
# 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