feat(digital-human): 前端加视频工作流选择器(api_video_workflow)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
boos
2026-06-18 02:57:44 +08:00
parent 53f99affec
commit 3524a165e3
+16
View File
@@ -32,6 +32,7 @@ type DigitalHumanDraft = {
refAudioPath?: string;
previewTtsText?: string;
imageWorkflow?: string;
apiVideoWorkflow?: string;
imageWidth?: number;
imageHeight?: number;
promptPrefix?: string;
@@ -368,6 +369,7 @@ export default function DigitalHuman() {
const [refAudioPath, setRefAudioPath] = useState(isPrivateWorkspaceMediaUrl(draftRef.current.refAudioPath) ? '' : draftRef.current.refAudioPath || '');
const [previewTtsText, setPreviewTtsText] = useState(draftRef.current.previewTtsText || '你好,欢迎使用 BoosAPI 数字人。');
const [imageWorkflow, setImageWorkflow] = useState(draftRef.current.imageWorkflow || '');
const [apiVideoWorkflow, setApiVideoWorkflow] = useState(draftRef.current.apiVideoWorkflow || '');
const [imageWidth, setImageWidth] = useState(() => normalizeNumber(draftRef.current.imageWidth, 1024, 64));
const [imageHeight, setImageHeight] = useState(() => normalizeNumber(draftRef.current.imageHeight, 1024, 64));
const [promptPrefix, setPromptPrefix] = useState(draftRef.current.promptPrefix || DEFAULT_PROMPT_PREFIX);
@@ -460,6 +462,7 @@ export default function DigitalHuman() {
refAudioPath,
previewTtsText,
imageWorkflow,
apiVideoWorkflow,
imageWidth,
imageHeight,
promptPrefix,
@@ -478,6 +481,7 @@ export default function DigitalHuman() {
refAudioPath,
previewTtsText,
imageWorkflow,
apiVideoWorkflow,
imageWidth,
imageHeight,
promptPrefix,
@@ -574,6 +578,7 @@ export default function DigitalHuman() {
title: title.trim() || undefined,
n_scenes: nScenes,
media_workflow: imageWorkflow || undefined,
api_video_workflow: apiVideoWorkflow || undefined,
tts_workflow: ttsWorkflow || undefined,
frame_template: frameTemplate,
ratio: selectedTemplateSize.ratio,
@@ -1010,6 +1015,17 @@ export default function DigitalHuman() {
))}
</select>
</label>
<label className="digital-human-field">
<span>视频工作流(可选,生成说话视频)</span>
<select value={apiVideoWorkflow} onChange={(event) => setApiVideoWorkflow(event.target.value)}>
<option value="">不生成视频(仅图片合成)</option>
{mediaWorkflows
.filter((wf) => wf.name.toLowerCase().includes('video'))
.map((wf) => (
<option key={workflowValue(wf)} value={workflowValue(wf)}>{pickItemLabel(wf)}{wf.source ? ` · ${wf.source}` : ''}</option>
))}
</select>
</label>
<div className="digital-human-form-grid">
<label className="digital-human-field">
<span>宽度</span>