Skip to content

PRINTFILM: AI short-video marketing and AI short-drama creation platform

fix: 画布 @ 仅可引用连线节点,并默认禁止 Seedance 烧录字幕。

yib3731874bdf0
diff --git a/backend/app/services/drama/asset_video.py b/backend/app/services/drama/asset_video.py
index 7688be6..fb18747 100644
--- a/backend/app/services/drama/asset_video.py
+++ b/backend/app/services/drama/asset_video.py
@@ -116,8 +116,9 @@ async def generate_asset_video(
"resolution": res,
"duration_fallback": duration,
"style_board_url": video_board_url or None,
- # 自由画布资产生视频:不烧模型字幕(后期再叠)
+ # 自由画布资产生视频:不烧模型字幕、不叠人物介绍字卡(后期再叠)
"burn_subtitles": False,
+ "character_intro": False,
}
)
local_video, local_last_frame, task_result = await ark.gen_and_wait_seedance_body(
diff --git a/backend/app/services/drama/build_seedance_generate_body.py b/backend/app/services/drama/build_seedance_generate_body.py
index 18fd0b2..4af2602 100644
--- a/backend/app/services/drama/build_seedance_generate_body.py
+++ b/backend/app/services/drama/build_seedance_generate_body.py
@@ -526,8 +526,8 @@ def build_seedance_prompt_text(
catalog: SeedanceReferenceCatalog | None = None,
video_style_id: str | None = None,
*,
- burn_subtitles: bool = True,
- character_intro: bool = True,
+ burn_subtitles: bool = False,
+ character_intro: bool = False,
has_style_board: bool = False,
) -> str:
# 提交前拆分对白舞台指示并纠正空镜误标,保证强制约束与正文一致
@@ -604,8 +604,8 @@ def build_seedance_content_items(
video_style_id: str | None = None,
continuity_first_frame_url: str | None = None,
*,
- burn_subtitles: bool = True,
- character_intro: bool = True,
+ burn_subtitles: bool = False,
+ character_intro: bool = False,
style_board_url: str | None = None,
) -> list[dict[str, Any]]:
catalog = build_seedance_reference_catalog(reference, script=content)
@@ -727,12 +727,13 @@ def build_seedance_generate_body(input_params: BuildSeedanceGenerateBodyInput) -
if not catalog.images:
style_board_url = None
use_first_frame_mode = bool(continuity) and not (catalog.images or catalog.audios)
+ # 缺省与产品一致:后期叠字,不烧模型字幕 / 不叠人物介绍
burn_subtitles = input_params.get("burn_subtitles")
if burn_subtitles is None:
- burn_subtitles = True
+ burn_subtitles = False
character_intro = input_params.get("character_intro")
if character_intro is None:
- character_intro = True
+ character_intro = False
mid = input_params.get("model_id")
raw_duration = resolve_seedance_duration_from_content(content, fallback=fallback)
diff --git a/backend/app/services/seedance_segments.py b/backend/app/services/seedance_segments.py
index b57a24b..8a8c353 100644
--- a/backend/app/services/seedance_segments.py
+++ b/backend/app/services/seedance_segments.py
@@ -447,8 +447,8 @@ def build_seedance_production_section(
segment_script: str,
*,
ambient_only: bool = False,
- burn_subtitles: bool = True,
- character_intro: bool = True,
+ burn_subtitles: bool = False,
+ character_intro: bool = False,
no_bgm: bool = False,
) -> str:
"""组装 Seedance 音频/字幕/BGM 强制约束(科普旁白 / 漫剧画面+对白混排)。
diff --git a/backend/tests/test_build_fragments.py b/backend/tests/test_build_fragments.py
index 1668a90..68ad9d1 100644
--- a/backend/tests/test_build_fragments.py
+++ b/backend/tests/test_build_fragments.py
@@ -375,6 +375,6 @@ def test_scene_description_marked_visual_not_voiceover():
]
)
assert script_has_narration_cue(script) is False
- section = build_seedance_production_section(script)
+ section = build_seedance_production_section(script, burn_subtitles=True)
assert "禁止为其生成配音" in section
assert "画面描述段不出现字幕" in section
diff --git a/backend/tests/test_drama_subtitle_toggle.py b/backend/tests/test_drama_subtitle_toggle.py
index 44a845d..d22ec3a 100644
--- a/backend/tests/test_drama_subtitle_toggle.py
+++ b/backend/tests/test_drama_subtitle_toggle.py
@@ -85,3 +85,23 @@ def test_seedance_prompt_text_post_mode_strips_cues():
assert "【字幕" not in prompt
assert "同步字幕" not in prompt
assert "禁止在画面内烧录字幕" in prompt
+
+
+def test_build_seedance_generate_body_defaults_no_burn():
+ """缺省不传开关时按后期模式:禁止烧录字幕。"""
+ from app.services.drama.build_seedance_generate_body import build_seedance_generate_body
+
+ body = build_seedance_generate_body(
+ {
+ "content": "@duration:4\n【对白·慢速清晰·同步字幕】禹:水患未平。",
+ "reference": [],
+ "duration_fallback": 4,
+ }
+ )
+ text = ""
+ for item in body.get("content") or []:
+ if isinstance(item, dict) and item.get("type") == "text":
+ text += str(item.get("text") or "")
+ assert "禁止在画面内烧录字幕" in text
+ assert "同步字幕" not in text
+ assert "烧录简体中文字幕" not in text
diff --git a/backend/tests/test_seedance_segments.py b/backend/tests/test_seedance_segments.py
index 0a883f6..3eafd0b 100644
--- a/backend/tests/test_seedance_segments.py
+++ b/backend/tests/test_seedance_segments.py
@@ -169,7 +169,7 @@ def test_empty_shot_misclassified_as_dialogue_is_rewritten():
assert "【画面·无配音仅环境音】空镜:" in fixed
assert script_has_dialogue_cue(fixed) is False
assert script_has_visual_only_cue(fixed) is True
- section = build_seedance_production_section(fixed)
+ section = build_seedance_production_section(fixed, burn_subtitles=True)
assert "禁止为其生成配音" in section
assert "画面描述段不出现字幕" in section
assert "逐句轮换" in section
@@ -185,7 +185,7 @@ def test_legacy_drama_subtitle_cue_normalized_on_rewrite():
fixed = rewrite_misclassified_visual_voice_lines(legacy)
assert DRAMA_SUBTITLE_CUE in fixed
assert "仅标记段落同步" not in fixed
- assert "逐句轮换" in build_seedance_production_section(fixed)
+ assert "逐句轮换" in build_seedance_production_section(fixed, burn_subtitles=True)
def test_character_intro_cue_normalized_beside_character():
@@ -195,7 +195,9 @@ def test_character_intro_cue_normalized_beside_character():
fixed = rewrite_misclassified_visual_voice_lines(legacy)
assert "【人物介绍·画面叠字·角色身旁】禹|治水英雄" in fixed
assert "【人物介绍·画面叠字】禹" not in fixed.replace("【人物介绍·画面叠字·角色身旁】", "")
- section = build_seedance_production_section(fixed)
+ section = build_seedance_production_section(
+ fixed, burn_subtitles=True, character_intro=True
+ )
assert "角色身旁" in section
assert "禁止居中大标题" in section
diff --git a/frontend/src/components/drama/SeedanceRulesModal.tsx b/frontend/src/components/drama/SeedanceRulesModal.tsx
index 254b418..a328bdc 100644
--- a/frontend/src/components/drama/SeedanceRulesModal.tsx
+++ b/frontend/src/components/drama/SeedanceRulesModal.tsx
@@ -108,7 +108,7 @@ export function SeedanceRulesModal({ open, onClose }: Props) {
*/}
</ol>
<p className="seedance-rules-note">
- 系统默认开启 <code>generate_audio</code>:有口播意图时 Seedance 原生配音并烧录字幕;纯画面镜仅环境音、不烧字幕。
+ 系统默认开启 <code>generate_audio</code>:有口播意图时 Seedance 原生配音;字幕默认后期叠字(画面内禁止烧录);纯画面镜仅环境音。
</p>
<h4>提示词自动组装顺序</h4>
diff --git a/frontend/src/pages/drama/canvas/nodes/CanvasMentionPopover.tsx b/frontend/src/pages/drama/canvas/nodes/CanvasMentionPopover.tsx
index 766e736..fd3df8f 100644
--- a/frontend/src/pages/drama/canvas/nodes/CanvasMentionPopover.tsx
+++ b/frontend/src/pages/drama/canvas/nodes/CanvasMentionPopover.tsx
@@ -93,7 +93,7 @@ export function CanvasMentionPopover({
</button>
</div>
{filtered.length === 0 ? (
- <div className="fc-mention-empty">无匹配节点 · 先创建角色/场景</div>
+ <div className="fc-mention-empty">无已连线节点 · 先把角色/场景连到本节点</div>
) : (
<ul className="fc-mention-list">
{filtered.map((item, index) => {
diff --git a/frontend/src/pages/drama/canvas/nodes/CanvasNodeGeneratePanel.tsx b/frontend/src/pages/drama/canvas/nodes/CanvasNodeGeneratePanel.tsx
index caaee93..fcc92d8 100644
--- a/frontend/src/pages/drama/canvas/nodes/CanvasNodeGeneratePanel.tsx
+++ b/frontend/src/pages/drama/canvas/nodes/CanvasNodeGeneratePanel.tsx
@@ -38,8 +38,8 @@ function panelCopy(kind: CanvasNodeKind, hasMedia: boolean) {
if (kind === 'video') {
return {
title: hasMedia ? '编辑并重生视频' : 'AI 生成视频',
- placeholder: '描述视频画面、镜头运动与氛围;键入 @ 引用角色/场景…',
- hint: 'Enter 生成视频 · @ 引用 · Shift+Enter 换行',
+ placeholder: '描述视频画面、镜头运动与氛围;键入 @ 引用已连线节点…',
+ hint: 'Enter 生成视频 · @ 仅可引用已连线节点 · Shift+Enter 换行',
}
}
if (kind === 'character') {
@@ -58,8 +58,8 @@ function panelCopy(kind: CanvasNodeKind, hasMedia: boolean) {
}
return {
title: hasMedia ? '编辑并重生图片' : 'AI 生图',
- placeholder: '描述画面内容;键入 @ 引用角色/场景…',
- hint: 'Enter 生成 · @ 引用 · Shift+Enter 换行',
+ placeholder: '描述画面内容;键入 @ 引用已连线节点…',
+ hint: 'Enter 生成 · @ 仅可引用已连线节点 · Shift+Enter 换行',
}
}
@@ -92,6 +92,7 @@ export function CanvasNodeGeneratePanel({
updateNodePrompt,
updateNodeVideoOptions,
mentionableNodes,
+ edges,
} = useCanvasStore()
const [prompt, setPrompt] = useState(() => sanitizePrompt(defaultPrompt, kind, label))
/*
@@ -122,11 +123,17 @@ export function CanvasNodeGeneratePanel({
const allowMention = kind === 'video' || kind === 'image'
const isVideo = kind === 'video'
- /* 可引用:排除当前节点自身 */
- const mentionItems = useMemo(
- () => mentionableNodes.filter((n) => n.nodeId !== nodeId),
- [mentionableNodes, nodeId],
- )
+ /* 可引用:仅已连线邻居(双向),并排除自身 */
+ const mentionItems = useMemo(() => {
+ const neighborIds = new Set<string>()
+ for (const edge of edges) {
+ if (edge.source === nodeId) neighborIds.add(edge.target)
+ if (edge.target === nodeId) neighborIds.add(edge.source)
+ }
+ return mentionableNodes.filter(
+ (n) => n.nodeId !== nodeId && neighborIds.has(n.nodeId),
+ )
+ }, [edges, mentionableNodes, nodeId])
const lastNodeIdRef = useRef(nodeId)