AI Director - AI Short Drama Generation
Complete AI short drama solution — from concept to finished film, with integrated X2C platform account management and billing.
Multi-User Support
Each user has independent X2C credentials stored in credentials/{USER_ID}.json.
Set USER_ID or TELEGRAM_USER_ID env var when calling scripts:
CODEBLOCK0
OpenClaw passes the user ID automatically from chat context.
Modules
1. Ad Account Manager
X2C platform account binding and verification.
CODEBLOCK1
2. Ad Character Manager
Manage custom characters for video production. Max 5 per user.
CODEBLOCK2
| Param | Required | Options |
|---|
| name | Yes | Display name |
| gender |
Yes | male, female, other |
| image_url | Yes | Public URL (max 10MB) |
3. Ad Writer (Prompt Engineering)
Agent reads references/AD-WRITER-GUIDE.md and generates a complete script based on user's creative concept. Outputs: title, synopsis, character bios, outline, episode breakdowns, full screenplay.
4. Ad Producer (Video Production)
CODEBLOCK3
Generation Options
| Param | Description | Default |
|---|
| --mode | shortvideo / shortdrama | short_video |
| --duration |
60 / 120 / 180 / 300 | 120 |
| --ratio | 9:16 / 16:9 | 9:16 |
| --style | Style name | - |
| --episodes | Fixed: short
video=1, shortdrama=10 | - |
| --language | zh / en | zh |
| --character-ids | Character UUIDs (comma-separated) | - |
| --wait | Wait for completion | false |
Cost
| Item | Credits | USD |
|---|
| Script (shortvideo) | 6 | $0.06 |
| Script (shortdrama) |
60 | $0.60 |
| Video 60s | 299 | $2.99 |
| Video 120s | 599 | $5.99 |
| Video 180s | 799 | $7.99 |
| Video 300s | 999 | $9.99 |
Quality Evaluator
Uses Gemini to score video quality against defined criteria.
CODEBLOCK4
Requires GEMINI_API_KEY env var or geminiApiKey in config.
Auto-Iterate
Automatically evaluate + improve prompt + regenerate until quality threshold met.
CODEBLOCK5
Critical Rules
- - Confirm all parameters with user before generating video
- Only use values from config options (styles, categories) — never custom values
- Episodes are fixed: shortvideo=1, shortdrama=10
- Each episode can only be submitted once for production
- Never auto-retry failed generations (costs credits)
- Use async task handling — do not block with --wait in production
- Output video URLs completely, never truncate
- Remove
&response-content-disposition=attachment from video URLs for browser playback
API Reference
See references/X2C-OPEN-API.md for complete API documentation.
Credentials
Store in credentials/{USER_ID}.json:
CODEBLOCK6
Or set X2C_API_KEY env var, or configure via skills."ai-director".env.X2C_API_KEY in ~/.openclaw/openclaw.json.
AI Director - AI短剧生成
完整的AI短剧解决方案——从概念到成片,集成X2C平台账户管理与计费。
多用户支持
每个用户在credentials/{USER_ID}.json中拥有独立的X2C凭证。
调用脚本时设置USERID或TELEGRAMUSER_ID环境变量:
bash
USER_ID=12345 node {baseDir}/scripts/ad-account-manager.js check-binding
OpenClaw会自动从聊天上下文中传递用户ID。
模块
1. 广告账户管理器
X2C平台账户绑定与验证。
bash
发送验证码
node {baseDir}/scripts/ad-account-manager.js send-code user@example.com
验证并获取API密钥
node {baseDir}/scripts/ad-account-manager.js verify user@example.com 123456
检查绑定状态
node {baseDir}/scripts/ad-account-manager.js check-binding
查看配置选项
node {baseDir}/scripts/ad-account-manager.js config
解绑账户
node {baseDir}/scripts/ad-account-manager.js unbind
使用现有密钥直接绑定
node {baseDir}/scripts/ad-account-manager.js bind --key x2c
skxxx
2. 广告角色管理器
管理视频制作的自定义角色。每个用户最多5个。
bash
node {baseDir}/scripts/ad-character-manager.js list
node {baseDir}/scripts/ad-character-manager.js create <名称> <性别> <图片链接>
node {baseDir}/scripts/ad-character-manager.js delete <角色ID>
是 | male, female, other |
| 图片链接 | 是 | 公开URL(最大10MB) |
3. 广告编剧(提示词工程)
智能体读取references/AD-WRITER-GUIDE.md,根据用户的创意概念生成完整剧本。输出:标题、剧情简介、角色设定、大纲、分集梗概、完整剧本。
4. 广告制片人(视频制作)
bash
查看定价和配置
node {baseDir}/scripts/ad-producer.js config
生成剧本
node {baseDir}/scripts/ad-producer.js generate-script 你的创意概念 --wait
检查剧本状态
node {baseDir}/scripts/ad-producer.js script-status <项目ID>
制作视频
node {baseDir}/scripts/ad-producer.js produce-video <项目ID> 1 --wait
检查视频进度
node {baseDir}/scripts/ad-producer.js video-status <项目ID> 1
完整工作流(推荐)
node {baseDir}/scripts/ad-producer.js full-workflow 你的创意概念 --duration 120
生成选项
| 参数 | 描述 | 默认值 |
|---|
| --mode | shortvideo / shortdrama | short_video |
| --duration |
60 / 120 / 180 / 300 | 120 |
| --ratio | 9:16 / 16:9 | 9:16 |
| --style | 风格名称 | - |
| --episodes | 固定值:short
video=1, shortdrama=10 | - |
| --language | zh / en | zh |
| --character-ids | 角色UUID(逗号分隔) | - |
| --wait | 等待完成 | false |
费用
| 项目 | 积分 | 美元 |
|---|
| 剧本(短视频) | 6 | $0.06 |
| 剧本(短剧) |
60 | $0.60 |
| 视频60秒 | 299 | $2.99 |
| 视频120秒 | 599 | $5.99 |
| 视频180秒 | 799 | $7.99 |
| 视频300秒 | 999 | $9.99 |
质量评估器
使用Gemini根据定义的标准对视频质量进行评分。
bash
node {baseDir}/scripts/quality-evaluator.js <视频链接> --prompt 原始提示词
node {baseDir}/scripts/quality-evaluator.js <视频链接> --json
需要设置GEMINIAPIKEY环境变量或在配置中设置geminiApiKey。
自动迭代
自动评估+优化提示词+重新生成,直到达到质量标准。
bash
node {baseDir}/scripts/auto-iterate.js 你的创意概念 \
--duration 60 --style 风格 --threshold 80 --max-iterations 5
关键规则
- - 生成视频前需与用户确认所有参数
- 仅使用配置选项中的值(风格、分类)——不得使用自定义值
- 集数固定:短视频=1,短剧=10
- 每集只能提交一次制作
- 切勿自动重试失败的生成(消耗积分)
- 使用异步任务处理——生产环境中不要使用--wait阻塞
- 完整输出视频链接,不得截断
- 移除视频链接中的&response-content-disposition=attachment以便浏览器播放
API参考
完整API文档请参见references/X2C-OPEN-API.md。
凭证
存储在credentials/{USER_ID}.json中:
json
{
x2cApiKey: x2cskxxx,
x2cEmail: your@email.com,
x2cUserId: user-uuid
}
或设置X2CAPIKEY环境变量,或通过~/.openclaw/openclaw.json中的skills.ai-director.env.X2CAPIKEY进行配置。