Comfy Story Video
Generate children's story videos with AI-generated illustrations and voice narration.
Quick Start
CODEBLOCK0
Requirements
- 1. ComfyUI running on INLINECODE0
- Python dependencies: INLINECODE1
- FFmpeg for audio conversion
Usage
Generate a Story Video
CODEBLOCK1
Output Files
Generated in output/ directory:
- -
story_{theme}_{timestamp}.json - Story text - INLINECODE4 ~
scene_NN.png - AI illustrations - INLINECODE6 ~
scene_NN.mp3 - Voice narration - INLINECODE8 - Final video
Customization
Change ComfyUI Model
Edit assets/basic_workflow.json, replace ckpt_name in CheckpointLoaderSimple node.
Modify Characters/Settings
Edit scripts/generate_story_video.py:
- -
characters - List of animal characters - INLINECODE14 - Story backgrounds
- INLINECODE15 - Story themes
Change Voice
Modify the -v parameter in generate_tts() function:
CODEBLOCK2
Workflow
- 1. Generate story text (configurable characters, setting, theme)
- Convert each scene to ComfyUI prompt
- Send to ComfyUI for image generation
- Generate TTS narration for each scene
- Combine into video (WIP)
Troubleshooting
- - ComfyUI not responding: Check if ComfyUI is running at INLINECODE18
- Model not found: Update
ckpt_name in workflow to match available models - Image generation fails: Check ComfyUI console for error messages
Comfy Story Video
使用AI生成的插图和语音旁白制作儿童故事视频。
快速开始
bash
cd /Users/yiyi/.openclaw/workspace/comfy-story-video
python3 scripts/generatestoryvideo.py --theme 友谊 --scenes 5
环境要求
- 1. ComfyUI 正在运行,地址为 http://127.0.0.1:8188
- Python 依赖:pip install websocket-client requests
- FFmpeg 用于音频转换
使用方法
生成故事视频
bash
默认主题(友谊)
python3 scripts/generate
storyvideo.py
自定义主题
python3 scripts/generate
storyvideo.py --theme 勇气
自定义场景数量
python3 scripts/generate
storyvideo.py --theme 环保 --scenes 6
输出文件
生成在 output/ 目录中:
- - story{theme}{timestamp}.json - 故事文本
- scene01.png ~ sceneNN.png - AI插图
- scene01.mp3 ~ sceneNN.mp3 - 语音旁白
- story{theme}{timestamp}.mp4 - 最终视频
自定义设置
更换ComfyUI模型
编辑 assets/basicworkflow.json,替换 CheckpointLoaderSimple 节点中的 ckptname。
修改角色/场景设置
编辑 scripts/generatestoryvideo.py:
- - characters - 动物角色列表
- settings - 故事背景
- themes - 故事主题
更换语音
修改 generate_tts() 函数中的 -v 参数:
bash
say -v ? | grep zh # 列出可用的中文语音
工作流程
- 1. 生成故事文本(可配置角色、场景、主题)
- 将每个场景转换为ComfyUI提示词
- 发送至ComfyUI生成图像
- 为每个场景生成TTS旁白
- 合成视频(开发中)
故障排除
- - ComfyUI无响应:检查ComfyUI是否在 http://127.0.0.1:8188 运行
- 模型未找到:更新工作流中的 ckpt_name 以匹配可用模型
- 图像生成失败:查看ComfyUI控制台的错误信息