跳到正文

宝玉:演示文稿图像制作

将主题或文章组织为演示大纲、风格说明和逐页图像,保存提示词与可用于分享的演示资料。

开源精选内容生产39 个文件26,681 Stars浏览次数 0JimLiu/baoyu-skills MIT版本 1567581
开始使用

下载前阅读 SKILL.md 中的使用条件,并确认所用工具支持对应能力。

输入资料
主题资料与讲述目标 页数、风格和图像工具 阅读本节完整说明
交付内容
演示大纲与逐页图像 演示文件与生成资料 阅读本节完整说明
  1. 获取完整包,保留配套文件的目录结构。
  2. 按照原文准备所需工具、依赖与输入资料。
  3. 阅读对应使用步骤与输入输出说明,在自己的环境中验证结果。

使用提示摘自原文,配套文件保留来源版本;实际运行条件以各包说明为准。

正文

获取原文件

references/codex-imagegen.md

Load this reference only when the Image Generation Tools rule has resolved to codex-imagegen — i.e., the current runtime exposes no native imagegen skill but codex CLI is on PATH with an active codex login.

Preferred path: route through baoyu-image-gen

If the baoyu-image-gen skill is available in this runtime, always invoke through it rather than calling the wrapper directly. It handles retry/cache/batch/EXTEND.md preferences uniformly with every other provider.

${BUN_X} <baoyu-image-gen-base>/scripts/main.ts \
  --provider codex-cli \
  --image <ABSOLUTE_output> \
  --promptfiles <ABSOLUTE_prompts/NN-slide-{slug}.md> \
  --ar <ratio> \
  [--ref <ABSOLUTE_file>]...

Resolve <baoyu-image-gen-base> the same way you resolve any sibling skill — through your runtime's skill registry (Skill tool, plugin marketplace, or $HOME/.baoyu-skills/baoyu-image-gen/).

Fallback: spawn the wrapper directly

Only when baoyu-image-gen is NOT installed in the current runtime. Discover the wrapper's location at runtime — do NOT hard-code ../../packages/... from this skill:

  1. Honor explicit override: if $BAOYU_CODEX_IMAGEGEN_BIN is set and points to a real file, use that path. It may be .ts (spawn bun <path>) or .sh/binary (spawn directly).
  2. Search the plugin root: walk up from this skill's directory looking for packages/baoyu-codex-imagegen/src/main.ts. If found, that is the wrapper. Spawn it with bun.
  3. Last resort: tell the user that codex-imagegen is not available in this runtime and ask whether to install the baoyu-skills plugin (or set BAOYU_CODEX_IMAGEGEN_BIN) or pick another backend.

Once located, the invocation shape is:

bun <WRAPPER>/main.ts \
  --image <ABSOLUTE_output> \
  --prompt-file <ABSOLUTE_prompts/NN-slide-{slug}.md> \
  --aspect <ratio> \
  [--ref <ABSOLUTE_file>]... \
  [--timeout <ms>] \
  [--cache-dir ~/.cache/baoyu-codex-imagegen] \
  [--log-file <ABSOLUTE_jsonl_log_path>]

If bun is missing, npx -y bun <WRAPPER>/main.ts ... works as a fallback.

Parameter notes

  • All filesystem inputs are auto-resolved against process.cwd() when relative, but agents should pass absolute paths to be robust against cwd drift.
  • --timeout defaults to 300000 (5 min) per codex exec attempt. Raise (e.g. --timeout 600000 for 10 min) on slow networks or large prompts.
  • --cache-dir is off by default. Enable for repeatable runs to skip redundant generations of the same prompt+aspect+refs.
  • Authentication: the wrapper uses the user's Codex subscription — no OPENAI_API_KEY is read or sent.

Stdout contract

Single JSON line:

  • Success: {"status":"ok","path":"...","bytes":N,"elapsed_seconds":N,"thread_id":"...","attempts":N,"cached":bool,...}
  • Failure: {"status":"error","path":"...","bytes":0,"error":"...","error_kind":"..."}

error_kind values: codex_not_installed, invalid_args, prompt_file_missing, spawn_failed, timeout, no_image_gen_tool_use, output_missing, invalid_png, agent_refused, lock_busy.

On retryable errors (timeout, spawn_failed, no_image_gen_tool_use, output_missing, invalid_png, agent_refused), ask the user whether to retry or fall back to another backend.

Batch semantics

  • Codex image_gen returns one image per call (n=1 only). Multi-image jobs must dispatch one wrapper call per image.
  • The wrapper does NOT accept a --sessionId flag. Chain/scene consistency must come from --ref reference images.
  • --size and --quality are silently ignored — Codex picks pixel dimensions from --aspect.

CONTACT HAONAN

联系haonan

医疗 AI · 产品与独立开发

刘浩南

关注医疗 AI 从 demo 到真实落地,聚焦产品化、商业化与院内工作流效率提升。

12年医疗产研经验,大湾区头部医疗AI公司前产品总监,独立开发者

医疗 AI 产品化医疗 AI 商业化院内工作流效率
刘浩南的微信联系二维码
微信扫一扫,联系 haonan