Kameo AI - Talking Head Video Generation
Transform static images into expressive talking-head videos with realistic motion and lip-sync.
Quick Start
CODEBLOCK0
Example:
CODEBLOCK1
What It Does
- - Takes a static image (portrait/avatar)
- Adds realistic facial motion, expressions, and lip-sync based on your prompt
- Generates 5-second video in 9:16, 16:9, or 1:1 aspect ratio
- Returns CDN URL instantly (processing ~10-30 seconds)
Authentication
Set your Kameo API key:
CODEBLOCK2
Or store in ~/.config/kameo/credentials.json:
CODEBLOCK3
Getting an API Key:
- 1. Register at kameo.chat (requires email verification)
- Login to get JWT token
- Create API key via
/api/public/keys endpoint - Or use the registration helper: INLINECODE2
Prompt Engineering
Basic Prompts (Simple)
Just the dialogue:
CODEBLOCK4
Works but results are generic.
Enhanced Prompts (Recommended)
Format:
CODEBLOCK5
Example:
CODEBLOCK6
Why Enhanced Prompts Matter:
- - Better facial expressions matching the scene context
- More natural motion and gestures
- Improved lip-sync quality
- Contextual emotional delivery
Prompt Enhancement Workflow
For best results, use vision AI to analyze the image first:
- 1. Feed the image to a vision model (Gemini, GPT-4V, Claude)
- Ask it to describe the scene in cinematic detail
- Insert your dialogue into the description
- Use the enhanced prompt for Kameo
See: scripts/enhance_prompt.sh for automated enhancement.
API Details
Base URL: INLINECODE4
Generate Video
CODEBLOCK7
Parameters:
- -
image_base64 (required): Base64-encoded JPEG/PNG - INLINECODE6 (required): Dialogue and/or scene description
- INLINECODE7 (optional): 5 (default) or 10
- INLINECODE8 (optional): "9:16" (default), "16:9", or "1:1"
Response:
CODEBLOCK8
Check Credits
CODEBLOCK9
Response:
CODEBLOCK10
Pricing
CODEBLOCK11
Cost: 3 credits per video
Performance
- - Processing time: 8-35 seconds (depends on aspect ratio and queue)
- 9:16 (portrait): ~30-35s
- 16:9 (landscape): ~15-20s
- 1:1 (square): ~10-15s
Best Practices
- 1. Optimize image size - Resize large images before encoding (saves bandwidth, faster upload)
CODEBLOCK12
- 2. Use descriptive prompts - Enhanced prompts = better results
- 3. Choose aspect ratio wisely
- 9:16: Mobile/social media (TikTok, Instagram Stories)
- 16:9: Desktop/YouTube
- 1:1: Profile pictures, square posts
- 4. Monitor credits - Check balance with INLINECODE9
Limitations
- - CDN access: Video URLs may have time-limited access or require authentication
- Download: Videos may return 403 when downloaded via curl (use browser or authenticated session)
- Rate limits: 10 generations per minute
Troubleshooting
"401 Unauthorized"
- - Check your API key is set correctly
- Verify key hasn't been revoked
"402 Insufficient credits"
- - Check credit balance: INLINECODE10
- Need to add credits at kameo.chat
"Timeout errors"
- - 9:16 videos take longer (~30s)
- Increase timeout in scripts
- Retry if server is busy
"403 when downloading video"
- - CDN URLs may be time-limited
- Try accessing in browser immediately after generation
- Or save the base64 response if available
Use Cases
- - AI character videos - Bring bot avatars to life
- Social media content - Dynamic profile videos
- Demos and presentations - Talking product demos
- Educational content - Video tutorials with AI presenters
- Multilingual content - Same avatar speaking different languages
Kameo AI - 说话头像视频生成
将静态图像转化为具有逼真动作和唇音同步的说话头像视频。
快速开始
bash
scripts/generate_video.sh <图片路径> <提示词> [输出文件]
示例:
bash
scripts/generate_video.sh avatar.jpg 你好,我是一个AI助手 output.mp4
功能说明
- - 接收静态图像(肖像/头像)
- 根据提示词添加逼真的面部动作、表情和唇音同步
- 生成9:16、16:9或1:1比例的5秒视频
- 即时返回CDN URL(处理时间约10-30秒)
身份验证
设置您的Kameo API密钥:
bash
export KAMEOAPIKEY=kam_I3rdx43IymFNbfBw1c0ZbSc7o3aUfQgz8cljZA6T7fs
或存储在~/.config/kameo/credentials.json中:
json
{
apikey: kamI3rdx43IymFNbfBw1c0ZbSc7o3aUfQgz8cljZA6T7fs
}
获取API密钥:
- 1. 在kameo.chat注册(需要邮箱验证)
- 登录获取JWT令牌
- 通过/api/public/keys端点创建API密钥
- 或使用注册助手:scripts/register.sh
提示词工程
基础提示词(简单)
仅对话:
你好,我今天来帮助你
こんにちは、私はガッキーです。愛してます。
有效但结果较为通用。
增强提示词(推荐)
格式:
[详细的场景/环境],[人物的完整外貌和表情],以[语气]说话,[对话内容]。[摄像和灯光细节]。
示例:
在明亮的户外冬季环境中,柔和的阴天光线,一位年轻女性,长着深色长发,戴着白色针织冬季帽(带耳罩)和彩色图案毛衣,居中站在画面中。她直视镜头,露出温暖真诚的微笑,眼睛因喜悦而眯起,用欢快亲切的语气说:こんにちは、私はガッキーです。愛してます。场景以中近景拍摄,平视角度。光线来自上方,自然漫射,营造柔和均匀的照明效果。
为什么增强提示词重要:
- - 更好的面部表情匹配场景语境
- 更自然的动作和手势
- 改善唇音同步质量
- 符合语境的情绪表达
提示词增强工作流程
为获得最佳效果,先使用视觉AI分析图像:
- 1. 将图像输入视觉模型(Gemini、GPT-4V、Claude)
- 要求其以电影级细节描述场景
- 将对话插入描述中
- 使用增强后的提示词用于Kameo
参见: scripts/enhance_prompt.sh 自动增强功能。
API详情
基础URL: https://api.kameo.chat/api/public
生成视频
bash
curl -X POST https://api.kameo.chat/api/public/generate \
-H X-API-Key: kam_I3rdx43IymFNbfBw1c0ZbSc7o3aUfQgz8cljZA6T7fs \
-H Content-Type: application/json \
-d {
image_base64: ,
prompt: 您的详细提示词,
seconds: 5,
aspect_ratio: 9:16
}
参数:
- - imagebase64(必填):Base64编码的JPEG/PNG图像
- prompt(必填):对话和/或场景描述
- seconds(可选):5(默认)或10
- aspectratio(可选):9:16(默认)、16:9或1:1
响应:
json
{
job_id: uuid,
status: completed,
video_url: https://cdn.kameo.chat/videos/{uuid}.mp4,
duration_seconds: 5,
processingtimems: 15000
}
检查积分
bash
curl -H X-API-Key: kam_... \
https://api.kameo.chat/api/public/credits
响应:
json
{
permanent_credits: 294,
subscription_credits: 0,
total_available: 294
}
定价
bash
curl https://api.kameo.chat/api/public/pricing
费用: 每个视频3积分
性能
- - 处理时间: 8-35秒(取决于宽高比和队列)
- 9:16(竖屏): 约30-35秒
- 16:9(横屏): 约15-20秒
- 1:1(正方形): 约10-15秒
最佳实践
- 1. 优化图像大小 - 编码前调整大图像尺寸(节省带宽,加快上传)
bash
ffmpeg -i large.jpg -vf scale=720:-1 optimized.jpg
- 2. 使用描述性提示词 - 增强提示词 = 更好效果
- 3. 明智选择宽高比
- 9:16:移动端/社交媒体(TikTok、Instagram故事)
- 16:9:桌面端/YouTube
- 1:1:头像、正方形帖子
- 4. 监控积分 - 使用scripts/check_credits.sh检查余额
限制
- - CDN访问: 视频URL可能有时间限制或需要身份验证
- 下载: 通过curl下载视频可能返回403(使用浏览器或认证会话)
- 速率限制: 每分钟10次生成
故障排除
401 未授权
402 积分不足
- - 检查积分余额:scripts/check_credits.sh
- 需要在kameo.chat添加积分
超时错误
- - 9:16视频耗时较长(约30秒)
- 增加脚本中的超时时间
- 服务器繁忙时重试
下载视频时出现403
- - CDN URL可能有时间限制
- 生成后立即在浏览器中访问
- 或保存可用的base64响应
使用场景
- - AI角色视频 - 让机器人头像活起来
- 社交媒体内容 - 动态个人资料视频
- 演示和展示 - 产品演示讲解
- 教育内容 - 带AI主持人的视频教程
- 多语言内容 - 同一头像说不同语言