mcpField
T
talking-head-production

talking-head-production

github.com/inference-sh创意与媒体789982 次安装2 周前更新
代码仓库

关于 talking-head-production

用于通过 inference.sh CLI 制作 AI 虚拟人和口型同步视频的创作技能,面向视频内容制作者。涵盖肖像准备、模型选择、配音及长视频分段等流程。

主要功能

  1. 01生成带口型同步的虚拟人视频
  2. 02使用内置 TTS 或自定义音频
  3. 03支持多角色及多语言内容
  4. 04将长视频拆分并合并
  5. 05提供肖像构图与音频建议

适用场景

  1. 01制作产品讲解或演示视频
  2. 02为角色配音并生成说话视频
  3. 03制作多角色对话片段
  4. 04分段制作较长的视频内容

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/inference-sh/skills --skill talking-head-production

安装后在 Claude Code 中输入/talking-head-production确认已加载。

详细介绍

安装 belt CLI 技能: npx skills add belt-sh/cli

数字人视频制作

通过 inference.sh CLI 使用 AI 数字人和口型同步创建数字人视频。

快速开始

需要 inference.sh CLI(belt)。安装说明

belt login

# Recommended: P-Video-Avatar (built-in TTS, fastest, cheapest)
belt app run pruna/p-video-avatar --input '{
  "image": "https://portrait.jpg",
  "voice_script": "Welcome to our product tour. Today I will show you three features that will save you hours every week.",
  "voice": "Zephyr (Female)"
}'

肖像要求

源肖像图至关重要。肖像质量差 = 视频效果差。

必须满足
要求原因规格
居中取景数字人需要在可预测的位置显示面部面部在画面中居中
头部和肩部入镜身体入镜,手势才自然裁切至胸部以下
双眼看向镜头与观众建立联系正面直视
表情自然为动画提供起始状态可以微笑,但不要大笑或皱眉
面部清晰模型需要识别面部特征不戴太阳镜,无浓重阴影或遮挡
高分辨率保留细节面部区域至少为 512x512,最好为 1024x1024+
生成肖像
# Generate a professional portrait with P-Image
belt app run pruna/p-image --input '{
  "prompt": "professional headshot portrait of a friendly business person, soft studio lighting, clean grey background, head and shoulders, direct eye contact, neutral pleasant expression, photorealistic",
  "aspect_ratio": "9:16"
}'
背景选项
类型适用场景
纯色专业、简洁,易于合成
柔和散景自然、生活化的感觉
办公室/影棚商务场景
动态(P-Video-Avatar)使用 video_prompt 设置背景

模型选择

从 P-Video-Avatar 开始——它比其他选项快 18 倍、便宜 6 倍,并内置 TTS。

模型App ID内置 TTS最适合
P-Video-Avatarpruna/p-video-avatar是(30 种声音,10 种语言)综合最佳:速度、成本、质量
OmniHuman 1.5bytedance/omnihuman-1-5否多角色、手势
OmniHuman 1.0bytedance/omnihuman-1-0否单个角色
Fabric 1.0falai/fabric-1-0是让图像开口说话并进行口型同步
PixVerse Lipsyncfalai/pixverse-lipsync是为现有视频进行口型同步
成本与速度对比
模型速度(每秒视频所需时间)每秒成本
P-Video-Avatar约 1.83 秒/秒$0.025
OmniHuman 1.5约 28 秒/秒(慢 15 倍)$0.16(贵 6.4 倍)
Fabric 1.0约 34 秒/秒(慢 18 倍)$0.14(贵 5.6 倍)

制作工作流

简单流程:文本脚本 -> 视频(P-Video-Avatar)

无需单独进行 TTS——P-Video-Avatar 内置语音:

belt app run pruna/p-video-avatar --input '{
  "image": "https://portrait.jpg",
  "voice_script": "Hi there! I am excited to share something with you today.",
  "voice": "Puck (Male)",
  "voice_language": "English (US)",
  "resolution": "720p"
}'
控制风格
belt app run pruna/p-video-avatar --input '{
  "image": "https://portrait.jpg",
  "voice_script": "This is exciting news for our community!",
  "voice": "Aoede (Female)",
  "voice_prompt": "Enthusiastic and energetic tone, slightly faster pace",
  "video_prompt": "The person is presenting on stage with dramatic lighting",
  "resolution": "1080p"
}'
音频驱动(任意模型)

提供自己的音频文件:

# P-Video-Avatar with custom audio
belt app run pruna/p-video-avatar --input '{
  "image": "https://portrait.jpg",
  "audio": "https://speech.mp3"
}'

# OmniHuman with custom audio
belt app run bytedance/omnihuman-1-5 --input '{
  "image": "https://portrait.jpg",
  "audio": "https://speech.mp3"
}'
完整工作流:生成肖像 + 数字人
# 1. Generate a portrait image
belt app run pruna/p-image --input '{
  "prompt": "professional headshot portrait of a young woman, neutral background, looking at camera, studio lighting, photorealistic",
  "aspect_ratio": "9:16"
}'

# 2. Create avatar video with built-in TTS
belt app run pruna/p-video-avatar --input '{
  "image": "<image-url-from-step-1>",
  "voice_script": "Hi there! Let me walk you through our latest features.",
  "voice": "Zephyr (Female)"
}'
使用单独的 TTS(适用于不支持 TTS 的模型)
# 1. Generate speech
belt app run falai/dia-tts --input '{
  "prompt": "[S1] Your narration script here."
}'

# 2. Create talking head
belt app run bytedance/omnihuman-1-5 --input '{
  "image": "https://portrait.jpg",
  "audio": "<audio-url-from-step-1>"
}'
多角色对话

OmniHuman 1.5 最多支持 2 个角色:

# 1. Generate dialogue with two speakers
belt app run falai/dia-tts --input '{
  "prompt": "[S1] So tell me about the new feature. [S2] Sure! We built a dashboard that shows real-time analytics. [S1] That sounds great. How long did it take? [S2] About two weeks from concept to launch."
}'

# 2. Create video with two characters
belt app run bytedance/omnihuman-1-5 --input '{
  "image": "https://two-person-portrait.png",
  "audio": "<audio-url>"
}'
长篇内容(拼接片段)

对于长于约 60 秒的内容,请拆分为多个片段:

# Generate clips with same portrait for consistency
belt app run pruna/p-video-avatar --input '{"image": "https://portrait.jpg", "voice_script": "Segment one..."}' --no-wait
belt app run pruna/p-video-avatar --input '{"image": "https://portrait.jpg", "voice_script": "Segment two..."}' --no-wait
belt app run pruna/p-video-avatar --input '{"image": "https://portrait.jpg", "voice_script": "Segment three..."}' --no-wait

# Merge all segments
belt app run infsh/media-merger --input '{
  "media_files": [
    {"file": "segment1.mp4"},
    {"file": "segment2.mp4"},
    {"file": "segment3.mp4"}
  ]
}'
多语言内容

P-Video-Avatar 内置 TTS,支持 10 种语言:

# Spanish
belt app run pruna/p-video-avatar --input '{
  "image": "https://portrait.jpg",
  "voice_script": "Bienvenidos a nuestra demostración de producto.",
  "voice": "Kore (Female)",
  "voice_language": "Spanish"
}'

# Japanese
belt app run pruna/p-video-avatar --input '{
  "image": "https://portrait.jpg",
  "voice_script": "こんにちは、製品デモへようこそ。",
  "voice": "Leda (Female)",
  "voice_language": "Japanese"
}'
为现有视频配音
# 1. Transcribe original video
belt app run infsh/fast-whisper-large-v3 --input '{"audio": "https://video.mp4"}'

# 2. Translate text (manually or with LLM)

# 3. Generate speech in new language
belt app run falai/kokoro-tts --input '{"prompt": "<translated-text>"}'

# 4. Lipsync original video with new audio
belt app run infsh/latentsync-1-6 --input '{
  "video_path": "https://original-video.mp4",
  "audio_path": "<new-audio-url>"
}'

音频质量(适用于非 TTS 工作流)

使用自己的音频时,音频质量会直接影响口型同步的准确性。

参数目标原因
背景噪声无/尽量少噪声会干扰口型同步时序
音量全程一致避免同步漂移
采样率44.1kHz 或 48kHz标准音质
格式MP3 128kbps+ 或 WAV兼容所有工具

可用语音(P-Video-Avatar)

女性: Zephyr、Kore、Leda、Aoede、Callirrhoe、Autonoe、Despina、Erinome、Laomedeia、Achernar、Gacrux、Pulcherrima、Vindemiatrix、Sulafat

男性: Puck、Charon、Fenrir、Orus、Enceladus、Iapetus、Umbriel、Algenib、Algieba、Schedar、Achird、Zubenelgenubi、Sadachbia、Sadaltager、Alnilam、Rasalgethi

语言: 英语(美国)、英语(英国)、西班牙语、法语、德语、意大利语、葡萄牙语(巴西)、日语、韩语、印地语

取景指南

┌─────────────────────────────────┐
│          Headroom (minimal)     │
│  ┌───────────────────────────┐  │
│  │                           │  │
│  │     ● ─ ─ Eyes at 1/3 ─ ─│─ │ ← Eyes at top 1/3 line
│  │    /|\                    │  │
│  │     |   Head & shoulders  │  │
│  │    / \  visible           │  │
│  │                           │  │
│  └───────────────────────────┘  │
│       Crop below chest          │
└─────────────────────────────────┘

常见错误

错误问题修复方法
低分辨率人像面部模糊,唇形同步效果差使用 1024x1024+ 的面部区域
侧面/侧身角度唇形同步难以准确追踪嘴部使用正面或接近正面的角度
音频有噪声唇形同步偏移,看起来不自然使用内置 TTS 或录制清晰音频
视频片段过长质量下降拆分成多个片段后再拼接
戴太阳镜/有遮挡面部特征被遮挡必须保证面部无遮挡
光线不一致动画效果诡异使用均匀、柔和的光线

相关技能

# Dedicated P-Video-Avatar skill
npx skills add inference-sh/skills@p-video-avatar

# All avatar models
npx skills add inference-sh/skills@ai-avatar-video

# All video generation models
npx skills add inference-sh/skills@ai-video-generation

# Text-to-speech
npx skills add inference-sh/skills@text-to-speech

# Image generation (for portraits)
npx skills add inference-sh/skills@ai-image-generation

浏览所有应用:belt app list

评论

支持 Markdown