Loading...
Loading...
Generates images using official OpenAI and Google APIs via AI SDK. Supports text-to-image, reference images, aspect ratios, and quality presets. Use when user asks to "generate image with API", "use official API for images", "create image with OpenAI/Google", or needs API-based generation instead of browser-based.
npx skill4agent add jst-well-dan/skill-box 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| 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 |
| OpenAI model override |
| Google model override |
| Custom OpenAI endpoint |
| Custom Google 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