fix: 修复工作流执行记录创建与静音模式约束
- 执行记录仅在合法 execId 时写入,查询失败时返回错误 - 字幕构建改为词级精确对齐并增加比例兜底,避免整句被吞 - 静音模式下从转写与段级 prompt 双重杜绝口播/字幕/口型 - 清理静音事件描述中的说话类动词
This commit is contained in:
@@ -18,6 +18,7 @@ type Input struct {
|
||||
Refs Refs // 参考素材(角色/场景/道具/产品,具名)
|
||||
Seed int64 // 随机种子基数,各段 = Seed + 段序号
|
||||
NegativePrompt string // 全局负面 prompt(单段可覆盖,见 §7.5)
|
||||
NoSpeech bool // 静音模式:段级 prompt 追加静音硬约束(视频模型不产生口播/字幕/口型)
|
||||
Cfg Config // 阈值/语速/容差等统一配置,零值取 DefaultConfig()
|
||||
TokenCfg TokenConfig // 实体名替换 token 的生成配置
|
||||
}
|
||||
|
||||
@@ -421,6 +421,11 @@ func BuildSegmentPrompt(segShots []Shot, reg *TokenRegistry, in Input) (string,
|
||||
}
|
||||
|
||||
prompt = truncatePrompt(prompt, cfg)
|
||||
// 静音模式段级硬约束:放在 truncate 之后追加,避免被截断丢弃;
|
||||
// 明确告知视频模型本段是无声画面,从 prompt 层面杜绝口播/字幕/口型
|
||||
if in.NoSpeech {
|
||||
prompt += "\n\n静音模式:本段为无声画面,禁止人物开口说话、禁止出现字幕与口型动作,只保留纯画面动作、表情、神态与场景变化。"
|
||||
}
|
||||
return prompt, segRefs
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ type SplitShotsInput struct {
|
||||
FlatRefs []pipeline.RefItem `json:"flat_refs"` // 参考素材(平铺形态,类别由 categorizeRefs 推断)
|
||||
Seed int64 `json:"seed"` // 随机种子基数,各段 = baseSeed + 段序号
|
||||
NegativePrompt string `json:"negative_prompt,omitempty"`
|
||||
NoSpeech bool `json:"no_speech,omitempty"` // 静音模式:透传 pipeline,段级 prompt 追加静音硬约束
|
||||
}
|
||||
|
||||
// SplitShotsPipelineProcessor 新拆段前置处理器。入参 args 即模型请求参数(SplitShotsInput 形状),
|
||||
@@ -63,6 +64,7 @@ func SplitShotsPipelineProcessor() *processor.Processor {
|
||||
Refs: refs,
|
||||
Seed: input.Seed,
|
||||
NegativePrompt: input.NegativePrompt,
|
||||
NoSpeech: input.NoSpeech,
|
||||
TokenCfg: pipeline.TokenConfig{},
|
||||
}))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user