定制数字人涉及人格权与平台验证。这篇用一份 JSON 表单做门禁:本人同意、身份验证、不冒充、内部审批;公众人物还需额外法务标记。
先看清成品
- 合规样例 APPROVED;缺同意的公众人物样例 BLOCKED。
- 3 项 pytest 通过。
合规提醒:定制以真人为原型的数字人必须取得本人同意,并按平台完成身份验证;不得用数字人冒充他人、从事欺诈或未披露的政治宣传。Video API 通常需 Pro 及以上(以官网为准);
test: true有水印且有每日测试限额。本文不编造价格与配额数字(除文档已写明的测试限额提示外,以你控制台为准)。
运行说明:无 Synthesia 正式密钥。A/C 本地合规检查;B 用 mock 创建+轮询到 complete。对官方主机无效 Authorization 实测 HTTP 403。2026-10-23(Asia/Shanghai)pytest 通过。
做完之后你会得到什么?
| 成果 | 说明 |
|---|---|
avatar_consent.py |
门禁 |
| 样例 JSON | ok/bad |
test_100c.py |
测试 |
需要准备哪些环境?
| 项目 | 说明 |
|---|---|
| Python | 3.10+ |
关键事实
| 事实 | 来源 |
|---|---|
| 平台要求定制数字人取得同意并做身份验证(产品说明) | Synthesia 产品重要说明 / 教程引述 |
| 本清单是组织流程工具,不能代替平台验证或法律意见 | 重要 |
| API 生成视频仍受内容审核 | 官方 status=rejected |
文件结构
100-synthesia-C-src/
├── avatar_consent.py
├── sample_ok.json
├── sample_bad.json
└── test_100c.py
第 1 步:门禁脚本
#!/usr/bin/env python3
"""Checklist for custom avatar / personal likeness usage (compliance helper)."""
from __future__ import annotations
import argparse
import json
from pathlib import Path
REQUIRED_TRUE = [
("subject_consent", "已取得出镜本人书面/平台流程同意"),
("identity_verified", "已按平台要求完成身份验证(如适用)"),
("no_impersonation", "不用于冒充他人或未披露的政治/欺诈内容"),
("internal_policy_ok", "已通过公司法务/品牌对数字人用途的审核(如适用)"),
]
REQUIRED_FIELDS = ["subject_name", "purpose", "approver"]
def evaluate(form: dict) -> tuple[bool, list[str]]:
errs = []
for k in REQUIRED_FIELDS:
if not str(form.get(k) or "").strip():
errs.append(f"缺少: {k}")
for key, label in REQUIRED_TRUE:
if form.get(key) is not True:
errs.append(f"未确认: {label} ({key}=true)")
if form.get("public_figure") is True and form.get("extra_legal_review") is not True:
errs.append("公众人物形象需要 extra_legal_review=true")
return (not errs), errs
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument("form_json")
ap.add_argument("-o", "--out", default="")
args = ap.parse_args(argv)
form = json.loads(Path(args.form_json).read_text(encoding="utf-8"))
ok, errs = evaluate(form)
result = {"approved": ok, "errors": errs, "form": {k: form.get(k) for k in list(form)}}
text = json.dumps(result, ensure_ascii=False, indent=2)
if args.out:
Path(args.out).write_text(text + "\n", encoding="utf-8")
print("APPROVED" if ok else "BLOCKED")
for e in errs:
print("-", e)
return 0 if ok else 1
if __name__ == "__main__":
raise SystemExit(main())
第 2 步:测试
from pathlib import Path
import json
import subprocess
import sys
from avatar_consent import evaluate
HERE = Path(__file__).resolve().parent
def test_ok():
ok, errs = evaluate(json.loads((HERE / "sample_ok.json").read_text()))
assert ok and not errs
def test_bad():
ok, errs = evaluate(json.loads((HERE / "sample_bad.json").read_text()))
assert not ok and errs
def test_cli():
r = subprocess.run(
[sys.executable, str(HERE / "avatar_consent.py"), str(HERE / "sample_ok.json")],
capture_output=True,
text=True,
)
assert r.returncode == 0 and "APPROVED" in r.stdout
第 3 步:运行
APPROVED
BLOCKED
- 缺少: approver
- 未确认: 已取得出镜本人书面/平台流程同意 (subject_consent=true)
- 未确认: 已按平台要求完成身份验证(如适用) (identity_verified=true)
- 未确认: 已通过公司法务/品牌对数字人用途的审核(如适用) (internal_policy_ok=true)
- 公众人物形象需要 extra_legal_review=true
... [100%]
3 passed in 0.03s
怎么检查结果?
- CI 可把 APPROVED 当作创建定制形象流水线的前置条件。
- 表单存档保留审批人。
调试示例
「营销部门口头同意」。 脚本要求 subject_consent=true 等显式布尔。把扫描件/平台验证 ID 放进你们自己的工单系统,本 JSON 只作门禁信号。
常见问题
| 现象 | 原因 | 处理 |
|---|---|---|
| 外部演员 | 同样要同意 | purpose 写清授权范围 |
| 仅内部培训 | 仍建议走同意 | 降低误用风险 |
| 想跳过 | 不要 | 合规红线 |
模板规则
- 无同意不创建定制形象。
- 不冒充公众人物。
- 保留审批记录。
项目资源
| 用途 | 地址 |
|---|---|
| Synthesia 官网 | https://www.synthesia.io/ |
| API Introduction(官方) | https://docs.synthesia.io/reference/introduction |
| Quickstart(官方) | https://docs.synthesia.io/reference/synthesia-api-quickstart |
同意与验证,是数字人项目的第一行代码。