# MoneyPrinterTurbo **Repository Path**: lijinjun-jacking/MoneyPrinterTurbo-main ## Basic Information - **Project Name**: MoneyPrinterTurbo - **Description**: 只需提供一个视频主题或关键词,MoneyPrinterTurbo 就能全自动完成:文案撰写 → 语音合成 → 素材匹配 → 字幕渲染 → 背景配乐 → 视频合成,一条龙产出可直接发布的短视频。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 2 - **Created**: 2026-06-11 - **Last Updated**: 2026-06-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

MoneyPrinterTurbo 💸

Stargazers Issues Forks License


简体中文 | English | العربية


只需提供一个视频 主题关键词 ,就可以全自动生成视频文案、视频素材、视频字幕、视频背景音乐,然后合成一个高清的短视频。

Web界面

![](docs/webui.jpg)

API界面

![](docs/api.jpg)
--- ## ✨ 功能特性 - [x] 完整的 **MVC 架构**,支持 `API` 和 `Web 界面` - [x] 视频文案 **AI 自动生成** 或 **自定义文案** - [x] 多种 **高清视频** 尺寸:竖屏 9:16 (`1080x1920`)、横屏 16:9 (`1920x1080`) - [x] **批量视频生成**,一次生成多个,选最满意的 - [x] **视频片段时长** 设置,调节素材切换频率 - [x] 支持中文、英文视频文案 - [x] **本地离线 TTS**(Piper TTS)—— 免费、离线、无需 API Key - [x] 多种语音合成(Edge TTS / Azure TTS / SiliconFlow / MiMo / Gemini) - [x] 字幕生成:字体、位置、颜色、大小、描边全面可调 - [x] 背景音乐:随机或指定音乐,可调音量 - [x] 高清无版权素材:**Pexels**、**Pixabay**、**Coverr** - [x] 支持 **OpenAI**、**AIHubMix**、**Moonshot**、**Azure**、**通义千问**、**Google Gemini**、**Ollama**、**MiniMax**、**文心一言**、**ModelScope** 等多种 LLM 接入 --- ## 🎬 视频演示 ### 竖屏 9:16
▶️ 《如何增加生活的乐趣》 ▶️ 《金钱的作用》
更真实的合成声音
▶️ 《生命的意义是什么》
### 横屏 16:9
▶️《生命的意义是什么》 ▶️《为什么要运动》
--- ## 📦 配置要求 | 项目 | 最低配置 | 推荐配置 | 理想配置 | |------|----------|----------|----------| | CPU | 4 核 | 6-8 核 | 8 核及以上 | | RAM | 4 GB | 8 GB | 16 GB 及以上 | | GPU | 非必须 | 4 GB 显存+ | 8 GB 显存+ | - 使用云端 LLM / TTS / 在线素材时,CPU 和内存更重要 - 使用本地 Piper TTS 或 Whisper 转录时,GPU 可提升速度 --- ## 🚀 快速开始 — Docker 部署(推荐) ### 安装 Docker - **Windows**: https://www.docker.com/products/docker-desktop/ - 参考: https://learn.microsoft.com/zh-cn/windows/wsl/install - **macOS / Linux**: Docker Desktop 或 Docker Engine ### 克隆并启动 ```bash git clone https://github.com/harry0703/MoneyPrinterTurbo.git cd MoneyPrinterTurbo # 复制配置文件 cp config.example.toml config.toml # 启动(Docker Compose) docker compose up -d ``` > 💡 **中国用户加速**:如果 Docker 镜像拉取慢,可将 `Dockerfile` 第一行改为: > ```dockerfile > FROM docker.m.daocloud.io/library/python:3.11-slim-bullseye > ``` > 或在 Docker Desktop 设置中配置 `registry-mirrors`(推荐 DaoCloud、阿里云等镜像加速器)。 ### 访问服务 | 服务 | 地址 | |------|------| | Web 界面 | http://127.0.0.1:8501 | | API 文档 | http://127.0.0.1:8080/docs | ### 生成第一个视频 1. 打开 http://127.0.0.1:8501 2. 输入视频主题(如 "为什么要多喝水") 3. 点击 **生成视频**,等待完成 --- ## 🗣 本地语音合成(Piper TTS,免费离线) 本分支集成了 **Piper TTS** — 完全离线的本地语音合成引擎,**无需 API Key、无需网络连接**,CPU 即可实时运行。 ### Piper 特点 - ✅ **完全离线**:不依赖任何云端 API,不受网络限制 - ✅ **CPU 运行**:普通 CPU 实时生成(实时率 < 0.1) - ✅ **中文支持**:内置华彦(huayan)中文普通话女声 - ✅ **MIT 许可**:免费商用 ### 下载模型 ```bash # 方式一:使用下载脚本(推荐) bash scripts/download_piper.sh # Linux / macOS / WSL scripts/download_piper.bat # Windows(双击) # 方式二:使用 ModelScope(中国用户首选) pip install modelscope modelscope download --model zhj314/vits-piper-zh_CN-huayan-medium --local_dir ./models/piper ``` ### 文件结构 ``` models/piper/ ├── bin/ # Piper 引擎(Linux ELF,用于 Docker) │ ├── piper # 可执行文件 │ ├── libpiper_phonemize.so.1 # 依赖库 │ ├── libespeak-ng.so.1 │ └── libonnxruntime.so ├── zh_CN-huayan-medium.onnx # 中文模型 (~60MB) └── zh_CN-huayan-medium.onnx.json # 模型配置 ``` ### 在 WebUI 中使用 1. 左侧 **TTS Servers** 下拉框 → 选择 **`Piper TTS (本地离线)`** 2. **Speech Synthesis** → 选择 **`piper:zh_CN-huayan-medium-Female`** 3. 正常输入主题,生成视频即可 > 首次生成时加载模型约 0.7 秒,后续极快。 --- ## 🔧 配置说明 配置文件为 `config.toml`(从 `config.example.toml` 复制),核心配置: ### LLM(大模型,用于自动生成文案) 至少配置以下之一(在 WebUI 中也可以设置): ```toml # OpenAI(需代理) llm_provider = "openai" openai_api_key = "sk-xxx" # 通义千问(国内直连) llm_provider = "qwen" qwen_api_key = "sk-xxx" # AIHubMix(OpenAI 兼容中转) llm_provider = "aihubmix" aihubmix_api_key = "xxx" ``` ### 视频素材 API Key ```toml pexels_api_keys = ["你的Pexels Key"] pixabay_api_keys = ["你的Pixabay Key"] ``` | 素材源 | 注册地址 | |--------|----------| | Pexels | https://www.pexels.com/api/ | | Pixabay | https://pixabay.com/api/docs/ | --- ## 🌐 API 使用 API 地址:`http://127.0.0.1:8080`,Swagger 文档:`/docs` ```bash # 创建视频任务 curl -X POST http://127.0.0.1:8080/api/v1/video \ -H "Content-Type: application/json" \ -d '{ "video_subject": "生命的意义是什么", "video_aspect": "portrait", "voice_name": "zh-CN-XiaoxiaoNeural", "subtitle_enabled": true }' # 查询任务 curl http://127.0.0.1:8080/api/v1/video/{task_id} ``` --- ## ❓ 常见问题 ### Edge TTS 超时(国内网络) 国内无法直连 Edge TTS(微软海外服务),建议: 1. 开启 VPN 全局代理 2. 或切换到 **Piper TTS(本地离线)** 或 **SiliconFlow TTS** ### RuntimeError: No ffmpeg exe could be found ```toml [app] ffmpeg_path = "C:\\path\\to\\ffmpeg.exe" # Windows 用户手动指定 ``` 从 https://www.gyan.dev/ffmpeg/builds/ 下载。 ### OSError: Too many open files ```bash ulimit -n 10240 # Linux / macOS 调高文件打开数 ``` --- ## 📁 项目结构 ``` MoneyPrinterTurbo/ ├── app/ # 后端 FastAPI │ ├── services/ │ │ ├── voice.py # TTS 引擎(含 Piper TTS 支持) │ │ ├── video.py # 视频合成 │ │ ├── task.py # 任务管理 │ │ └── llm.py # LLM 文案生成 │ └── controllers/v1/ # API 路由 ├── webui/Main.py # Streamlit Web 界面 ├── scripts/ # 工具脚本 │ ├── download_piper.sh # Piper 下载(Linux/macOS) │ └── download_piper.bat # Piper 下载(Windows) ├── models/piper/ # Piper 模型(需自行下载) ├── resource/ # 资源文件 │ ├── songs/ # 背景音乐 │ └── fonts/ # 字幕字体 ├── config.example.toml # 配置模板 ├── docker-compose.yml # Docker 编排 └── Dockerfile # 容器构建 ``` --- ## 📜 许可证 点击查看 [`LICENSE`](LICENSE) 文件