Ai Video Gen
2026-03-28
新闻来源:网淘吧
围观:23
电脑广告
手机广告
AI 视频生成技能
使用人工智能,根据文本描述生成完整的视频。
功能
- 图像生成- DALL-E 3, Stable Diffusion, Flux
- 视频生成- LumaAI, Runway, Replicate 模型
- 旁白配音- OpenAI TTS, ElevenLabs
- 视频编辑- FFmpeg 组装、转场、叠加
快速开始
# Generate a complete video
python skills/ai-video-gen/generate_video.py --prompt "A sunset over mountains" --output sunset.mp4
# Just images to video
python skills/ai-video-gen/images_to_video.py --images img1.png img2.png --output result.mp4
# Add voiceover
python skills/ai-video-gen/add_voiceover.py --video input.mp4 --text "Your narration" --output final.mp4
设置
所需 API 密钥
添加到您的环境变量或.env文件中:
# Image Generation (pick one)
OPENAI_API_KEY=sk-... # DALL-E 3
REPLICATE_API_TOKEN=r8_... # Stable Diffusion, Flux
# Video Generation (pick one)
LUMAAI_API_KEY=luma_... # LumaAI Dream Machine
RUNWAY_API_KEY=... # Runway ML
REPLICATE_API_TOKEN=r8_... # Multiple models
# Voice (optional)
OPENAI_API_KEY=sk-... # OpenAI TTS
ELEVENLABS_API_KEY=... # ElevenLabs
# Or use FREE local options (no API needed)
安装依赖项
pip install openai requests pillow replicate python-dotenv
FFmpeg
已通过 winget 安装。
使用示例
1. 文本转视频(完整流程)
python skills/ai-video-gen/generate_video.py \
--prompt "A futuristic city at night with flying cars" \
--duration 5 \
--voiceover "Welcome to the future" \
--output future_city.mp4
2. 多场景
python skills/ai-video-gen/multi_scene.py \
--scenes "Morning sunrise" "Busy city street" "Peaceful night" \
--duration 3 \
--output day_in_life.mp4
3. 图像序列转视频
python skills/ai-video-gen/images_to_video.py \
--images frame1.png frame2.png frame3.png \
--fps 24 \
--output animation.mp4
工作流选项
预算模式 (免费)
- 图像:Stable Diffusion (本地或免费API)
- 视频:开源模型
- 语音:OpenAI TTS (廉价) 或免费TTS
- 编辑:FFmpeg
质量模式 (付费)
- 图像:DALL-E 3 或 Midjourney
- 视频:Runway Gen-3 或 LumaAI
- 语音:ElevenLabs
- 编辑:FFmpeg + 特效
脚本参考
generate_video.py- 主要端到端生成器images_to_video.py- 将图像序列转换为视频add_voiceover.py- 为现有视频添加旁白multi_scene.py- 创建多场景视频edit_video.py- 应用特效、转场、叠加层
API成本估算
- DALL-E 3: 约每张图像0.04-0.08美元
- Replicate: 约每次生成0.01-0.10美元
- LumaAI: 每5秒0-0.50美元(提供免费套餐)
- Runway: 约每秒0.05美元
- OpenAI TTS: 约每1千字符0.015美元
- ElevenLabs: 约每1千字符0.30美元(质量更佳)
示例
查看examples/文件夹中的示例输出和提示。
文章底部电脑广告
手机广告位-内容正文底部


微信扫一扫,打赏作者吧~