mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-13 22:29:48 +08:00
c3cbce9ce3
BREAKING CHANGE: removed `baoyu-imagine` and `baoyu-image-cards`. All functionality now lives under `baoyu-image-gen` and `baoyu-xhs-images` respectively. Cross-skill `## Image Generation Tools` examples updated across baoyu-article-illustrator, baoyu-comic, baoyu-cover-image, baoyu-infographic, and baoyu-slide-deck. Migration: existing `~/.baoyu-skills/baoyu-imagine/EXTEND.md` configs are auto-renamed to `…/baoyu-image-gen/EXTEND.md` on first run via the legacy-path resolver in `scripts/main.ts`.
118 lines
4.6 KiB
Markdown
118 lines
4.6 KiB
Markdown
# Usage Examples
|
|
|
|
Extended CLI examples. SKILL.md shows the minimum set; read this file when the user asks about provider-specific invocation, batch generation, or less-common flags.
|
|
|
|
## Core Patterns
|
|
|
|
```bash
|
|
# Basic text-to-image
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image cat.png
|
|
|
|
# With aspect ratio
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A landscape" --image out.png --ar 16:9
|
|
|
|
# High quality
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --quality 2k
|
|
|
|
# Prompt from files
|
|
${BUN_X} {baseDir}/scripts/main.ts --promptfiles system.md content.md --image out.png
|
|
|
|
# With reference images (any provider family that supports refs)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "Make blue" --image out.png --ref source.png
|
|
```
|
|
|
|
## Per-Provider
|
|
|
|
```bash
|
|
# OpenAI
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider openai --model gpt-image-2
|
|
|
|
# Azure OpenAI (model = deployment name)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider azure --model gpt-image-2
|
|
|
|
# OpenAI GPT Image 2 custom 4K size
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cinematic landscape" --image out.png --provider openai --model gpt-image-2 --size 3840x2160
|
|
|
|
# Google with explicit model
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "Make blue" --image out.png --provider google --model gemini-3-pro-image-preview --ref source.png
|
|
|
|
# OpenRouter (recommended default)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider openrouter
|
|
|
|
# OpenRouter with reference
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "Make blue" --image out.png --provider openrouter --model google/gemini-3.1-flash-image-preview --ref source.png
|
|
|
|
# DashScope (default model)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "一只可爱的猫" --image out.png --provider dashscope
|
|
|
|
# DashScope Qwen-Image 2.0 Pro (custom size, Chinese text)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "为咖啡品牌设计一张 21:9 横幅海报,包含清晰中文标题" --image out.png --provider dashscope --model qwen-image-2.0-pro --size 2048x872
|
|
|
|
# DashScope legacy fixed-size
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "一张电影感海报" --image out.png --provider dashscope --model qwen-image-max --size 1664x928
|
|
|
|
# DashScope Wan 2.7 Image Pro (4K text-to-image)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "一间有着精致窗户的花店" --image out.png --provider dashscope --model wan2.7-image-pro --size 4096x4096
|
|
|
|
# DashScope Wan 2.7 Image with reference image (multi-image fusion)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "把图2的涂鸦喷绘在图1的汽车上" --image out.png --provider dashscope --model wan2.7-image-pro --ref car.webp paint.webp
|
|
|
|
# Z.AI GLM-image
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "一张带清晰中文标题的科技海报" --image out.png --provider zai
|
|
|
|
# Z.AI with custom size
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A science illustration with labels" --image out.png --provider zai --model glm-image --size 1472x1088
|
|
|
|
# MiniMax
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A fashion editorial portrait" --image out.jpg --provider minimax
|
|
|
|
# MiniMax with subject reference (character/portrait consistency)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A girl by the library window" --image out.jpg --provider minimax --model image-01 --ref portrait.png --ar 16:9
|
|
|
|
# Replicate (default: google/nano-banana-2)
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cat" --image out.png --provider replicate
|
|
|
|
# Replicate Seedream 4.5
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A cinematic portrait" --image out.png --provider replicate --model bytedance/seedream-4.5 --ar 3:2
|
|
|
|
# Replicate Wan 2.7 Image Pro
|
|
${BUN_X} {baseDir}/scripts/main.ts --prompt "A concept frame" --image out.png --provider replicate --model wan-video/wan-2.7-image-pro --size 2048x1152
|
|
```
|
|
|
|
## Batch Mode
|
|
|
|
```bash
|
|
# Batch from saved prompt files
|
|
${BUN_X} {baseDir}/scripts/main.ts --batchfile batch.json
|
|
|
|
# Batch with explicit worker count
|
|
${BUN_X} {baseDir}/scripts/main.ts --batchfile batch.json --jobs 4 --json
|
|
```
|
|
|
|
### Batch File Format
|
|
|
|
```json
|
|
{
|
|
"jobs": 4,
|
|
"tasks": [
|
|
{
|
|
"id": "hero",
|
|
"promptFiles": ["prompts/hero.md"],
|
|
"image": "out/hero.png",
|
|
"provider": "replicate",
|
|
"model": "google/nano-banana-2",
|
|
"ar": "16:9",
|
|
"quality": "2k"
|
|
},
|
|
{
|
|
"id": "diagram",
|
|
"promptFiles": ["prompts/diagram.md"],
|
|
"image": "out/diagram.png",
|
|
"ref": ["references/original.png"]
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
Paths in `promptFiles`, `image`, and `ref` are resolved relative to the batch file's directory. `jobs` is optional (overridden by CLI `--jobs`). A top-level array without the `jobs` wrapper is also accepted.
|