feat(prompt): 攻击提示词按运动拓扑分四支 - #320
Merged
minorcell merged 1 commit intoAug 18, 2026
Merged
Conversation
attack.md 拆成 sweep/thrust/project/lunge × side/front 八节,去掉 crescent / broad side 这类形状先验 —— 它们等于断言角色手握一件有宽面的长条物,喂法杖 / 空手 / 四足角色时模型会凭空补出那件东西(1024XEngineer#195 只清了装备名词,没清形状先验)。 build_attack_prompt 新增 archetype(默认 THRUST,SWEEP 是唯一要求持有长条物的 一支),ActionSpec 加同名字段并对非攻击动作拒收;母版姿态同步分四支。 构图约束抽到 _framing 由代码统一追加到五个动作,只写正向计数句。 Refs 1024XEngineer#310
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4 tasks
Member
|
@johnnyzhang-eng 跟进下哦 |
johnnyzhang-eng
added a commit
to johnnyzhang-eng/game-asset-character
that referenced
this pull request
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #310
问题
attack.md里三处措辞合起来断言了角色的身体构造和手里拿的东西:the leading arm—— 断言有手臂,且发力主语是手臂downward crescent arc—— 断言挥动轨迹是弧线broad side facing the viewer—— 断言手里那件东西有"宽面"三条合起来 = "双足 + 有手臂 + 手握一件有宽面的长条物"。喂法杖 / 空手 / 四足角色时,
图文矛盾会被模型自己调和掉,凭空补出那件宽面长条物。#195 那次修复只清了装备名词
(the weapon / the sword),没清装备形状先验,所以同一个坑从名词层退到了形状层。
改法
按身体怎么发力分四支运动拓扑,而不是按手里拿什么分:
sweepthrustprojectlungeattack.md拆成<拓扑>.<朝向>八节,master_poses.md的 attack 节同步拆成四节。母版姿态必须跟着拆:四支的起手姿态互不兼容 —— 拿横挥蓄力母版跑直刺,模型会先把收在
腰际的那侧重新抡起来再做。所以
ATTACK_MASTER_POSES不放行空值,缺一支就炸,不退回中性站立。
build_attack_prompt加archetype关键字参数,默认 THRUST:四支里只有 SWEEP要求手里有一件有宽面的长条物,拿它当默认等于对每个未知角色继续断言持械。
ActionSpec.archetype是可选字段,非攻击动作带它会被 validator 拒收(它只被攻击提示词消费,传了不生效,静默忽略比报错更坏)。缺省值只在
build_attack_prompt定义一处,ActionSpec侧留None,避免同一个缺省两处各写一份后各自漂移。顺带把构图约束抽进
prompt/_framing.py,由代码统一追加到 walk / jump / idle / attack /custom 五个动作,不再抄进每份 md —— 同一条约束抄 N 份会各自漂移。只写正向计数句
("恰好一个角色在画面里"),不写否定句:该 i2v 接口没有 negative_prompt,否定句里的名词
会被 latch 进画面。
怎么验证的
新增
backend/tests/test_attack_archetypes.py(57 个用例),按结构性质断言而不是背文案:拓扑×朝向组合都解析到真正文,两两互不相同the leading armActionSpec对非攻击动作拒收 archetype;派生层真的把 archetype 传下去了本地闸门(backend/):
没跑任何付费生成,断言都是纯文本结构检查。
范围
只含后端。
_framing.py会被后续几个动作相关 PR 共用,但本 PR 自带完整实现,可独立合入。