或从素材库添加
生产环境须由服务端签发临时密钥(本站登录后「生成」已对接),浏览器不要硬编码密钥。
// 概念流程(示意)
const tempKey = await fetchTemporaryKeyFromYourBackend(); // 返回服务端签发的临时密钥
const client = createRealtimeClient({ apiKey: tempKey });
const localStream = await openCameraOrVideoFile();
await client.startGeneration({
localStream,
prompt: '将视频中的人物替换为参考图中的角色',
referencePath: '/path/to/ref.jpg'
});
对接细节以管理后台配置为准;密钥与接口路径请勿写入公开前端代码。