P paper2skillsPlaybook
开始业务诊断
访客模式
20-AI视频生成

Brand Video Generation — AI品牌视频生成:从文本/图像到高保真营销视频的全链路技术

Skill-Brand-Video-Generation

声明类型推断验证状态待复核

品牌经理面临视频产能跟不上投放——品牌视频生成将产出周期从5天缩到6小时,年化省18万元

来源
paper2skills-vault/20-AI视频生成/Skill-Brand-Video-Generation.md
适用边界
论文方法到业务问题的项目侧映射,不自动证明客户根因。
声明类型示例验证状态待企业数据验证

4.5 万元

来源
paper2skills-vault/20-AI视频生成/Skill-Brand-Video-Generation.md#business-value
适用边界
方法估算或场景示例,不等于客户结果或收益承诺。

待企业数据验证 · 缺失:样本、基线、时间窗、币种、计算方法、证据来源

业务视角
适用角色内容运营 / 品牌负责人 · 社媒运营 · CMO
适用平台TikTok Shop LIVE · Instagram Reels · 多语言虚拟主播(英/西/阿/日)
什么情况下用TikTok/Reels 需要大量视频,拍摄成本高周期长产能跟不上;想做直播带货但真人主播成本高语言是障碍
示例目标(需企业数据验证)视频内容产能提升 5-10 倍,单条视频成本降低 80%,多语言市场内容本地化快速覆盖
业务痛点
视频内容来不及做拍视频成本太高主播太贵或不稳定多语言内容没有人拍TikTok 更新频率要求太高

1. 解决的问题

品牌经理面临视频产能跟不上投放——品牌视频生成将产出周期从5天缩到6小时,年化省18万元

2. 核心算法逻辑

核心思想

品牌视频生成(Brand Video Generation)解决的核心问题是:如何将品牌语义(Logo、色调、产品特征)与视频扩散模型对齐,在保留用户意图(语义保真)的同时实现自然的品牌可见性。

传统广告视频制作需要专业摄影团队、后期剪辑、演员档期协调,成本高周期长。AI 视频生成将这一链路压缩为:品牌知识库 + 产品图 + 文本提示 → 高保真营销视频。

核心挑战的三个维度:

  1. 语义保真:生成视频不能扭曲用户意图,品牌元素需自然融入场景
  2. 身份一致性:人物外貌、产品细节(Logo、纹理、形状)在帧间保持一致
  3. 运动真实性:人物-产品交互动作符合物理规律,手势与产品尺寸适配

三篇核心论文的互补关系

论文arXiv ID核心贡献适用场景
BrandFusion (2603.02816)[2603.02816](https://arxiv.org/abs/2603.02816)多智能体无缝品牌融合框架,离线品牌知识库 + 在线 5-Agent 协同已有品牌的 T2V 广告生成
Aquarius (2505.10584)[2505.10584](https://arxiv.org/abs/2505.10584)工业级营销视频生成系统,2B/13.4B DiT + 2.35x 推理加速大规模广告创意生产
DreamActor-H1 (2506.10568)[2506.10568](https://arxiv.org/abs/2506.10568)人-产品展示视频 DiT 框架,3D 肢体模板 + 掩码交叉注意力电商产品演示视频生成

BrandFusion:多智能体品牌融合(主干算法)

离线阶段(品牌方视角):构建品牌知识库

品牌知识库构建流程:
  1. 先验知识探测:向 T2V 模型查询品牌已知信息
     → 判断模型对品牌的"内在认知"程度
  2. 选择性微调:对新品牌/模型未识别品牌
     → 使用 LoRA 轻量微调(<100 样本)
     → 存储 Adapter 参数到知识库
  3. 知识库结构:{品牌档案, Adapter 权重, 历史成功经验}

在线阶段(用户视角):5 智能体协同精化

Agent 1 品牌选择器 (Brand Selector)
  输入:用户提示词
  输出:最匹配的品牌 + 置信度分数
  
Agent 2 策略生成器 (Strategy Generator)  
  输入:品牌档案 + 当前提示词
  输出:品牌整合策略(前景/背景/道具)

Agent 3 提示词精化器 (Prompt Refiner)
  输入:原始提示词 + 整合策略
  输出:精化后的品牌提示词

Agent 4 批评者 (Critic)
  输入:精化提示词 + 品牌标准
  输出:质量分数 + 修改建议
  
Agent 5 经验学习者 (Experience Learner)
  输入:历史成功/失败案例
  输出:更新知识库中的经验条目

品牌存在率(BPR)与自然度评分:

\text{BrandFusion Score} = \lambda \cdot \text{BPR} + (1-\lambda) \cdot \text{Naturalness}

其中 Naturalness = avg(场景契合度, 视觉融合度, 非侵入性),$\lambda=0.5$

Aquarius:工业级视频生成架构

双流 DiT 架构(13.4B 参数版本):

输入:文本 + 可选图像参考
  ↓
文本流:预训练文本编码器 → 语义稠密表示
视觉流:VAE 编码器 → 时空特征(计算资源优先分配)
  ↓
Multimodal-DiT(双流注意力)
  - Cross-attention:文本-视觉对齐
  - Self-attention:帧内一致性
  - Temporal attention:帧间动作连贯性
  ↓
VAE 解码器 → 高分辨率视频帧

关键性能指标:

  • 训练 MFU(Model FLOPs Utilization)= 36%(大规模集群)
  • 推理加速:Diffusion Cache + 注意力优化 = 2.35x 加速
  • 支持多分辨率/多时长/多宽高比

DreamActor-H1:人-产品展示视频生成

核心机制:掩码交叉注意力(Masked Cross-Attention)

\text{Output} = \text{Attention}(Q_{video}, K_{human} \oplus K_{product}, V_{human} \oplus V_{product}) \cdot M_{mask}

掩码 $M_{mask}$ 分离人物和产品的注意力区域,防止特征混淆。

运动引导(3D 体型模板):

  • SMPL-X 体型参数 → 手势和身体运动模板
  • 产品边界框 → 自动匹配人手大小与产品尺寸
  • 推理时自动选择最合适的动作模板池

文本语义增强:

  • 结构化文本编码 → 注入产品类别共识语义
  • 增强材质视觉质量 + 小角度旋转 3D 一致性

与 Aquarius-Brand-Video-Generation 合并(2026-10-02)

原 Aquarius-Brand-Video-Generation(149 行)与本卡交付同一件东西,已并入本卡后退役,关系与引用一并转到这里。并进来时逐项核对过的独有内容:

  • 原卡展开的角度:数学直觉、关键假设
  • 原卡的实现入口:generate_campaign()

3. 业务应用场景

业务背景:Amazon 美国站婴儿消毒锅新品上架,需要生成 3 条展示视频:妈妈使用场景、产品 360° 旋转、功能特性展示。传统外拍费用约 1.5 万元/条,周期 7-14 天。

ROI 估算: - 节省拍摄成本:1.5 万元/条 × 3 条 = 4.5 万元 - AI 生成成本:<100 元(GPU 算力) - 时间压缩:14 天 → 2 小时 - 单次 ROI ≈ 450x

业务背景:跨境母婴品牌"BabyBliss"在 TikTok/Meta 投放广告,需每周生产 20+ 条不同场景的广告素材(公园、厨房、婴儿房等),品牌色(薰衣草紫 #8A7ED9)和 Logo 需贯穿始终。

4. 输入数据要求

未提取到输入条目;请核对原始 Skill 卡片与代码。

5. 输出结果

未提取到输出条目;请核对原始 Skill 卡片与代码。

6. 业务价值与 ROI

4.5 万元

7. 代码模板

代码块数量:8

Python574 行 · 完整显示
"""
Brand Video Generation Pipeline
整合 BrandFusion(品牌知识库 + 多智能体提示精化)+ Aquarius(工业级视频生成)核心逻辑
Mock 实现,完全可运行,含完整测试用例
"""

import json
import random
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Tuple


# ─── 数据结构 ───────────────────────────────────────────────────────────────

@dataclass
class BrandProfile:
    """品牌档案(BrandFusion 离线知识库单元)"""
    brand_name: str
    primary_color: str          # hex,如 "#8A7ED9"
    logo_position: str          # "top-right" / "bottom-left" 等
    font_style: str             # "rounded" / "serif" 等
    brand_keywords: List[str]   # 品牌关键词列表
    is_novel: bool = True       # 是否需要微调(True=新品牌)
    adapter_path: Optional[str] = None  # LoRA adapter 路径
    past_experiences: List[Dict] = field(default_factory=list)  # 成功经验


@dataclass
class VideoGenerationConfig:
    """视频生成配置"""
    width: int = 1280
    height: int = 720
    fps: int = 24
    duration_seconds: int = 15
    num_inference_steps: int = 16
    guidance_scale: float = 7.5
    seed: int = 42


@dataclass
class GenerationResult:
    """生成结果"""
    refined_prompt: str
    brand_presence_rate: float    # 0-1,品牌存在率
    naturalness_score: float      # 1-5,自然度
    semantic_fidelity: float      # 0-1,语义保真度
    video_path: str               # 模拟路径
    generation_cost_yuan: float   # 成本(元)


# ─── BrandFusion:多智能体品牌提示精化 ─────────────────────────────────────

class BrandSelector:
    """Agent 1:品牌选择器"""

    def __init__(self, brand_db: Dict[str, BrandProfile]):
        self.brand_db = brand_db

    def select(self, user_prompt: str) -> Tuple[str, float]:
        """
        根据提示词选择最匹配品牌
        Returns: (brand_name, confidence)
        """
        best_brand = None
        best_score = 0.0
        prompt_words = set(user_prompt.lower().split())

        for name, profile in self.brand_db.items():
            keyword_overlap = len(
                set(kw.lower() for kw in profile.brand_keywords) & prompt_words
            )
            # 简化的相关性分数
            score = min(1.0, 0.5 + keyword_overlap * 0.15)
            if score > best_score:
                best_score = score
                best_brand = name

        return best_brand or "default", best_score


class StrategyGenerator:
    """Agent 2:品牌整合策略生成器"""

    STRATEGY_TEMPLATES = {
        "park": "将品牌主色调融入背景植被,{logo_pos} 显示 Logo",
        "kitchen": "产品置于前景,品牌色系融入橱柜和餐具,{logo_pos} 水印",
        "bedroom": "柔和品牌色调融入床品,{logo_pos} 显示 Logo",
        "default": "背景融入品牌主色调 {color},{logo_pos} 显示 Logo",
    }

    def generate(self, brand: BrandProfile, user_prompt: str) -> str:
        scene = "default"
        for keyword in ["park", "kitchen", "bedroom"]:
            if keyword in user_prompt.lower():
                scene = keyword
                break
        template = self.STRATEGY_TEMPLATES[scene]
        return template.format(
            color=brand.primary_color,
            logo_pos=brand.logo_position,
        )


class PromptRefiner:
    """Agent 3:提示词精化器"""

    def refine(
        self,
        user_prompt: str,
        brand: BrandProfile,
        strategy: str,
    ) -> str:
        """
        将品牌元素自然融入用户提示词
        """
        color_desc = f"{brand.primary_color} color tone"
        brand_hint = f"subtle {brand.brand_name} brand elements"
        refined = (
            f"{user_prompt}, {color_desc} atmosphere, "
            f"{brand_hint} naturally integrated, "
            f"professional commercial quality"
        )
        return refined


class Critic:
    """Agent 4:质量批评者"""

    def evaluate(
        self,
        refined_prompt: str,
        brand: BrandProfile,
    ) -> Tuple[float, List[str]]:
        """
        评估精化提示词质量
        Returns: (naturalness_score, suggestions)
        """
        suggestions = []
        score = 4.0

        # 检查品牌关键词存在性
        has_brand = brand.brand_name.lower() in refined_prompt.lower()
        has_color = brand.primary_color.lower() in refined_prompt.lower() or \
                    "color tone" in refined_prompt.lower()

        if not has_color:
            score -= 0.5
            suggestions.append(f"建议加入品牌色调: {brand.primary_color}")

        # 检查提示词长度(过长影响语义)
        word_count = len(refined_prompt.split())
        if word_count > 60:
            score -= 0.3
            suggestions.append("提示词过长,建议压缩至 50 词以内")

        # 检查是否过于商业化(影响自然度)
        commercial_words = ["advertisement", "sponsored", "buy now", "discount"]
        if any(w in refined_prompt.lower() for w in commercial_words):
            score -= 0.8
            suggestions.append("避免直接商业词汇,降低品牌侵入感")

        return min(5.0, max(1.0, score + random.uniform(-0.2, 0.2))), suggestions


class ExperienceLearner:
    """Agent 5:经验学习者"""

    def update(
        self,
        brand: BrandProfile,
        result: "GenerationResult",
        scene_type: str,
    ) -> None:
        """将成功经验存入品牌档案"""
        if result.naturalness_score >= 4.0 and result.brand_presence_rate >= 0.85:
            experience = {
                "scene": scene_type,
                "refined_prompt": result.refined_prompt,
                "naturalness": result.naturalness_score,
                "bpr": result.brand_presence_rate,
            }
            brand.past_experiences.append(experience)


class BrandFusionPipeline:
    """
    BrandFusion 多智能体品牌融合主流程
    离线:品牌知识库构建
    在线:5 智能体协同生成品牌视频提示词
    """

    def __init__(self):
        self.brand_db: Dict[str, BrandProfile] = {}
        self.selector = BrandSelector(self.brand_db)
        self.strategy_gen = StrategyGenerator()
        self.refiner = PromptRefiner()
        self.critic = Critic()
        self.learner = ExperienceLearner()

    def register_brand(self, profile: BrandProfile) -> None:
        """离线注册品牌到知识库"""
        self.brand_db[profile.brand_name] = profile
        self.selector.brand_db = self.brand_db
        print(f"[BrandFusion] 注册品牌: {profile.brand_name} "
              f"({'需微调' if profile.is_novel else '已知品牌'})")

    def generate_prompt(
        self,
        user_prompt: str,
        target_brand: Optional[str] = None,
        max_iterations: int = 3,
    ) -> Tuple[str, float, float]:
        """
        在线生成品牌视频提示词
        Returns: (refined_prompt, naturalness_score, brand_presence_rate)
        """
        # Agent 1:品牌选择
        if target_brand and target_brand in self.brand_db:
            brand_name, confidence = target_brand, 1.0
        else:
            brand_name, confidence = self.selector.select(user_prompt)
        brand = self.brand_db[brand_name]
        print(f"[Agent1-BrandSelector] 选择品牌: {brand_name} (置信度={confidence:.2f})")

        # Agent 2:策略生成
        strategy = self.strategy_gen.generate(brand, user_prompt)
        print(f"[Agent2-StrategyGen] 策略: {strategy}")

        # Agent 3+4:迭代精化
        refined = user_prompt
        final_score = 3.0
        for i in range(max_iterations):
            refined = self.refiner.refine(user_prompt, brand, strategy)
            score, suggestions = self.critic.evaluate(refined, brand)
            print(f"[Agent3+4 迭代{i+1}] 自然度={score:.2f}, 建议={suggestions}")
            final_score = score
            if score >= 4.5 or not suggestions:
                break

        # 模拟品牌存在率
        bpr = min(1.0, 0.75 + confidence * 0.15 + (final_score - 3) * 0.05)
        return refined, final_score, bpr


# ─── Aquarius 风格工业级视频生成(Mock) ────────────────────────────────────

class AquariusVideoGenerator:
    """
    Aquarius 工业级视频生成器(Mock)
    模拟 2B/13.4B DiT 架构的推理行为
    """

    # 推理成本估算(元/秒视频)
    COST_PER_SECOND = {
        "2B": 0.05,    # 轻量模型
        "13.4B": 0.15,  # 高质量模型
    }

    def __init__(self, model_size: str = "2B"):
        self.model_size = model_size
        self.speedup_factor = 2.35  # 扩散缓存加速

    def generate(
        self,
        prompt: str,
        config: VideoGenerationConfig,
        reference_image_path: Optional[str] = None,
    ) -> Dict:
        """
        模拟视频生成
        Returns: 生成结果信息
        """
        base_steps = config.num_inference_steps
        actual_steps = int(base_steps / self.speedup_factor)

        cost = (
            self.COST_PER_SECOND[self.model_size]
            * config.duration_seconds
        )

        print(f"[Aquarius-{self.model_size}] 生成视频")
        print(f"  提示词: {prompt[:60]}...")
        print(f"  分辨率: {config.width}×{config.height}, {config.fps}fps, "
              f"{config.duration_seconds}s")
        print(f"  推理步数: {base_steps} → {actual_steps}({self.speedup_factor}x加速)")
        print(f"  估计成本: {cost:.2f}元")

        return {
            "video_path": f"output/brand_video_{config.seed}.mp4",
            "frames": config.fps * config.duration_seconds,
            "cost_yuan": cost,
            "model": self.model_size,
        }


# ─── 完整端到端流程 ─────────────────────────────────────────────────────────

class BrandVideoGenerationPipeline:
    """
    端到端品牌视频生成流程
    BrandFusion(提示精化)+ Aquarius(视频合成)
    """

    def __init__(self, model_size: str = "2B"):
        self.brand_fusion = BrandFusionPipeline()
        self.video_gen = AquariusVideoGenerator(model_size)

    def setup_brand(
        self,
        brand_name: str,
        primary_color: str,
        logo_position: str,
        brand_keywords: List[str],
        is_novel: bool = True,
    ) -> None:
        """注册品牌配置"""
        profile = BrandProfile(
            brand_name=brand_name,
            primary_color=primary_color,
            logo_position=logo_position,
            font_style="rounded",
            brand_keywords=brand_keywords,
            is_novel=is_novel,
        )
        self.brand_fusion.register_brand(profile)

    def generate(
        self,
        user_prompt: str,
        target_brand: Optional[str] = None,
        config: Optional[VideoGenerationConfig] = None,
        reference_image: Optional[str] = None,
    ) -> GenerationResult:
        """
        端到端品牌视频生成
        """
        if config is None:
            config = VideoGenerationConfig()

        print("\n" + "=" * 60)
        print("🎬 品牌视频生成流程启动")
        print("=" * 60)

        # 阶段 1:BrandFusion 提示精化
        print("\n[阶段1] BrandFusion 多智能体提示精化...")
        refined_prompt, naturalness, bpr = self.brand_fusion.generate_prompt(
            user_prompt, target_brand
        )

        # 阶段 2:Aquarius 视频生成
        print("\n[阶段2] Aquarius 视频合成...")
        gen_info = self.video_gen.generate(refined_prompt, config, reference_image)

        result = GenerationResult(
            refined_prompt=refined_prompt,
            brand_presence_rate=bpr,
            naturalness_score=naturalness,
            semantic_fidelity=min(1.0, 0.8 + naturalness * 0.04),
            video_path=gen_info["video_path"],
            generation_cost_yuan=gen_info["cost_yuan"],
        )

        print(f"\n✅ 生成完成")
        print(f"  品牌存在率 (BPR): {result.brand_presence_rate:.1%}")
        print(f"  自然度得分: {result.naturalness_score:.2f}/5")
        print(f"  语义保真度: {result.semantic_fidelity:.1%}")
        print(f"  视频路径: {result.video_path}")
        print(f"  生成成本: {result.generation_cost_yuan:.2f}元")

        # Agent 5:经验学习
        brand_name = target_brand or "default"
        if brand_name in self.brand_fusion.brand_db:
            self.brand_fusion.learner.update(
                self.brand_fusion.brand_db[brand_name], result, "general"
            )

        return result


# ─── DreamActor-H1 产品展示视频(Mock) ─────────────────────────────────────

@dataclass
class ProductDemoConfig:
    """产品展示视频配置"""
    product_image: str      # 产品参考图路径
    human_image: str        # 人物参考图路径
    motion_type: str = "two_hand_hold"   # 动作类型
    duration_seconds: int = 15
    text_description: str = ""           # 可选的文字语义描述


class DreamActorH1Pipeline:
    """
    DreamActor-H1 人-产品展示视频生成(Mock)
    DiT 架构 + 掩码交叉注意力 + 3D 体型模板
    """

    # 支持的动作模板
    MOTION_TEMPLATES = {
        "two_hand_hold": "双手持握展示,适合瓶装/盒装产品",
        "single_hand_point": "单手指向+讲解,适合展示产品功能",
        "unboxing": "开箱展示,适合礼品/套装",
        "use_operation": "操作使用中,适合电器/工具类",
    }

    def estimate_identity_preservation(
        self, product_complexity: float, human_motion: str
    ) -> Dict[str, float]:
        """估算身份保留率"""
        base_product = 0.88 + product_complexity * 0.05
        base_human = 0.92
        motion_penalty = {"unboxing": 0.02, "use_operation": 0.03}.get(human_motion, 0.0)
        return {
            "product_identity": min(1.0, base_product - motion_penalty),
            "human_identity": min(1.0, base_human - motion_penalty * 0.5),
            "interaction_naturalness": min(1.0, 0.85 + random.uniform(-0.05, 0.05)),
        }

    def generate(self, config: ProductDemoConfig) -> Dict:
        """
        生成人-产品展示视频
        """
        print(f"\n[DreamActor-H1] 生成产品展示视频")
        print(f"  产品图: {config.product_image}")
        print(f"  人物图: {config.human_image}")
        print(f"  动作模板: {config.motion_type} - "
              f"{self.MOTION_TEMPLATES.get(config.motion_type, '未知')}")

        # 模拟 3D 体型估算
        print("  [3D-SMPL-X] 估算体型参数...")
        print("  [掩码交叉注意力] 分离人物-产品特征区域...")
        print("  [自动模板选择] 匹配产品尺寸与手部比例...")

        # 模拟复杂度(0-1,基于产品类型)
        complexity = {"sterilizer": 0.6, "bottle": 0.4, "toy": 0.5}.get(
            config.product_image.split("_")[0] if "_" in config.product_image else "default",
            0.5
        )
        metrics = self.estimate_identity_preservation(complexity, config.motion_type)

        cost = 0.08 * config.duration_seconds  # 约 0.08元/秒

        result = {
            "video_path": f"output/demo_{config.product_image[:10]}_{config.human_image[:10]}.mp4",
            "duration": config.duration_seconds,
            "metrics": metrics,
            "cost_yuan": cost,
        }

        print(f"  ✅ 生成完成")
        print(f"     产品身份保留率: {metrics['product_identity']:.1%}")
        print(f"     人物身份保留率: {metrics['human_identity']:.1%}")
        print(f"     交互自然度: {metrics['interaction_naturalness']:.1%}")
        print(f"     成本: {cost:.2f}元")
        return result


# ─── 使用示例与测试 ──────────────────────────────────────────────────────────

def test_brand_fusion_pipeline():
    """测试 BrandFusion 多智能体提示精化"""
    print("\n" + "=" * 60)
    print("测试 1: BrandFusion 多智能体提示精化")
    print("=" * 60)

    pipeline = BrandVideoGenerationPipeline(model_size="13.4B")

    # 注册母婴品牌
    pipeline.setup_brand(
        brand_name="BabyBliss",
        primary_color="#8A7ED9",  # 薰衣草紫
        logo_position="top-right",
        brand_keywords=["baby", "infant", "mother", "care", "gentle", "safe"],
        is_novel=True,
    )

    # 生成广告视频
    result = pipeline.generate(
        user_prompt="Happy baby playing in a sunlit park with smiling parents",
        target_brand="BabyBliss",
        config=VideoGenerationConfig(
            width=1920,
            height=1080,
            duration_seconds=15,
            num_inference_steps=20,
            seed=2026,
        ),
    )

    # 断言检查
    assert result.brand_presence_rate >= 0.80, \
        f"品牌存在率不达标: {result.brand_presence_rate:.1%} < 80%"
    assert result.naturalness_score >= 3.5, \
        f"自然度不达标: {result.naturalness_score:.2f} < 3.5"
    assert "BabyBliss" in result.refined_prompt or \
           "#8A7ED9" in result.refined_prompt or \
           "color tone" in result.refined_prompt, \
           "精化提示词中未包含品牌信息"
    assert result.generation_cost_yuan < 10, \
        f"生成成本过高: {result.generation_cost_yuan:.2f}元"

    print(f"\n✅ BrandFusion 测试通过")
    print(f"   精化提示词: {result.refined_prompt[:80]}...")
    return result


def test_dream_actor_pipeline():
    """测试 DreamActor-H1 产品展示视频生成"""
    print("\n" + "=" * 60)
    print("测试 2: DreamActor-H1 产品展示视频")
    print("=" * 60)

    generator = DreamActorH1Pipeline()

    config = ProductDemoConfig(
        product_image="sterilizer_baby_white.jpg",
        human_image="model_mom_asian_30s.jpg",
        motion_type="two_hand_hold",
        duration_seconds=15,
        text_description="baby sterilizer kitchen scene maternal product",
    )

    result = generator.generate(config)

    assert result["metrics"]["product_identity"] >= 0.85, \
        f"产品身份保留率不达标: {result['metrics']['product_identity']:.1%}"
    assert result["metrics"]["interaction_naturalness"] >= 0.80, \
        f"交互自然度不达标"
    assert result["cost_yuan"] < 5.0, \
        f"成本过高: {result['cost_yuan']:.2f}元"

    print(f"\n✅ DreamActor-H1 测试通过")
    return result


def test_roi_comparison():
    """ROI 对比测试:AI生成 vs 传统外拍"""
    print("\n" + "=" * 60)
    print("测试 3: ROI 对比分析")
    print("=" * 60)

    scenarios = [
        {"name": "婴儿消毒锅主图视频(15s)", "count": 3, "traditional_cost": 15000},
        {"name": "品牌广告月度素材(15s)", "count": 20, "traditional_cost": 1000},
        {"name": "电商节日专题视频(30s)", "count": 5, "traditional_cost": 8000},
    ]

    generator_2b = AquariusVideoGenerator("2B")
    config_15s = VideoGenerationConfig(duration_seconds=15)
    config_30s = VideoGenerationConfig(duration_seconds=30)

    print(f"\n{'场景':<25} {'传统成本/条':>10} {'AI成本/条':>10} {'节省比例':>10} {'节省总额':>10}")
    print("-" * 70)

    for s in scenarios:
        config = config_30s if "30s" in s["name"] else config_15s
        ai_result = generator_2b.generate(f"mock prompt for {s['name']}", config)
        ai_cost = ai_result["cost_yuan"]
        saving_rate = (s["traditional_cost"] - ai_cost) / s["traditional_cost"]
        total_saving = (s["traditional_cost"] - ai_cost) * s["count"]
        print(f"{s['name']:<25} {s['traditional_cost']:>9,}元 "
              f"{ai_cost:>9.1f}元 {saving_rate:>9.1%} {total_saving:>9,.0f}元")

    print("-" * 70)
    print("\n✅ ROI 对比分析完成")


if __name__ == "__main__":
    random.seed(42)
    r1 = test_brand_fusion_pipeline()
    r2 = test_dream_actor_pipeline()
    test_roi_comparison()
    print("\n🎉 所有测试通过")
    print("[✓] Brand Video Generation 测试通过")

8. 论文来源

论文链接用于核验方法来源,不自动证明本页商业结果。