feat: add browser LivePortrait avatar pipeline

This commit is contained in:
haixin.yang committed 2026-07-11 14:36:04 +08:00
1 parent 32e8a0fbb4
commit e302b25288
14 files changed
+825 -230

No files matched your search

+110
View File
@@ -178,8 +178,63 @@ export const UI_COPY = {
avatarSyncModeCaption: "字幕 + 配音精确对齐",
avatarGenerationNote: "模型已随项目按 50MB 分片托管并由服务工作线程缓存;首次运行需要下载,后续直接复用本地缓存。",
avatarGenerate: "生成口型视频",
avatarQuality: "生成质量",
avatarQualityPreview: "快速预览",
avatarQualityPreviewHint: "256px · FP16 · 自适应 1–2→8fps",
avatarQualityFull: "高质量",
avatarQualityFullHint: "512px · FP16 · 自适应 1–2→8fps",
avatarGenerating: "正在生成数字人视频",
avatarGenerationHint: "首次运行会下载模型;请保持此页面打开。",
avatarProgressDownloadFile: "下载 {file}",
avatarProgressDownloadModel: "下载 {model}",
avatarProgressInitHubert: "初始化 JoyVASA HuBERT WebGPU",
avatarProgressInitMotion: "初始化 JoyVASA 运动 WebGPU",
avatarProgressInitModel: "初始化 {model}",
avatarProgressMotionStep: "生成口型运动 {current}/{total}",
avatarProgressPrepareAudio: "准备真实音频驱动",
avatarProgressAudioReady: "音频特征完成",
avatarProgressMotionReady: "真实音频运动生成完成",
avatarProgressReuseMotion: "复用当前配音口型运动",
avatarProgressPreparePortraitMotion: "准备肖像与真实口型运动",
avatarProgressExtract3d: "提取人物 3D 特征",
avatarProgressReuseGpuFeature: "复用人物 GPU 特征",
avatarProgressKeyframe: "FP16 WebGPU 关键帧 {current}/{total} · {seconds}s",
avatarProgressFrameEncoded: "完成帧 {current}/{total} · 编码 {seconds}s",
avatarProgressRetryCorruptFrame: "检测到异常关键帧 {current}/{total},正在原位重推(第 {attempt} 次)",
avatarProgressDroppedCorruptFrame: "异常关键帧 {current}/{total} 已丢弃并沿用上一正常帧",
avatarProgressInterpolate: "关键帧生成完成,准备运动插帧",
avatarProgressExtractFeature: "提取人物特征",
avatarProgressWarp3d: "计算 3D 形变(可能需要约 1 分钟)",
avatarProgressRenderPortrait: "渲染 512×512 人像",
avatarProgressEncodeVideo: "编码数字人视频",
fileMenu: "文件",
projectMenuHeading: "工程",
newProject: "新建工程",
newProjectHint: "从空白时间线开始",
importProject: "导入工程包",
importProjectHint: "恢复时间线与全部媒体",
exportProject: "导出工程包",
exportProjectHint: "打包图片、视频和音频",
ttsWarningChineseSymbolsCleaned: "已自动清理中文语音不支持的符号,避免本地 ONNX 运行失败。",
ttsWarningEnglishCharactersCleaned: "已自动清理英文语音不支持的字符。",
ttsErrorChineseVoiceEnglishText: "当前中文语音不适合大量英文文案,请切换 English 声音后再生成。",
ttsErrorNoChineseContent: "当前中文语音没有可朗读的中文内容,请输入中文或切换英文声音。",
ttsErrorEnglishVoiceChineseText: "当前英文语音不适合中文文案,请切换中文声音后再生成。",
ttsErrorNoEnglishContent: "当前英文语音没有可朗读的英文内容,请输入英文或切换中文声音。",
ttsErrorEmptyScript: "请输入要生成的文案。",
ttsErrorVoiceMismatch: "当前文案不适合所选语音。",
ttsStatusPreparingModel: "准备本地模型",
ttsStatusLoadingChineseModel: "下载或读取中文 ONNX 模型",
ttsStatusClearingCache: "模型缓存空间不足,正在清理后重试",
ttsStatusLoadingKokoro: "加载 Kokoro 82M q8",
ttsStatusGeneratingEnglish: "生成英文配音",
ttsStatusDecodingWaveform: "解析音频波形",
ttsNoticePiperCacheCleared: "浏览器模型缓存空间紧张,已清理 Piper 缓存后继续生成。",
ttsGenerated: "已生成",
ttsNoticeGenerated: "配音已生成并写入时间线",
ttsErrorUnsupportedPiperSymbols: "当前中文语音模型不支持这段文案里的部分字符,请清理英文/特殊符号,或切换 English 声音。",
ttsErrorStorageQuota: "浏览器模型缓存空间不足,请在设置里清理模型缓存后重试。",
ttsErrorGenerationFailed: "生成失败,请重试",
top: "顶部",
middle: "居中",
bottom: "底部",
@@ -422,8 +477,63 @@ export const UI_COPY = {
avatarSyncModeCaption: "Captions + voiceover alignment",
avatarGenerationNote: "Models ship with the project in 50 MB chunks and are cached by the service worker. First use downloads them; later runs reuse the local cache.",
avatarGenerate: "Generate lip-sync video",
avatarQuality: "Render quality",
avatarQualityPreview: "Fast preview",
avatarQualityPreviewHint: "256px · FP16 · adaptive 1–2→8fps",
avatarQualityFull: "High quality",
avatarQualityFullHint: "512px · FP16 · adaptive 1–2→8fps",
avatarGenerating: "Generating avatar video",
avatarGenerationHint: "First use downloads models. Keep this page open.",
avatarProgressDownloadFile: "Downloading {file}",
avatarProgressDownloadModel: "Downloading {model}",
avatarProgressInitHubert: "Initializing JoyVASA HuBERT WebGPU",
avatarProgressInitMotion: "Initializing JoyVASA motion WebGPU",
avatarProgressInitModel: "Initializing {model}",
avatarProgressMotionStep: "Generating lip motion {current}/{total}",
avatarProgressPrepareAudio: "Preparing audio-driven motion",
avatarProgressAudioReady: "Audio features ready",
avatarProgressMotionReady: "Audio-driven motion ready",
avatarProgressReuseMotion: "Reusing motion from the current voiceover",
avatarProgressPreparePortraitMotion: "Preparing portrait and lip motion",
avatarProgressExtract3d: "Extracting 3D portrait features",
avatarProgressReuseGpuFeature: "Reusing portrait GPU features",
avatarProgressKeyframe: "FP16 WebGPU keyframe {current}/{total} · {seconds}s",
avatarProgressFrameEncoded: "Frame {current}/{total} complete · encoded in {seconds}s",
avatarProgressRetryCorruptFrame: "Corrupt keyframe {current}/{total} detected; retrying in place (attempt {attempt})",
avatarProgressDroppedCorruptFrame: "Corrupt keyframe {current}/{total} dropped; holding the previous valid frame",
avatarProgressInterpolate: "Keyframes ready · preparing motion interpolation",
avatarProgressExtractFeature: "Extracting portrait features",
avatarProgressWarp3d: "Computing 3D warping (may take about 1 minute)",
avatarProgressRenderPortrait: "Rendering 512×512 portrait",
avatarProgressEncodeVideo: "Encoding talking-avatar video",
fileMenu: "File",
projectMenuHeading: "Project",
newProject: "New project",
newProjectHint: "Start with a blank timeline",
importProject: "Import project package",
importProjectHint: "Restore the timeline and all media",
exportProject: "Export project package",
exportProjectHint: "Bundle images, video, and audio",
ttsWarningChineseSymbolsCleaned: "Unsupported symbols were cleaned automatically to prevent the local ONNX voice model from failing.",
ttsWarningEnglishCharactersCleaned: "Unsupported characters were cleaned automatically for the English voice.",
ttsErrorChineseVoiceEnglishText: "The selected Chinese voice is not suitable for mostly English text. Switch to an English voice and try again.",
ttsErrorNoChineseContent: "No readable Chinese content remains. Enter Chinese text or switch to an English voice.",
ttsErrorEnglishVoiceChineseText: "The selected English voice is not suitable for Chinese text. Switch to a Chinese voice and try again.",
ttsErrorNoEnglishContent: "No readable English content remains. Enter English text or switch to a Chinese voice.",
ttsErrorEmptyScript: "Enter a script to generate voiceover.",
ttsErrorVoiceMismatch: "The script is not suitable for the selected voice.",
ttsStatusPreparingModel: "Preparing local model",
ttsStatusLoadingChineseModel: "Downloading or loading the Chinese ONNX model",
ttsStatusClearingCache: "Model cache is full · clearing it before retrying",
ttsStatusLoadingKokoro: "Loading Kokoro 82M q8",
ttsStatusGeneratingEnglish: "Generating English voiceover",
ttsStatusDecodingWaveform: "Analyzing audio waveform",
ttsNoticePiperCacheCleared: "Browser model storage was low. The Piper cache was cleared and generation will continue.",
ttsGenerated: "Generated",
ttsNoticeGenerated: "Voiceover generated and added to the timeline.",
ttsErrorUnsupportedPiperSymbols: "The Chinese voice model does not support some characters in this script. Remove English or special symbols, or switch to an English voice.",
ttsErrorStorageQuota: "Browser model storage is full. Clear the model cache in Settings and try again.",
ttsErrorGenerationFailed: "Generation failed. Try again.",
top: "Top",
middle: "Middle",
bottom: "Bottom",