Avatar
虚拟形象助手:集成 Simli 视频渲染和 ElevenLabs TTS 的交互式 AI 虚拟形象
Interactive AI avatar with Simli video rendering and ElevenLabs TTS
clawhub install avatar蚕景虚拟形象:AI 驱动的虚拟形象和数字人物生成工具
# 安装 Skill npx skills add chanjing-ai/chan-skills@chanjing-avatar # 安装后 Claude Code 会自动识别并使用
# 同样的安装命令,兼容所有支持 SKILL.md 的 AI 编程工具 npx skills add chanjing-ai/chan-skills@chanjing-avatar
需要GPU加速支持,需要申请蝉景AI API密钥,推荐NVIDIA GPU
access_token, which is required for all subsequent API callsfile_idfile_id values~/.chanjing/credentials.json 读取 app_id 和 secret_key,若无有效 Token 则调用:POST /open/v1/access_token
Content-Type: application/json
{
"app_id": "<从 credentials.json 读取>",
"secret_key": "<从 credentials.json 读取>"
}
{
"trace_id": "8ff3fcd57b33566048ef28568c6cee96",
"code": 0,
"msg": "success",
"data": {
"access_token": "1208CuZcV1Vlzj8MxqbO0kd1Wcl4yxwoHl6pYIzvAGoP3DpwmCCa73zmgR5NCrNu",
"expire_in": 1721289220
}
}
file_id values.[File Management](https://doc.chanjing.cc/api/file/file-management.html).GET /open/v1/common/create_upload_url
access_token: {{access_token}}
lip_sync_video for driving video, lip_sync_audio for audio (if audio-driven). |
| name | 1.mp4 | Original file name including extension |sign_url, mime_type, and file_id. Use the sign_url with HTTP PUT to upload the file, setting Content-Type to the returned mime_type. After the PUT completes, poll the file detail API until the file is ready (do not assume a fixed wait). Keep the returned file_id for video_file_id / audio_file_id below.GET /open/v1/common/file_detail?id={{file_id}} with access_token until the response data.status indicates success (e.g. status === 2). Only then use the file_id for the create task API.POST /open/v1/video_lip_sync/create
access_token: {{access_token}}
Content-Type: application/json
{
"video_file_id": "e284db4d95de4220afe78132158156b5",
"screen_width": 1080,
"screen_height": 1920,
"callback": "https://example.com/openapi/callback",
"model": 0,
"audio_type": "tts",
"tts_config": {
"text": "君不见黄河之水天上来,奔流到海不复回。",
"audio_man_id": "C-f2429d07554749839849497589199916",
"speed": 1,
"pitch": 1
}
}
{
"video_file_id": "e284db4d95de4220afe78132158156b5",
"screen_width": 1080,
"screen_height": 1920,
"model": 0,
"audio_type": "audio",
"audio_file_id": "audio_file_id_from_file_management"
}
data.file_id). Supports mp4, mov, webm |
| screen_width | int | No | Screen width, default 1080 |
| screen_height | int | No | Screen height, default 1920 |
| backway | int | No | Playback order when reaching end: 1-normal, 2-reverse. Default 1 |
| drive_mode | string | No | Drive mode: ""-normal, "random"-random frame. Default "" |
| callback | string | No | Callback URL for async notification |
| model | int | No | Model version: 0-basic, 1-high quality. Default 0 |
| audio_type | string | No | Audio type: "tts"-text driven, "audio"-audio driven. Default "tts" |
| tts_config | object | Yes (for tts) | TTS configuration when audio_type="tts" |
| tts_config.text | string | Yes (for tts) | Text to synthesize |
| tts_config.audio_man_id | string | Yes (for tts) | Voice ID |
| tts_config.speed | number | No | Speech speed: 0.5-2, default 1 |
| tts_config.pitch | number | No | Pitch, default 1 |
| audio_file_id | string | Yes (for audio) | Audio file ID from File Management (data.file_id) when audio_type="audio". Supports mp3, m4a, wav |
| volume | int | No | Volume: 1-100, default 100 |{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": "9499ed79995c4bdb95f0d66ca84419fd"
}
POST /open/v1/video_lip_sync/list
access_token: {{access_token}}
Content-Type: application/json
{
"page": 1,
"page_size": 10
}
{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"list": [
{
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
],
"page_info": {
"page": 1,
"size": 10,
"total_count": 1,
"total_page": 1
}
}
}
GET /open/v1/video_lip_sync/detail
access_token: {{access_token}}
GET /open/v1/video_lip_sync/detail?id=9499ed79995c4bdb95f0d66ca84419fd{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
}
{
"trace_id": "8d10659438827bd4d59eaa2696f9d391",
"code": 0,
"msg": "success",
"data": {
"id": "9499ed79995c4bdb95f0d66ca84419fd",
"status": 20,
"progress": 100,
"msg": "success",
"video_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.mp4",
"preview_url": "https://res.chanjing.cc/xxx/lip-sync/9499ed79995c4bdb95f0d66ca84419fd.jpg",
"duration": 300,
"create_time": 1738636800
}
}
skills/chanjing-avatar/scripts/),与 chanjing-credentials-guard 使用同一配置文件(~/.chanjing/credentials.json)获取 Token。get_upload_url | 获取上传链接,输出 sign_url、mime_type、file_id |
| upload_file | 上传本地文件,轮询 file_detail 直到就绪后输出 file_id |
| create_task | 创建对口型任务(TTS 或音频驱动),输出视频任务 id |
| poll_task | 轮询任务直到完成,输出 video_url |# 1. 上传驱动视频,得到 video_file_id
VIDEO_FILE_ID=$(python skills/chanjing-avatar/scripts/upload_file --service lip_sync_video --file ./my_video.mp4)
# 2. 创建 TTS 对口型任务(需先通过 list_common_audio 获取 audio_man_id)
TASK_ID=$(python skills/chanjing-avatar/scripts/create_task \
--video-file-id "$VIDEO_FILE_ID" \
--text "君不见黄河之水天上来" \
--audio-man-id "C-f2429d07554749839849497589199916")
# 3. 轮询直到完成,得到视频下载链接
python skills/chanjing-avatar/scripts/poll_task --id "$TASK_ID"
audio_file_id,再 create_task --video-file-id <id> --audio-file-id <audio_file_id>。npx skills run chanjing-avatar --prompt "商务男性讲师" --duration 30 --language zh-CN --output avatar_video.mp4虚拟形象助手:集成 Simli 视频渲染和 ElevenLabs TTS 的交互式 AI 虚拟形象
Interactive AI avatar with Simli video rendering and ElevenLabs TTS
clawhub install avatarAI Avatar Generation:从照片或文字描述生成专业的 AI 虚拟人物,包括真人头像、卡通形象、3D 角色等。
Generate AI avatars from photos or text descriptions using each::sense. Create professional headshots, cartoon avatars, 3D characters, fantasy personas, gami...
clawhub install ai-avatar-generation