refactor(baoyu-comic): use skill interface instead of direct script invocation for image generation

This commit is contained in:
Jim Liu 宝玉 2026-03-08 19:24:02 -05:00
parent 154ccfe3ff
commit 90730bc551
2 changed files with 16 additions and 26 deletions

View File

@ -216,14 +216,11 @@ Analyze → [Check Existing?] → [Confirm: Style + Reviews] → Storyboard →
**7.1 Generate character sheet first**: **7.1 Generate character sheet first**:
- **Backup rule**: If `characters/characters.png` exists, rename to `characters/characters-backup-YYYYMMDD-HHMMSS.png` - **Backup rule**: If `characters/characters.png` exists, rename to `characters/characters-backup-YYYYMMDD-HHMMSS.png`
```bash - Invoke an installed image generation skill such as `baoyu-image-gen`
# Example with an installed image generation skill such as baoyu-image-gen - Read that skill's `SKILL.md` and follow its documented interface rather than calling its scripts directly
${BUN_X} <image-skill-baseDir>/scripts/main.ts \ - Use `characters/characters.md` as the prompt-file input
--promptfiles characters/characters.md \ - Save output to `characters/characters.png`
--image characters/characters.png --ar 4:3 - Use aspect ratio `4:3`
```
Replace `<image-skill-baseDir>` with the installed image generation skill directory. Do not assume it is a sibling of this skill.
**Compress character sheet** (recommended): **Compress character sheet** (recommended):
Compress to reduce token usage when used as reference image: Compress to reduce token usage when used as reference image:
@ -241,14 +238,11 @@ Compress to reduce token usage when used as reference image:
**Backup rules for page generation**: **Backup rules for page generation**:
- If prompt file exists: rename to `prompts/NN-{cover|page}-[slug]-backup-YYYYMMDD-HHMMSS.md` - If prompt file exists: rename to `prompts/NN-{cover|page}-[slug]-backup-YYYYMMDD-HHMMSS.md`
- If image file exists: rename to `NN-{cover|page}-[slug]-backup-YYYYMMDD-HHMMSS.png` - If image file exists: rename to `NN-{cover|page}-[slug]-backup-YYYYMMDD-HHMMSS.png`
- Invoke the installed image generation skill for each page
```bash - Use `prompts/01-page-xxx.md` as the prompt-file input
# Example: ALWAYS include --ref for consistency - Save output to `01-page-xxx.png`
${BUN_X} <image-skill-baseDir>/scripts/main.ts \ - Use aspect ratio `3:4`
--promptfiles prompts/01-page-xxx.md \ - If the chosen skill supports reference images, pass `characters/characters.png` as `--ref`
--image 01-page-xxx.png --ar 3:4 \
--ref characters/characters.png
```
**Full workflow details**: [references/workflow.md](references/workflow.md) **Full workflow details**: [references/workflow.md](references/workflow.md)

View File

@ -433,16 +433,12 @@ With confirmed prompts from Step 5/6:
**Strategy A: Using `--ref` parameter** (e.g., baoyu-image-gen) **Strategy A: Using `--ref` parameter** (e.g., baoyu-image-gen)
```bash - Read the chosen image generation skill's `SKILL.md`
# Each page generation MUST include --ref - Invoke that installed skill via its documented interface, not by calling its scripts directly
${BUN_X} <image-skill-baseDir>/scripts/main.ts \ - For every page, use `prompts/01-page-xxx.md` as the prompt-file input
--promptfiles prompts/01-page-xxx.md \ - Save output to `01-page-xxx.png`
--image 01-page-xxx.png \ - Use aspect ratio `3:4`
--ar 3:4 \ - Pass `characters/characters.png` as `--ref` on every page generation
--ref characters/characters.png
```
Replace `<image-skill-baseDir>` with the installed image generation skill directory. Do not assume it is adjacent to `baoyu-comic`.
**Strategy B: Embedding character descriptions in prompt** **Strategy B: Embedding character descriptions in prompt**