Skip to content

feat(image): image_with_refs 构图指令 — 抓拍式生活切片 intro + CORLINMAN_IMAGE_REFS_INTRO 开关#153

Merged
sweetcornna merged 1 commit into
mainfrom
feat/image-composition-intro
Jul 18, 2026
Merged

feat(image): image_with_refs 构图指令 — 抓拍式生活切片 intro + CORLINMAN_IMAGE_REFS_INTRO 开关#153
sweetcornna merged 1 commit into
mainfrom
feat/image-composition-intro

Conversation

@sweetcornna

Copy link
Copy Markdown
Owner

背景 / What

移植 hermes image_with_refsCOMPOSITION DIRECTION 构图指令到 corlinman 的参考图生图工具(corlinman_agent.image.dispatch),让多角色 AI 配图读作"随手拍的生活切片"而不是摆拍合影。

改动 / Changes

  • _COMPOSITION_INTRO(新常量,英文,喂给图像模型的指令,非用户可见)覆盖全部要点:
    • candid slice-of-life snapshot, NOT a posed group photo
    • 每个角色不同动作 / 不同朝向(不都看镜头)
    • off-axis / off-center 取景
    • mid-action 姿态(非静止站立)
    • environmental clutter 增加生活感
    • "sneaky / casual" 动作要读得出隐蔽感
    • 角色写实句 + 画风句写成 persona 通用 —— 画风一律来自上游 persona/prompt 与参考图,绝不硬编码任何特定画风
  • _compose_refs_prompt(prompt, chars_used)(新函数)拼装:intro + 按序参考图图例(Reference image 1 = <label1>, ...)+ Scene: 段 + 原 prompt(原样置尾)。用它替换传给 generate_with_refs 的裸 prompt。
  • CORLINMAN_IMAGE_REFS_INTRO=off 环境开关可禁用(裸 prompt 直穿);成功返回包新增 composition_intro: bool
  • 图例只列 chars_used(真正解析到参考图的 label),编号连续;缺失 label 不入图例。

测试

test_image_with_refs.py 新增 3 项 + 加固 happy-path:

  • intro 包裹 prompt(intro 开头 / 原 prompt 置尾 / 按序列出 labels)
  • 图例与 chars_used 一致(缺失 label 被丢弃,编号连续)
  • CORLINMAN_IMAGE_REFS_INTRO=off → 裸 prompt 直穿、composition_intro=false

验证(全绿)

  • ruff check python/packages/corlinman-agent
  • mypy python/packages/(strict,609 files)✅
  • lint-imports(2 contracts kept,corlinman-agent 不 import corlinman-server)✅
  • pytest test_image_with_refs.py + test_image_generate.py(35 passed)✅
  • 回归:qzone publish/comment + vision(62 passed)✅

约束遵守

  • dispatcher 永不抛异常(沿用现有错误折叠风格,纯字符串拼接无新失败面)。
  • 无跨包 import;返回包变更为纯增量字段。

…EFS_INTRO 开关

移植 hermes COMPOSITION DIRECTION 到参考图生图工具,让多角色配图
读作随手拍的生活切片而非摆拍合影:

- 新增 _COMPOSITION_INTRO(英文,模型侧图像指令,非用户可见):
  candid slice-of-life 抓拍 / 各角色不同动作与朝向 / 偏轴取景 /
  动作进行中的姿态 / 环境杂物增加生活感 / 偷偷·顺手的动作要读得出隐蔽感;
  角色写实句 + 画风句写成 persona 通用,画风一律来自上游参考图与 prompt,
  不硬编码任何特定画风。
- 新增 _compose_refs_prompt(prompt, chars_used):intro + 按序参考图图例
  (Reference image 1 = <label1>, ...) + Scene 段 + 原 prompt(原样置尾)。
- CORLINMAN_IMAGE_REFS_INTRO=off 可禁用(裸 prompt 直穿);
  成功包新增 composition_intro: bool。
- dispatcher 仍永不抛异常,corlinman-agent 不 import corlinman-server。
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added codex:needs-review A Codex review is needed for the current PR head. codex:review-requested A Codex review was requested or should be running automatically. status: 🔁 re-review loop A fresh Codex review was requested after the latest change or comment. codex:reviewed Codex posted a review result or thumbs-up after the latest request. status: 👀 ready for maintainer look No automation blocker is known; a maintainer should inspect the current result. and removed codex:review-requested A Codex review was requested or should be running automatically. codex:needs-review A Codex review is needed for the current PR head. status: 🔁 re-review loop A fresh Codex review was requested after the latest change or comment. labels Jul 18, 2026
@sweetcornna
sweetcornna merged commit 01571be into main Jul 18, 2026
8 of 9 checks passed
@sweetcornna
sweetcornna deleted the feat/image-composition-intro branch July 18, 2026 17:45
@github-actions github-actions Bot added the status: ✅ merge-ready Evidence and review are clear; normal merge gates may proceed. label Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex:reviewed Codex posted a review result or thumbs-up after the latest request. status: ✅ merge-ready Evidence and review are clear; normal merge gates may proceed. status: 👀 ready for maintainer look No automation blocker is known; a maintainer should inspect the current result.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant