-
Notifications
You must be signed in to change notification settings - Fork 4
feat(prompt): 攻击提示词按运动拓扑分四支 #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| """所有动作共用的构图约束。 | ||
|
|
||
| 由代码统一追加而不是抄进每份 md:同一条约束抄 N 份会各自漂移。 | ||
|
|
||
| 只写正向计数句 —— 该 i2v 接口没有 negative_prompt,否定句里的名词会被 latch 进画面 | ||
| (实测"do not add dust"反而勾出更多灰尘),所以说"恰好一个",不说"不要第二个"。 | ||
| """ | ||
| from __future__ import annotations | ||
|
|
||
| __all__ = ["SINGLE_SUBJECT_FRAMING", "with_framing"] | ||
|
|
||
| # 攻击的两处留白(母版姿态要求 + 母版补边)让画面空得足以容下第二个主体。 | ||
| SINGLE_SUBJECT_FRAMING = ( | ||
| "Exactly one character is in the frame, alone against a plain flat solid-color background, " | ||
| "and the whole body stays inside the frame." | ||
| ) | ||
|
|
||
|
|
||
| def with_framing(body: str) -> str: | ||
| """给一段动作正文接上构图约束。""" | ||
| return f"{body} {SINGLE_SUBJECT_FRAMING}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,96 @@ | ||
| # 攻击 i2v 提示词(一次性类) | ||
|
|
||
| ## side | ||
| 节名是 `<运动拓扑>.<朝向>`。分支依据是**身体怎么发力**,不是手里拿着什么: | ||
| 写"宽面""弧线"这类形状词等于断言角色手握一件有宽面的长条物,喂法杖 / 空手 / 四足角色时 | ||
| 模型会凭空补出那件东西来调和图文矛盾(与 #195 同一个坑,只是从名词层退到形状层)。 | ||
|
|
||
| 四支都要写整体位移(whole body / torso / hips):i2v 强跟身体、弱跟持物, | ||
| 只描述持物的运动会让它自行漂移。 | ||
|
|
||
| ## sweep.side | ||
|
|
||
| ```text | ||
| Seen from the side facing right, the character makes ONE single committed strike, staying in STRICT SIDE VIEW the whole time: | ||
| starting coiled with the weight on the back foot, the whole body uncoils and the hips drive forward as the weight surges onto the front foot, | ||
| the striking side of the body travelling in one continuous path from far behind the body, down across the front of the torso, out to full extension low in front, | ||
| whatever the character already wears or carries keeps its own shape and moves with the body, anything held in the hands stays in the same grip at the same angle, | ||
| then the torso settles back upright into guard and holds that stance. | ||
| The torso and hips keep pointing to the right the entire time and the character never turns toward or away from the viewer. | ||
| ``` | ||
|
|
||
| ## sweep.front | ||
|
|
||
| ```text | ||
| Facing the viewer, the character makes ONE single committed strike: starting coiled with the weight on the back foot, | ||
| the whole body uncoils forward and the hips turn into the motion as the weight surges onto the front foot, | ||
| the striking side of the body travelling in one continuous path across the front of the torso out to full extension, | ||
| whatever the character already wears or carries keeps its own shape and moves with the body, anything held in the hands stays in the same grip at the same angle, | ||
| then the torso settles back upright into guard and holds that stance, standing steady and keeping FACING THE VIEWER. | ||
| ``` | ||
|
|
||
| ## thrust.side | ||
|
|
||
| ```text | ||
| Seen from the side facing right, the character drives ONE single committed strike straight forward, staying in STRICT SIDE VIEW the whole time: | ||
| starting coiled low with the weight on the back foot and the striking side pulled in at waist height, | ||
| the hips snap forward and the whole body drives straight ahead as the weight lands on the front foot, | ||
| the striking side of the body extending in one straight line directly forward to full reach and stopping there, | ||
| whatever the character already wears or carries keeps its own shape and moves with the body, anything held in the hands stays in the same grip at the same angle, | ||
| then the torso draws back over the hips and settles into guard and holds that stance. | ||
| The torso and hips keep pointing to the right the entire time and the character never turns toward or away from the viewer. | ||
| ``` | ||
|
|
||
| ## thrust.front | ||
|
|
||
| ```text | ||
| Facing the viewer, the character drives ONE single committed strike straight toward the viewer: | ||
| starting coiled low with the weight on the back foot and the striking side pulled in at waist height, | ||
| the hips snap forward and the whole body drives straight ahead as the weight lands on the front foot, | ||
| the striking side of the body extending in one straight line directly toward the viewer to full reach and stopping there, | ||
| whatever the character already wears or carries keeps its own shape and moves with the body, anything held in the hands stays in the same grip at the same angle, | ||
| then the torso draws back over the hips and settles into guard and holds that stance, standing steady and keeping FACING THE VIEWER. | ||
| ``` | ||
|
|
||
| ## project.side | ||
|
|
||
| ```text | ||
| Seen from the side facing right, the character makes ONE single committed ranged release, staying in STRICT SIDE VIEW the whole time: | ||
| starting settled with the weight low over both feet, the torso presses forward over the front foot and the hips square up behind the motion, | ||
| the releasing side of the body reaching straight out in front of the chest and coming to a firm stop at full extension, | ||
| the whole body braced and steady at that moment, | ||
| whatever the character already wears or carries keeps its own shape and moves with the body, anything held in the hands stays in the same grip at the same angle, | ||
| then the character keeps that extended pose and stays still. | ||
| The torso and hips keep pointing to the right the entire time and the character never turns toward or away from the viewer. | ||
| ``` | ||
|
|
||
| ## project.front | ||
|
|
||
| ```text | ||
| Facing the viewer, the character makes ONE single committed ranged release toward the viewer: | ||
| starting settled with the weight low over both feet, the torso presses forward and the hips square up behind the motion, | ||
| the releasing side of the body reaching straight out in front of the chest toward the viewer and coming to a firm stop at full extension, | ||
| the whole body braced and steady at that moment, | ||
| whatever the character already wears or carries keeps its own shape and moves with the body, anything held in the hands stays in the same grip at the same angle, | ||
| then the character keeps that extended pose and stays still, keeping FACING THE VIEWER. | ||
| ``` | ||
|
|
||
| ## lunge.side | ||
|
|
||
| ```text | ||
| Seen from the side facing right, the character makes ONE single committed attack, staying in STRICT SIDE VIEW the whole time: | ||
| starting coiled with the weight on the back foot, the body leans forward and the weight surges onto the front foot, | ||
| the leading arm sweeping through one smooth downward crescent arc from high behind the shoulder down across the front to full extension low, | ||
| anything held in that hand keeping its exact length and grip position and staying clearly in front of the body with its broad side facing the viewer the whole way, | ||
| whatever the character already wears swinging with the motion, then the body settles back upright into guard and holds that stance, | ||
| standing steady. The torso and hips keep pointing to the right the entire time and the character never turns toward or away from the viewer. | ||
| Seen from the side facing right, the character makes ONE single committed lunge forward, staying in STRICT SIDE VIEW the whole time: | ||
| starting crouched low with the weight loaded onto the rear limbs, the whole body surges forward in one burst with the head and the leading limbs arriving first, | ||
| the hips and torso following along that same line and the back stretching out level and low over the ground, | ||
| whatever the character already wears or carries keeps its own shape and moves with the body, | ||
| then the body gathers back under itself, settles low and holds that crouched stance. | ||
| The torso and hips keep pointing to the right the entire time and the character never turns toward or away from the viewer. | ||
| ``` | ||
|
|
||
| ## front | ||
| ## lunge.front | ||
|
|
||
| ```text | ||
| Facing the viewer, the character makes ONE single committed attack: starting coiled with the weight on the back foot, | ||
| the whole body uncoils forward, the leading arm sweeping through one smooth arc across the front to full extension, | ||
| anything held in that hand keeping its exact length and grip position and staying clearly in front of the body with its broad side facing the viewer the whole way, | ||
| whatever the character already wears swinging with the motion, then the body settles back upright into guard and holds that stance, | ||
| standing steady and keeping FACING THE VIEWER. | ||
| Facing the viewer, the character makes ONE single committed lunge toward the viewer: | ||
| starting crouched low with the weight loaded onto the rear limbs, the whole body surges forward in one burst with the head and the leading limbs arriving first, | ||
| the hips and torso following along that same line and the back stretching out level and low over the ground, | ||
| whatever the character already wears or carries keeps its own shape and moves with the body, | ||
| then the body gathers back under itself, settles low and holds that crouched stance, keeping FACING THE VIEWER. | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,10 +56,15 @@ def _build_prompt(self, action: ActionSpec) -> str: | |
| facing=action.facing, | ||
| cyclic=bool(action.cyclic), | ||
| ) | ||
| # attack 同样进不了那张表:它还要按运动拓扑选提示词分支。archetype 缺省时不在这里 | ||
| # 兜一个默认值 —— 缺省只由 build_attack_prompt 定义一次,写两处会各自漂移。 | ||
| if action.action is ActionType.ATTACK: | ||
| if action.archetype is None: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] 把 archetype 贯通到生产请求模型 生产入口 |
||
| return build_attack_prompt(facing=action.facing) | ||
| return build_attack_prompt(facing=action.facing, archetype=action.archetype) | ||
| builders = { | ||
| ActionType.JUMP: build_jump_prompt, | ||
| ActionType.IDLE: build_idle_prompt, | ||
| ActionType.ATTACK: build_attack_prompt, | ||
| } | ||
| build = builders.get(action.action, build_walk_prompt) | ||
| return build(facing=action.facing) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] 让拓扑专用母版姿态进入生成路径
这张新映射目前只被测试导入,生产代码没有任何消费者;
VideoFrameStrategy.derive仍直接使用同一份调用方master,并且只按动作字符串调用prepare_master(master, "attack"),完全不知道所选 archetype。于是即使直接构造ActionSpec(archetype=LUNGE/PROJECT/...),运行时也只是换了视频提示词,不会使用这里声明的互不兼容的起手姿态,正好违背本 PR 所述“母版姿态决定动作”的核心约束。请在母版生成/选择链路中按 archetype 消费该映射,或把对应姿态随动作规格明确传入。