This commit is contained in:
+481
@@ -0,0 +1,481 @@
|
||||
<div align="center">
|
||||
|
||||
# MoneyPrinterTurbo 💸
|
||||
|
||||
### 一站式 AI 短视频生成工具
|
||||
|
||||
只需提供视频<b>主题</b>或<b>关键词</b>,即可自动生成视频脚本、匹配素材、生成字幕和背景音乐,并合成高清短视频。
|
||||
|
||||
[](https://github.com/harry0703/MoneyPrinterTurbo/releases)
|
||||
[](https://github.com/harry0703/MoneyPrinterTurbo/releases/latest)
|
||||
[](https://www.python.org/)
|
||||
[](https://github.com/harry0703/MoneyPrinterTurbo/releases/latest)
|
||||
|
||||
<a href="https://trendshift.io/repositories/8731" target="_blank"><img src="https://trendshift.io/api/badge/repositories/8731" alt="harry0703%2FMoneyPrinterTurbo | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
<a href="https://www.star-history.com/harry0703/moneyprinterturbo"><img src="https://api.star-history.com/badge?repo=harry0703/MoneyPrinterTurbo" alt="Star History Rank" style="height: 55px;" height="55"/></a>
|
||||
|
||||
简体中文 | [English](README-en.md) | [版本发布](https://github.com/harry0703/MoneyPrinterTurbo/releases) | [问题反馈](https://github.com/harry0703/MoneyPrinterTurbo/issues)
|
||||
|
||||
</div>
|
||||
|
||||
## 界面预览 🖥️
|
||||
|
||||
<h4 align="center">WebUI</h4>
|
||||
|
||||

|
||||
|
||||
<h4 align="center">API</h4>
|
||||
|
||||

|
||||
|
||||
## 特别感谢 ❤️
|
||||
|
||||
<div align="center">
|
||||
<a href="https://platform.kimi.com?aff=MoneyPrinterTurbo" target="_blank"><img src="https://gcdn.moonshot.cn/growth-cdn/sponsor/kimi-zh.png" alt="Kimi 赞助 MoneyPrinterTurbo" width="100%"></a>
|
||||
</div>
|
||||
|
||||
感谢 [Kimi](https://platform.kimi.com?aff=MoneyPrinterTurbo) 赞助本项目 是 Moonshot AI 推出的编程专用开源智能体模型,在真实长程编程与复杂软件工程工作流中显著提升端到端任务成功率,同时优化推理效率,相比 K2.6 平均减少约 30% 的推理 token 消耗。而在本项目中,Kimi 大模型能直接驱动视频创作,不仅撰写视频文案,还会提炼素材搜索关键词、决定成片画面,文案理解越精准,匹配到的素材就越贴题。
|
||||
|
||||
**本项目已接入 Kimi 大模型。前往 [Kimi 开放平台](https://platform.kimi.com?aff=MoneyPrinterTurbo)([中文站](https://platform.kimi.com?aff=MoneyPrinterTurbo)|[Global](https://platform.kimi.ai?aff=MoneyPrinterTurbo))体验 API,或了解高性价比 [Coding Plan 套餐](https://www.kimi.com/code?aff=MoneyPrinterTurbo)。**
|
||||
<br>
|
||||
|
||||
<table align="center">
|
||||
<tr>
|
||||
<td align="center" width="120">
|
||||
<a href="https://www.volcengine.com/activity/ai618?utm_campaign=hw&utm_content=hw&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=MoneyPrinterTurbo"><img src="docs/sponsors/volcengine-logo.svg" alt="火山引擎" height="32"></a><br>
|
||||
<a href="https://www.volcengine.com/activity/ai618?utm_campaign=hw&utm_content=hw&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=MoneyPrinterTurbo"><strong>火山引擎</strong></a>
|
||||
</td>
|
||||
<td align="left">
|
||||
感谢 <a href="https://www.volcengine.com/activity/ai618?utm_campaign=hw&utm_content=hw&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=MoneyPrinterTurbo">火山引擎</a> 赞助了本项目!方舟 Agent Plan 模型订阅套餐集成了包含 Doubao-Seed、Doubao-Seedance、Doubao-Seedream 等在内的字节跳动自研 SOTA 级模型,覆盖文本、代码、图像、视频等多模态任务。最新支持 MiniMax-M3、DeepSeek-V4 系列、GLM-5.2、Doubao-Seed-2.0 系列、Kimi-K2.7 等模型,工具不限。超全模态模型与 Harness 升级一步到位,深度支持 Agent 框架与 AI 编程工具。一次订阅,可以为不同任务切换合适的 AI 引擎。方舟 Agent Plan 限时 2.5 折订阅,<a href="https://www.volcengine.com/activity/ai618?utm_campaign=hw&utm_content=hw&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=MoneyPrinterTurbo">点击链接抢购</a>,名额有限,先到先得。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="120">
|
||||
<a href="https://www.ccsub.net/register?ref=VCVDAWWY"><img src="docs/sponsors/ccsub-logo.png" alt="CCSub" height="36"></a><br>
|
||||
<a href="https://www.ccsub.net/register?ref=VCVDAWWY"><strong>CCSub</strong></a>
|
||||
</td>
|
||||
<td align="left">
|
||||
感谢 <a href="https://www.ccsub.net/register?ref=VCVDAWWY">CCSub</a> 赞助本项目!CCSub 是稳定、实惠的 AI API 中转平台,是 Claude Code 官方订阅的超强平替。一个 API Key 即可调用 Claude Opus 4.8、Sonnet 4.6、Haiku 4.5、GPT-5、Gemini 等模型,价格约为官方直连的 1/3,全球直连无需梯子。兼容 Claude Code、Codex、Cursor、Cline、Continue、Windsurf 等所有主流 AI 编程工具。前往 <a href="https://www.ccsub.net/register?ref=VCVDAWWY">www.ccsub.net</a> 注册即送 $5 体验额度。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="120">
|
||||
<a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY-git_MoneyPrinterTu"><img src="docs/sponsors/compshare-logo.png" alt="优云智算" height="34"></a><br>
|
||||
<a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY-git_MoneyPrinterTu"><strong>优云智算</strong></a>
|
||||
</td>
|
||||
<td align="left">
|
||||
感谢 <a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY-git_MoneyPrinterTu">优云智算</a> 赞助本项目!优云智算是 UCloud 旗下 AI 云平台,一站式提供国内外主流模型的 API 服务,一个 Key 即可调用所有模型。主打高性价比国产模型 CodingPlan 套餐(GLM5.2、Deepseek-v4等),同时提供官方转发的稳定海外模型通道,满足多场景开发需求。已兼容 Claude Code、Codex 等主流 AI 编程工具及通用 API 调用,支持企业级高并发、7×24 技术支持和自助开票。<a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY-git_MoneyPrinterTu">点击注册</a>,最高可获得 ¥10 免费体验金。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="120">
|
||||
<a href="https://cubence.com/signup?code=SCE1CJPE&source=mpt"><img src="docs/sponsors/cubence-logo.png" alt="Cubence" height="40"></a><br>
|
||||
<a href="https://cubence.com/signup?code=SCE1CJPE&source=mpt"><strong>Cubence</strong></a>
|
||||
</td>
|
||||
<td align="left">
|
||||
感谢 <a href="https://cubence.com/signup?code=SCE1CJPE&source=mpt">Cubence</a> 对本项目的支持。Cubence 是一家专注于 AI 模型 API 接入服务的平台,致力于为开发者和团队提供稳定、便捷的模型调用体验。自 2025 年 9 月上线以来,Cubence 已支持 Claude Code、Codex、Gemini 等多种 AI 模型与开发工具相关的 API 接入场景,适合需要统一管理和调用多模型能力的用户使用。Cubence 为本开源项目用户提供了专属优惠码:<a href="https://cubence.com/signup?code=SCE1CJPE&source=mpt"><code>MPT</code></a>。首次购买时使用该优惠码,<a href="https://cubence.com/signup?code=SCE1CJPE&source=mpt">可享受 9 折优惠</a>。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="120">
|
||||
<a href="https://reccloud.cn"><img src="docs/sponsors/reccloud-logo.svg" alt="录咖" height="36"></a><br>
|
||||
<a href="https://reccloud.cn"><strong>录咖 AI</strong></a>
|
||||
</td>
|
||||
<td align="left">
|
||||
由于该项目的 <strong>部署</strong> 和 <strong>使用</strong>,对于一些小白用户来说,还是 <strong>有一定的门槛</strong>,在此特别感谢 <a href="https://reccloud.cn">录咖(AI智能 多媒体服务平台)</a> 网站基于该项目,提供的免费 <code>AI视频生成器</code> 服务,可以不用部署,直接在线使用,非常方便。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="120">
|
||||
<a href="https://picwish.cn"><img src="docs/sponsors/picwish-logo.svg" alt="佐糖" height="36"></a><br>
|
||||
<a href="https://picwish.cn"><strong>佐糖</strong></a>
|
||||
</td>
|
||||
<td align="left">
|
||||
感谢 <a href="https://picwish.cn">佐糖</a> 对该项目的支持和赞助,使得该项目能够持续的更新和维护。佐糖专注于<strong>图像处理领域</strong>,提供丰富的<strong>图像处理工具</strong>,将复杂操作极致简化,真正实现让图像处理更简单。
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 功能特性 🎯
|
||||
|
||||
- [x] 提供 **AI Agent**、**WebUI**、**API** 和 **CLI** 四种使用方式,代码按控制器、服务和模型等职责分层
|
||||
- [x] 支持 **AI 自动生成视频脚本**,也可以使用自定义脚本
|
||||
- [x] 支持多种 **高清视频** 尺寸
|
||||
- [x] 竖屏 9:16,`1080x1920`
|
||||
- [x] 横屏 16:9,`1920x1080`
|
||||
- [x] 支持 **批量视频生成**,可以一次生成多个视频,然后选择一个最满意的
|
||||
- [x] 支持 **视频片段时长** 设置,方便调节素材切换频率
|
||||
- [x] 支持 **多语言视频脚本** 生成
|
||||
- [x] 支持 **Edge TTS**、**Azure Speech**、**SiliconFlow**、**Google Gemini**、**小米 MiMo**、**ElevenLabs** 和 **Chatterbox** 语音合成,可实时试听
|
||||
- [x] 支持 **字幕生成**,可调整字体、位置、颜色、大小、描边和背景样式
|
||||
- [x] 支持 **背景音乐**,可随机选择或使用指定音乐,并调整音量
|
||||
- [x] 支持使用自己的 **本地素材**,也可从 **Pexels**、**Pixabay** 和 **Coverr** 获取可免费使用的高清素材
|
||||
- [x] 支持 **Kimi / Moonshot AI**、**OpenAI**、**Google Gemini**、**DeepSeek**、**阿里云通义千问**、**Microsoft Azure OpenAI**、**火山引擎方舟**、**xAI Grok**、**MiniMax**、**小米 MiMo** 等主流模型服务,并兼容 **Cloudflare AI Gateway**、**魔搭 ModelScope**、**AIHubMix**、**AIML API**、**EvoLink**、**Ollama**、**OneAPI**、**LiteLLM**、**Groq**、**Pollinations AI** 等统一网关、聚合平台和本地运行环境
|
||||
- [x] 支持一键 **跨平台发布**,生成完成后可自动上传至 **TikTok**、**Instagram** 和 **YouTube Shorts**
|
||||
|
||||
## 作品展示 🎬
|
||||
|
||||
以下示例均由 MoneyPrinterTurbo 实际生成。
|
||||
|
||||
### 竖屏 9:16
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=03-zh-portrait-city-morning.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/03-zh-portrait-city-morning.jpg" width="180" alt="城市醒来的时刻"></a><br><strong>城市醒来的时刻</strong><br>中文 · 14 秒</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=05-zh-portrait-clean-energy.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/05-zh-portrait-clean-energy.jpg" width="180" alt="清洁能源的未来"></a><br><strong>清洁能源的未来</strong><br>中文 · 24 秒</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=07-zh-portrait-space-exploration.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/07-zh-portrait-space-exploration.jpg" width="180" alt="为什么我们仍要探索太空"></a><br><strong>为什么我们仍要探索太空</strong><br>中文 · 27 秒</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=17-zh-portrait-seed-journey.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/17-zh-portrait-seed-journey.jpg" width="180" alt="一粒种子的旅程"></a><br><strong>一粒种子的旅程</strong><br>中文 · 44 秒</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=09-en-portrait-future-robotics.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/09-en-portrait-future-robotics.jpg" width="180" alt="The Future of Everyday Robotics"></a><br><strong>The Future of Everyday Robotics</strong><br>English · 21 sec</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=11-en-portrait-small-habits.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/11-en-portrait-small-habits.jpg" width="180" alt="Small Habits, Lasting Change"></a><br><strong>Small Habits, Lasting Change</strong><br>English · 19 sec</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=13-en-portrait-creative-work.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/13-en-portrait-creative-work.jpg" width="180" alt="Making Space for Creative Work"></a><br><strong>Making Space for Creative Work</strong><br>English · 20 sec</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=15-en-portrait-coffee-science.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/15-en-portrait-coffee-science.jpg" width="180" alt="The Science Inside Coffee"></a><br><strong>The Science Inside Coffee</strong><br>English · 23 sec</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### 横屏 16:9
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=02-zh-landscape-deep-ocean.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/02-zh-landscape-deep-ocean.jpg" width="280" alt="深海里的微光"></a><br><strong>深海里的微光</strong><br>中文 · 23 秒</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=04-zh-landscape-reading-power.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/04-zh-landscape-reading-power.jpg" width="280" alt="阅读如何塑造我们"></a><br><strong>阅读如何塑造我们</strong><br>中文 · 23 秒</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=06-zh-landscape-pour-over-coffee.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/06-zh-landscape-pour-over-coffee.jpg" width="280" alt="一杯手冲咖啡的细节"></a><br><strong>一杯手冲咖啡的细节</strong><br>中文 · 23 秒</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=08-zh-landscape-spring-journey.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/08-zh-landscape-spring-journey.jpg" width="280" alt="春天适合出发"></a><br><strong>春天适合出发</strong><br>中文 · 14 秒</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=10-en-landscape-ocean-conservation.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/10-en-landscape-ocean-conservation.jpg" width="280" alt="Why Ocean Conservation Matters"></a><br><strong>Why Ocean Conservation Matters</strong><br>English · 25 sec</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=14-en-landscape-sustainable-cities.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/14-en-landscape-sustainable-cities.jpg" width="280" alt="Designing More Sustainable Cities"></a><br><strong>Designing More Sustainable Cities</strong><br>English · 27 sec</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=16-en-landscape-mountain-perspective.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/16-en-landscape-mountain-perspective.jpg" width="280" alt="What Mountains Teach Us"></a><br><strong>What Mountains Teach Us</strong><br>English · 18 sec</td>
|
||||
<td align="center" width="25%"><a href="https://harry0703.github.io/mpt-assets/?video=18-en-landscape-history-of-flight.mp4"><img src="https://github.com/harry0703/mpt-assets/releases/download/assets/18-en-landscape-history-of-flight.jpg" width="280" alt="A Brief History of Human Flight"></a><br><strong>A Brief History of Human Flight</strong><br>English · 59 sec</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 配置要求 📦
|
||||
|
||||
- 建议系统:Windows 10、macOS 11.0 或更高版本,以及主流 Linux 发行版
|
||||
- 本地部署需要 Python 3.11 或更高版本,推荐使用 Python 3.11
|
||||
- GPU 不是必需项,但如果你希望本地转录、更快的视频处理或更顺畅的批量生成体验,建议使用带显存的独立显卡
|
||||
|
||||
| 项目 | 最低配置 | 推荐配置 | 理想配置 |
|
||||
| ---- | -------- | --------------- | --------------- |
|
||||
| CPU | 4 核 | 6 到 8 核 | 8 核及以上 |
|
||||
| RAM | 4 GB | 8 GB | 16 GB 及以上 |
|
||||
| GPU | 非必须 | 4 GB 显存及以上 | 8 GB 显存及以上 |
|
||||
|
||||
- 如果你主要依赖云端 LLM、云端 TTS 和在线素材源,CPU 与内存比 GPU 更重要
|
||||
- 如果你启用 `faster-whisper`、批量生成或更重的本地处理链路,GPU 会明显提升速度
|
||||
|
||||
## 快速开始 🚀
|
||||
|
||||
### 推荐使用方式
|
||||
|
||||
- 不想手动安装和配置:直接使用 AI Agent 生成视频
|
||||
- Windows 用户:优先使用一键启动包,适合快速体验
|
||||
- macOS / Linux 用户:优先使用 `uv` 进行本地部署
|
||||
- 想要隔离运行环境:优先使用 Docker 部署
|
||||
|
||||
### 使用 AI Agent 生成视频
|
||||
|
||||
如果你的 AI Agent 支持读取 Skill 文档并操作本地终端,可以直接发送下面这段话。Agent 会自动完成安装、配置和视频生成;只有缺少必要的 API Key 时才会向你询问,完成后会返回生成的视频文件路径。目前支持 macOS 和 Windows。
|
||||
|
||||
```text
|
||||
使用这个 Skill:https://raw.githubusercontent.com/harry0703/MoneyPrinterTurbo/main/docs/skill/SKILL.md
|
||||
帮我生成一个主题为“人工智能如何改变普通人的日常生活”的视频。
|
||||
```
|
||||
|
||||
### 在 Google Colab 中运行
|
||||
|
||||
免去本地环境配置,点击直接在 Google Colab 中快速体验 MoneyPrinterTurbo
|
||||
|
||||
[](https://colab.research.google.com/github/harry0703/MoneyPrinterTurbo/blob/main/docs/MoneyPrinterTurbo.ipynb)
|
||||
|
||||
### Windows 一键启动包
|
||||
|
||||
下载一键启动包,解压直接使用(路径不要有 **中文**、**特殊字符**、**空格**)
|
||||
|
||||
- GitHub Releases:https://github.com/harry0703/MoneyPrinterTurbo/releases/latest
|
||||
|
||||
下载后,建议先**双击执行** `update.bat` 更新到**最新代码**,然后双击 `start.bat` 启动
|
||||
|
||||
启动后,会自动打开浏览器(如果打开是空白,建议换成 **Chrome** 或者 **Edge** 打开)
|
||||
|
||||
## 安装部署 📥
|
||||
|
||||
### 前提条件
|
||||
|
||||
- 本地部署需要 Python 3.11 或更高版本
|
||||
- Windows 用户建议避免使用包含中文、特殊字符或空格的项目路径
|
||||
|
||||
#### ① 克隆代码
|
||||
|
||||
```shell
|
||||
git clone https://github.com/harry0703/MoneyPrinterTurbo.git
|
||||
```
|
||||
|
||||
#### ② 配置项目(可选)
|
||||
|
||||
首次启动时,项目会根据 `config.example.toml` 自动创建 `config.toml`。大模型 Provider、素材来源和相关 API Key 可以直接在 WebUI 的基础设置中配置。
|
||||
|
||||
### Docker 部署 🐳
|
||||
|
||||
#### ① 启动 Docker
|
||||
|
||||
如果未安装 Docker,请先安装 https://www.docker.com/products/docker-desktop/
|
||||
|
||||
Windows 用户可以参考微软的文档:
|
||||
|
||||
1. https://learn.microsoft.com/zh-cn/windows/wsl/install
|
||||
2. https://learn.microsoft.com/zh-cn/windows/wsl/tutorials/wsl-containers
|
||||
|
||||
```shell
|
||||
cd MoneyPrinterTurbo
|
||||
docker compose -f docker-compose.release.yml up
|
||||
```
|
||||
|
||||
> 默认推荐使用 `docker-compose.release.yml`,它会直接拉取 GitHub Container Registry 上的预构建镜像:`ghcr.io/harry0703/moneyprinterturbo:latest`。
|
||||
> 如果你需要本地重新构建镜像,可以继续使用 `docker compose up`。
|
||||
> 首次启动前,请将 `config.example.toml` 复制为 `config.toml`,供容器挂载使用。
|
||||
|
||||
#### ② 访问 WebUI
|
||||
|
||||
打开浏览器,访问 http://127.0.0.1:8501
|
||||
|
||||
#### ③ 访问 API 文档
|
||||
|
||||
打开浏览器,访问 http://127.0.0.1:8080/docs 或者 http://127.0.0.1:8080/redoc
|
||||
|
||||
### 手动部署 📦
|
||||
|
||||
> 视频教程
|
||||
|
||||
- 完整的使用演示:https://v.douyin.com/iFhnwsKY/
|
||||
- 如何在 Windows 上部署:https://v.douyin.com/iFyjoW3M
|
||||
|
||||
#### ① 创建虚拟环境
|
||||
|
||||
推荐使用 [uv](https://docs.astral.sh/uv/) 管理 Python 环境和依赖。项目支持 Python 3.11 或更高版本,以下示例使用 Python 3.11。
|
||||
|
||||
```shell
|
||||
git clone https://github.com/harry0703/MoneyPrinterTurbo.git
|
||||
cd MoneyPrinterTurbo
|
||||
uv python install 3.11
|
||||
uv sync --frozen
|
||||
```
|
||||
|
||||
如果你暂时不使用 `uv`,也可以继续使用 `venv + pip`
|
||||
|
||||
```shell
|
||||
python3.11 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
说明:
|
||||
|
||||
- `pyproject.toml` 是主依赖定义文件
|
||||
- `uv.lock` 是锁文件,建议默认执行 `uv sync --frozen`
|
||||
- `requirements.txt` 仅保留给旧的 `pip` 安装方式兼容使用
|
||||
|
||||
#### ② 启动 WebUI 🌐
|
||||
|
||||
注意需要到 MoneyPrinterTurbo 项目 `根目录` 下执行以下命令
|
||||
|
||||
###### Windows
|
||||
|
||||
```powershell
|
||||
.\webui.bat
|
||||
```
|
||||
|
||||
在 CMD 中也可以执行 `webui.bat`。
|
||||
`webui.bat` 会优先使用项目 `.venv` 或一键包内置 Python;如果没有找到项目 Python,但已安装 `uv`,会自动切换为 `uv run streamlit`。
|
||||
如需允许局域网内其他设备访问 WebUI,可以先执行 `set MPT_WEBUI_HOST=0.0.0.0`,再运行 `webui.bat`。
|
||||
|
||||
###### macOS 或 Linux
|
||||
|
||||
```shell
|
||||
sh webui.sh
|
||||
```
|
||||
|
||||
脚本会自动使用项目虚拟环境或 `uv`,并选择可用的本地端口。如需允许局域网内其他设备访问,可以执行:
|
||||
|
||||
```shell
|
||||
MPT_WEBUI_HOST=0.0.0.0 sh webui.sh
|
||||
```
|
||||
|
||||
启动后,会自动打开浏览器(如果打开是空白,建议换成 **Chrome** 或者 **Edge** 打开)
|
||||
|
||||
#### ③ 启动 API 服务 🚀
|
||||
|
||||
```shell
|
||||
uv run python main.py
|
||||
```
|
||||
|
||||
如果你已经手动激活了虚拟环境,也可以直接执行:
|
||||
|
||||
```shell
|
||||
python main.py
|
||||
```
|
||||
|
||||
#### ④ 纯命令行方式(无浏览器)⌨️
|
||||
|
||||
如果你无法使用浏览器或端口转发,可以直接在命令行生成视频。最简单的完整视频生成命令如下:
|
||||
|
||||
```shell
|
||||
uv run python cli.py --video-subject "人工智能如何改变日常生活"
|
||||
```
|
||||
|
||||
如需查看完整命令、参数说明和使用方法,可以执行:
|
||||
|
||||
```shell
|
||||
uv run python cli.py --help
|
||||
```
|
||||
|
||||
## 语音合成 🗣
|
||||
|
||||
默认使用免费的 **Edge TTS**,在 WebUI 中显示为 **Azure TTS V1**。项目同时支持 **Azure TTS V2**、**SiliconFlow TTS**、**Google Gemini TTS**、**小米 MiMo TTS**、**ElevenLabs TTS**、自托管 **Chatterbox TTS**,以及无配音模式。
|
||||
|
||||
可直接在 WebUI 中选择 Provider 和音色,并按照界面提示填写所需凭据。Edge TTS 不需要 API Key;[Azure TTS V2](https://portal.azure.com/) 及其他云端服务需要对应平台的凭据。Edge TTS 音色可查看:[音色列表](./docs/voice-list.txt)。
|
||||
|
||||
## 字幕生成 📜
|
||||
|
||||
当前支持两种字幕生成方式:
|
||||
|
||||
- **edge**:使用 TTS 时间戳生成字幕,速度快,不需要 GPU,默认使用该模式。
|
||||
- **whisper**:使用本地 `faster-whisper` 转写音频,适用于需要更准确字幕时间轴的场景。首次使用时需要下载模型。
|
||||
|
||||
在 `config.toml` 中修改 `subtitle_provider` 即可切换模式。Whisper 默认使用约 3 GB 的 `large-v3`;如需更小、更快的模型,可以使用约 1.6 GB 的 `large-v3-turbo`:
|
||||
|
||||
```toml
|
||||
[app]
|
||||
subtitle_provider = "whisper"
|
||||
|
||||
[whisper]
|
||||
model_size = "large-v3-turbo"
|
||||
```
|
||||
|
||||
> 首次使用 Whisper 时,程序会自动从 Hugging Face 下载模型。如果当前网络无法自动下载,可以从 [Hugging Face](https://huggingface.co/Systran/faster-whisper-large-v3) 手动下载 `whisper-large-v3`。
|
||||
|
||||
下载并解压后,将整个目录放到 `.\MoneyPrinterTurbo\models`,最终路径应为 `.\MoneyPrinterTurbo\models\whisper-large-v3`:
|
||||
|
||||
```
|
||||
MoneyPrinterTurbo
|
||||
├─models
|
||||
│ └─whisper-large-v3
|
||||
│ config.json
|
||||
│ model.bin
|
||||
│ preprocessor_config.json
|
||||
│ tokenizer.json
|
||||
│ vocabulary.json
|
||||
```
|
||||
|
||||
## 背景音乐 🎵
|
||||
|
||||
用于视频的背景音乐,位于项目的 `resource/songs` 目录下。
|
||||
|
||||
> 当前项目里面放了一些默认的音乐,来自于 YouTube 视频,如有侵权,请删除。
|
||||
|
||||
## 字幕字体 🅰
|
||||
|
||||
用于视频字幕的渲染,位于项目的 `resource/fonts` 目录下,你也可以放进去自己的字体。
|
||||
|
||||
## 常见问题 🤔
|
||||
|
||||
<details>
|
||||
<summary>如何发布到 TikTok、Instagram 或 YouTube Shorts?</summary>
|
||||
|
||||
注册 [Upload-Post](https://upload-post.com/) 账号并获取 API Key,然后在 `config.toml` 的 `[app]` 下添加以下配置:
|
||||
|
||||
```toml
|
||||
[app]
|
||||
upload_post_enabled = true
|
||||
upload_post_api_key = "your-api-key"
|
||||
upload_post_username = "your-username"
|
||||
upload_post_platforms = ["tiktok", "instagram", "youtube"]
|
||||
upload_post_auto_upload = true
|
||||
upload_post_youtube_privacy_status = "public"
|
||||
```
|
||||
|
||||
保存配置并重启项目。视频生成完成后,程序会自动发布到已配置的平台。YouTube 可见性可设置为 `public`、`unlisted` 或 `private`。
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>RuntimeError: No ffmpeg exe could be found</summary>
|
||||
|
||||
通常情况下,ffmpeg 会被自动下载,并且会被自动检测到。
|
||||
但是如果你的环境有问题,无法自动下载,可能会遇到如下错误:
|
||||
|
||||
```
|
||||
RuntimeError: No ffmpeg exe could be found.
|
||||
Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable.
|
||||
```
|
||||
|
||||
此时你可以从 https://www.gyan.dev/ffmpeg/builds/ 下载ffmpeg,解压后,设置 `ffmpeg_path` 为你的实际安装路径即可。
|
||||
|
||||
```toml
|
||||
[app]
|
||||
# 请根据你的实际路径设置,注意 Windows 路径分隔符为 \\
|
||||
ffmpeg_path = "C:\\Users\\harry\\Downloads\\ffmpeg.exe"
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>OSError: [Errno 24] Too many open files</summary>
|
||||
|
||||
这个问题是由于系统打开文件数限制导致的,可以通过修改系统的文件打开数限制来解决。
|
||||
|
||||
查看当前限制
|
||||
|
||||
```shell
|
||||
ulimit -n
|
||||
```
|
||||
|
||||
如果过低,可以调高一些,比如
|
||||
|
||||
```shell
|
||||
ulimit -n 10240
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Whisper 模型下载失败</summary>
|
||||
|
||||
```
|
||||
LocalEntryNotFoundError: Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and
|
||||
outgoing traffic has been disabled.
|
||||
To enable repo look-ups and downloads online, pass 'local_files_only=False' as input.
|
||||
```
|
||||
|
||||
或者
|
||||
|
||||
```
|
||||
An error occurred while synchronizing the model Systran/faster-whisper-large-v3 from the Hugging Face Hub:
|
||||
An error happened while trying to locate the files on the Hub and we cannot find the appropriate snapshot folder for the
|
||||
specified revision on the local disk. Please check your internet connection and try again.
|
||||
Trying to load the model directly from the local cache, if it exists.
|
||||
```
|
||||
|
||||
解决方法:[查看如何从 Hugging Face 手动下载模型](#%E5%AD%97%E5%B9%95%E7%94%9F%E6%88%90-)
|
||||
|
||||
</details>
|
||||
|
||||
## 反馈建议 📢
|
||||
|
||||
- 可以提交 [issue](https://github.com/harry0703/MoneyPrinterTurbo/issues) 或者 [pull request](https://github.com/harry0703/MoneyPrinterTurbo/pulls)。
|
||||
|
||||
## 许可证 📝
|
||||
|
||||
点击查看 [`LICENSE`](LICENSE) 文件
|
||||
|
||||
## Star History
|
||||
|
||||
<a href="https://www.star-history.com/?repos=harry0703%2FMoneyPrinterTurbo&type=date&legend=top-left">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=harry0703/MoneyPrinterTurbo&type=date&theme=dark&legend=top-left&sealed_token=AtOR8By6GcNKd46eJLixrnucHF_99GOSBBKfc60pAm2xsDylemaYxDMcvTlPRz-G_onzDrs-hDrM0xdKkn0L6PgDin3fv02ViVtsZvgRYgk0YOzkX2KgLG8wro66VGphii-u6GNpzD8JocrqGGKvsFSpmbRqo5g-2mEDaN7-ESdtF48ZH0rDOCpoc1Mh" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=harry0703/MoneyPrinterTurbo&type=date&legend=top-left&sealed_token=AtOR8By6GcNKd46eJLixrnucHF_99GOSBBKfc60pAm2xsDylemaYxDMcvTlPRz-G_onzDrs-hDrM0xdKkn0L6PgDin3fv02ViVtsZvgRYgk0YOzkX2KgLG8wro66VGphii-u6GNpzD8JocrqGGKvsFSpmbRqo5g-2mEDaN7-ESdtF48ZH0rDOCpoc1Mh" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=harry0703/MoneyPrinterTurbo&type=date&legend=top-left&sealed_token=AtOR8By6GcNKd46eJLixrnucHF_99GOSBBKfc60pAm2xsDylemaYxDMcvTlPRz-G_onzDrs-hDrM0xdKkn0L6PgDin3fv02ViVtsZvgRYgk0YOzkX2KgLG8wro66VGphii-u6GNpzD8JocrqGGKvsFSpmbRqo5g-2mEDaN7-ESdtF48ZH0rDOCpoc1Mh" />
|
||||
</picture>
|
||||
</a>
|
||||
Reference in New Issue
Block a user