Scenema Audio 革命性突破:零样本情感语音克隆与文本转语音全解析

【免费下载链接】scenema-audio 【免费下载链接】scenema-audio 项目地址: https://ai.gitcode.com/hf_mirrors/ScenemaAI/scenema-audio

Scenema Audio 是一款突破性的文本转语音系统,它不仅能将文字转换为声音,更能生成具有意图、节奏、呼吸控制和情感弧线的语音表演,从根本上改变了传统语音合成的局限。本文将全面解析这一革命性工具的核心功能、使用方法和技术架构。

🌟 Scenema Audio 的核心能力

Scenema Audio 基于从 LTX 2.3 的 22B 参数视听模型中提取的音频扩散转换器构建,它学习了人们在真实场景中的各种声音表现:愤怒、大笑、低语、哭泣、疲惫、恐惧等。其主要功能包括:

情感表演与声音多样性

  • 情感丰富:支持愤怒、悲伤、喜悦、恐惧、疲惫等多种情感,并且可以通过动作标签在单次生成中实现情感状态的转变
  • 儿童声音:提供六岁儿童、幼儿、青少年的自然声音,而非音调转换的成人声音
  • 多语言支持:涵盖英语、德语、法语、西班牙语、意大利语、葡萄牙语、日语、中文、韩语、俄语、阿拉伯语、印地语、斯瓦希里语等13种语言

场景感知与零样本克隆

  • 场景感知音频:描述环境后,模型会生成带有雨声、雷声、人群声或任何环境音频的语音
  • 零样本语音克隆:只需提供10-20秒具有一定情感变化的参考音频,无需微调或注册,即可将声音特征转移到任何情感表演中
  • 长文本叙述:通过自动分割文本并保持片段间的声音连续性,生成任意长度的音频

🚀 快速开始指南

要开始使用 Scenema Audio,只需执行以下简单步骤:

git clone https://gitcode.com/hf_mirrors/ScenemaAI/scenema-audio
cd scenema-audio

export HF_TOKEN=your_huggingface_token
docker compose up

模型会在首次启动时下载(约38 GB)并缓存在 Docker 卷中。系统会根据您的硬件自动检测 VRAM 策略,推荐在所有配置中使用 SageAttention 2 以获得最佳性能。

📝 提示格式详解

Scenema Audio 使用 XML 格式的提示来控制语音生成,基本结构如下:

<speak voice="VOICE_DESCRIPTION" gender="male|female"
       scene="OPTIONAL_SCENE" language="OPTIONAL_LANG_CODE">
  <action>Performance direction.</action>
  Speech text here.
</speak>

语音描述的艺术

voice 属性是主要控制项,描述越丰富具体,生成效果越好:

  • 声音特质:音色、音调、呼吸感、沙哑感、共鸣
  • 情感状态:愤怒、温柔、疲惫、兴奋、悲伤
  • 说话风格:节奏、强调、停顿、发音
  • 角色原型:"想象托尼·索普拉诺崩溃的样子"
  • 年龄和性别:儿童、老人、年轻女性、十几岁的男孩
  • 口音:英式、美国南部、新泽西意大利裔美国人

动作标签的使用技巧

<action> 标签是塑造语音表达方式的舞台指示,可放置在语音片段之间以指导情感转变、节奏和物理表现:

<speak voice="Middle-aged man, warm but weathered." gender="male">
  <action>Calm, almost casual. Staring at his hands.</action>
  I used to think I had all the time in the world.
  <action>Voice tightens. Fighting to stay composed.</action>
  Then one Tuesday morning, the doctor said three words that changed everything.
  <action>Long pause. Deep breath. Raw but steady.</action>
  And I realized I hadn't called my son in six months.
</speak>

🎭 精彩示例展示

情感表演示例

<speak voice="A man on the edge. Explosive rage. Italian-American inflection."
       gender="male" scene="A dimly lit office, late at night">
  <action>He stands up slowly, voice dangerously low</action>
  You come into my house, you eat my food, and then you got the nerve
  to tell me how to run my business.
  <action>Voice rising, finger pointing</action>
  I built this thing from nothing while you were sitting on your ass.
</speak>

儿童声音示例

<speak voice="A six-year-old girl, bright and excited, speaking fast
with breathless enthusiasm. Slight lisp on S sounds."
gender="female">
  Mommy look! There is a rainbow and it goes all the way across the whole sky!
</speak>

场景感知音频示例

<speak voice="Male, mid 40s. Weathered. Urgent, projecting over wind."
       gender="male" scene="Open dock in a thunderstorm, heavy rain"
       shot="scene">
  <sound>Heavy rain and wind howling</sound>
  <action>He shouts over the storm</action>
  Get the lines! She is pulling loose!
  <sound>Thunder cracks overhead</sound>
  Move! I said move!
</speak>

🔬 技术架构解析

Scenema Audio 的工作流程如下:

XML prompt (voice + scene + action tags + text)
  -> Gemma 3 12B text encoding
  -> 8-step distilled latent diffusion
  -> Audio VAE decoding
  -> MelBandRoFormer vocal separation (strips SFX unless background_sfx=true)
  -> SeedVC voice identity transfer (when reference provided or multi-chunk)
  -> Output WAV (48kHz stereo)

对于较长文本,系统使用 Kokoro 音素级持续时间估计在句子边界处拆分,并通过 A2V 潜在条件维持片段间的声音连续性。

模型 checkpoint

项目提供多种模型 checkpoint 以适应不同需求:

File Size Description
scenema-audio-transformer.safetensors 9.8 GB 音频扩散转换器 (bf16)
scenema-audio-transformer-int8.safetensors 4.9 GB 音频扩散转换器 (INT8, 质量相同)
scenema-audio-pipeline.safetensors 6.7 GB 音频 VAE 解码器 + 声码器 + 文本投影
scenema-audio-vae-encoder.safetensors 42.7 MB 用于参考语音编码的音频 VAE 编码器

VRAM 要求

不同配置下的 VRAM 需求如下:

VRAM Audio Model Gemma Notes
16 GB INT8 (4.9 GB) CPU 流式传输 需要 32 GB 系统内存。~7s/块编码。
24 GB INT8 (4.9 GB) NF4 on GPU (~8 GB) 默认配置。~0.2s/块编码。
48 GB bf16 (9.8 GB) bf16 on GPU (24 GB) 最佳质量。所有模型常驻。

📊 API 参考

POST /generate

主要参数说明:

Field Type Default Description
prompt string required <speak> XML 字符串
mode string "generate" "generate" 用于完整流程,"voice_design" 用于 15s 语音预览
reference_voice_url string null 用于零样本语音克隆的参考音频 URL,10-20 秒且具有情感变化的音频最佳
background_sfx bool false 在输出中保留生成的音效
seed int -1 生成种子,-1 表示随机

响应格式

返回包含 base64 编码 WAV 音频的 JSON:

{
  "status": "succeeded",
  "audio": "<base64-encoded WAV>",
  "content_type": "audio/wav",
  "metadata": {
    "duration_s": 12.4,
    "sample_rate": 48000,
    "processing_ms": 8200,
    "seed": 42
  }
}

⚠️ 局限性说明

使用 Scenema Audio 时需要注意以下局限性:

  • 发音问题:偶尔会混淆复杂的多音节词和专有名词
  • 15秒生成窗口:每个片段限制在 ~15s,较长文本会自动拆分
  • 语音克隆的情感范围:身份转移可能会减少情感极端,使用参考音频时应包含自然的情感变化(10-20秒,不要单调)
  • 多语言发音:语音中切换语言可能导致语音漂移,建议每种语言使用单独的请求
  • 生成速度:根据硬件不同,每15秒片段需要3-8秒
  • 参考音频质量:低质量的参考会降低输出质量,应使用清晰且有情感变化的音频
  • Gemma 3 12B 受限制:需要接受 Google 的使用条款和具有访问权限的 HuggingFace token

🙏 致谢

Scenema Audio 的开发离不开以下项目和技术的支持:

  • LTX-2 by Lightricks 提供基础视听模型
  • Gemma 3 by Google 提供文本编码器
  • SeedVC by Plachta 提供语音优化
  • Kokoro by hexgrad 提供时长估计
  • SageAttention 提供注意力加速

📄 许可证信息

模型权重根据 LTX-2 Community License Agreement 发布。Scenema Audio 的音频扩散转换器源自 LTX 2.3 的视听模型,其权重受相同条款约束。

推理代码和服务器根据 MIT License 发布。

Gemma 3 12B(文本编码器)是需要接受 Google 使用条款的受限模型。

【免费下载链接】scenema-audio 【免费下载链接】scenema-audio 项目地址: https://ai.gitcode.com/hf_mirrors/ScenemaAI/scenema-audio

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐