MoneyPrinterTurbo

harry0703MIT活跃维护

输入一个主题或关键词,就能自动完成文案生成、素材匹配、配音字幕和视频合成,一键产出高清短视频,省去手工剪辑的麻烦。

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

v1.3.10发布于 2026-11-07 00:43 UTC141,913star +1,555 / 7 天22,657fork同步于 2026-11-10 17:17 UTC

怎么上手

由 README 提炼,执行前请确认
python -m pip install mpt
mpt webui
硬件要求按 README 说明

README 未说明本地显存或 GPU 型号要求,生成流程依赖云端大模型与在线素材服务;也可在 Google Colab 中运行,免本地环境配置。

8G 显存可跑有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

输入主题或关键词,自动写脚本、配素材、加字幕和BGM,一键合成高清短视频

输入一个主题或关键词,就能自动完成文案生成、素材匹配、配音字幕和视频合成,一键产出高清短视频,省去手工剪辑的麻烦。

核心能力

  • 根据主题自动生成视频脚本与搜索关键词
  • 自动匹配素材、生成字幕并合成背景音乐
  • 提供 WebUI 界面与 HTTP API 两种使用方式
  • 支持 pip 安装、Docker 部署和 Windows 一键包
  • 可接入多家大模型与在线素材、语音服务

容易踩的坑

PyPI 上第三方维护的同名 MoneyPrinterTurbo 包不是官方包,官方包名是 mpt;首次启动会自动生成 config.toml,使用在线模型、素材或语音服务前必须先在 WebUI 填写对应 API Key;Docker 部署前需先把 config.example.toml 复制为 config.toml 供容器挂载,WebUI 默认在 8501、API 在 8080 端口。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.3.10
  1. v1.3.10最新正式版2026-11-07 · 2026-11-07 00:43 UTC

    English | 中文

    • Added OpenAI Codex subscription access with device-code sign-in and dynamic model selection, plus a separate ChatGPT Native OAuth provider. Native OAuth availability depends on account eligibility; existing Codex sign-in remains independent.
    • Added Codex image generation as a material source. Text and image generation can share the application's Codex login, and generated images support the existing static and slow zoom effects.
    • Added Infistar and Jalapeno Cloud for LLM and video generation, alongside Runcrate, CloudGPU, and cheapaimodel LLM providers.
    • Improved long-running video generation feedback with generation stages, elapsed time, and polling status. Task tracking survives page refreshes and temporary query failures, with protection against duplicate submissions.
    • Simplified provider settings and selection in the WebUI, making configured services easier to find and switch between.
    • Added Arabic-script subtitle shaping, including connected letters, right-to-left layout, mixed-script font fallback, and glyph-aware wrapping and backgrounds.
    • Made slow image zoom smoother with sub-pixel rendering, eliminating visible stepping and wobble.
    • Added Indonesian to script-language choices and refined the Indonesian interface translations.

    Fixes and Improvements

    • Fixed long Edge TTS narration timing out because of unnecessary delays between streamed chunks. Added support for Edge voices with script subtags and clearer Gemini empty-audio diagnostics.
    • Removed emoji from narration and burned-in subtitles, and clarified that Gemini and MiMo TTS do not use the voice-speed setting.
    • Improved subtitle splitting around clock times, full-width numbers, dates, abbreviations, names, and Chinese and Japanese punctuation. Added sentence splitting for Thai and Lao scripts.
    • Preserved the original timed transcription when subtitle correction cannot align the full script. Fixed empty-string and Unicode length-expansion cases in subtitle similarity scoring.
    • Preserved combining marks in multilingual social hashtags, excluded emoji marks, and recognized Chinese and Japanese hashtag separators.
    • Kept existing script and keywords when AI generation fails, displayed an actionable error, and avoided requesting keywords after script generation has already failed.
    • Preserved the position of repeated topics during script-order stock-material matching, repaired corrupt video caches, and added clearer Pexels and Coverr search-failure logs.
    • Stopped console keystrokes from prematurely ending or stalling FFmpeg clip concatenation. Fixed render-output synchronization on Windows and big-endian grayscale TIFF brightness.
    • Improved Windows startup from paths containing special characters, from other working directories, and with LAN listening enabled. Fixed redirected console logs and preserved Windows paths and non-breaking spaces when saving configuration.
    • Shared Redis task-concurrency limits across workers, with atomic slot reservation, lease renewal, and queued-task recovery.
    • Improved subtitle-font error messages, API enum defaults, and ChatGPT/Codex sign-in diagnostics. Clarified Docker configuration setup and recovery from an accidentally mounted config.toml directory.
    • Updated CPU-container dependencies to address fixable security findings and added container vulnerability scanning. Expanded regression coverage and corrected Windows-specific path assertions.

    What's Changed

  2. v1.3.92026-10-21 · 2026-10-21 06:54 UTC
    查看更新说明

    English | 中文

    • Added official mpt pip packaging. Start the WebUI with mpt webui or generate videos with mpt cli.
    • Added static and slow zoom image effects for local and AI-generated images. Slow zoom remains the default.
    • Added Kimi Code subscription access with browser authorization, alongside improvements to the sign-in dialog, status updates, and cancellation.
    • Added an optional local SDXL image server for the OpenAI-compatible image material workflow, with idle GPU offloading.
    • Added Opper, onomeo, Muse Spark, and EmpirioLabs AI LLM providers, and completed Brazilian Portuguese WebUI translations.
    • Added diagnostic logging controls in the WebUI, including runtime log-level changes and opt-in API request tracing with redaction and size limits.

    Fixes and Improvements

    • Fixed grayscale image brightness, transparent image backgrounds, zoom mask alignment, and subtitle background colors. Improved transitions on short clips, background music fade-out, and special-character handling in concatenation paths.
    • Isolated intermediate image files across concurrent jobs, improved image cache identity, and validated cached downloads. Completed videos are retained when another video in the same batch fails.
    • Fixed speech speed, volume, and audio container handling across several providers. Improved remote audio validation and preserved existing audio until replacement output is ready.
    • Improved subtitle timestamp rounding, long-word wrapping, Unicode handling, and pause-tag recognition. Symbol-only lines and separators no longer distort estimated subtitle alignment.
    • Fixed Chinese and Japanese fallback social titles using the entire script. Improved JSON extraction, reasoning removal, Markdown cleanup, and generated search-term validation.
    • Expanded supported local upload formats, including multi-picture camera JPEGs. Improved task history checks, deletion state, subtitle previews, and model connection error messages in the WebUI.
    • Added HEAD support for generated artifacts and improved byte-range downloads, validation errors, and Redis task updates and deletion safeguards.
    • Reduced unsafe speech resubmissions after lost responses or redirects, preserved Upload-Post tracking handles, and improved WaveSpeed submission error detection.
    • Updated Edge TTS to address 403 failures, constrained PyAV for Whisper compatibility, and fixed Windows cache cleanup and UTF-8 BOM handling in locale files.
    • Improved the agent helper's configuration handling and preflight checks, including workflows with prepared narration and visuals that do not need an LLM.

    What's Changed

    • Official pip package with WebUI and CLI launchers — c3634de.
    • Static and slow zoom image options — 90f7701.
    • Kimi Code subscription provider — @ysntony in #1599, followed by sign-in flow improvements.
    • Local SDXL image server — @imkashif in #1668.
    • Opper LLM provider — @Felixkw12 in #1589.
    • onomeo LLM provider — @Owaid0723666 in #1600.
    • Muse Spark provider and Brazilian Portuguese translations — @humbertocortezia in #1657.
    • EmpirioLabs AI provider — @Adam-Dalloul in #1694.
    • Runtime diagnostic logging and request tracing — 6940611.
    • Chinese and Japanese fallback
  3. v1.3.82026-10-03 · 2026-10-03 03:31 UTC
    查看更新说明

    English | 中文

    • Added continuous progress reporting during stock footage downloads, clip processing, and final rendering, with task logs from background helper threads visible in the WebUI.
    • Added configurable stock material and clip rendering concurrency. Stock material concurrency applies to Pexels, Pixabay, and Coverr; both settings default to 1 (serial processing).
    • Added VoxCPM reference-audio voice cloning and optional delivery conditioning to carry over pacing and emotion, with local Whisper transcription for editable reference transcripts.
    • Added Fluxion AI, Cheaper Inference, Requesty, FutureInfra, Y-API, and iFlytek Spark (Astron MaaS) LLM providers.
    • Added MuAPI as a video material source, with model endpoint configuration and asynchronous generation.
    • Added Catalan WebUI localization.
    • Improved video color consistency by using the BT.709 conversion matrix and color metadata in the main rendering pipeline.
    • Added an opt-in local video project CLI with revision tracking, change comparison, and reuse of unchanged rendering artifacts when replacing scenes, narration, or background music.

    Fixes and Improvements

    • Improved Redis task updates, queue admission, and startup recovery to reduce lost fields, scheduling conflicts, and stalled queues. Invalid queued requests no longer prevent later usable tasks from being dispatched.
    • Added deadlines for stalled FFmpeg operations and improved temporary-file cleanup. Failed encodes no longer replace successful video outputs with incomplete files.
    • Improved concurrent rendering by isolating concatenation manifests and intermediate clips across jobs and video combinations.
    • Streamed remote video downloads into the cache, added download limits and validation, and improved cache identity and cleanup to avoid reusing the wrong asset or removing fresh downloads.
    • Improved local material handling, including supported upload formats, image decoding, camera orientation, CMYK colors, and rejection of album artwork mistakenly identified as video footage.
    • Preserved timestamps appearing in subtitle text, punctuation in Whisper word results, and manual line breaks. Disabled subtitles no longer pick up stale caption files.
    • Improved subtitle timing fallback and concurrent Whisper initialization. Empty subtitle results now fail explicitly instead of publishing caption files without cues.
    • Hardened narration generation across multiple providers: validate audio before replacing existing files, preserve successful narration when export fails, and stop unsafe retries after synthesis has already been accepted.
    • Improved pause-segment assembly and Azure timing conversion, and fixed narration-only exports ignoring the configured audio volume.
    • Improved script and keyword generation validation, preventing provider error messages from being accepted as generated content. Updated Groq’s retired default model and passed Claude Code prompts through stdin.
    • Added WebUI preflight validation for local materials and custom narration. Improved settings-cache serialization, active task refresh, historical-data handling, version checks, and failed audio-upload cleanup.
    • Hardened uploaded filenames, subtitle font paths, media size limits, and render parameters. Expanded Windows smoke coverage and fixed subprocess output decoding to use UTF-8.
    • Rejected redirects for several credentialed or potentially paid requests, reducing credential exposure and accidental repeat submissions.
    • Improved Upload-Post result validation and recovery tracking. Queued publishing retains the selected account, and YouTube privacy settings are preserved even without generated metadata.
    • Improved API download URLs, special-character escaping, media types, range handling, boolean parsing, CORS origin normalization, and validation-error responses.
    • Updated provider documentation, example configuration, and the agent helper to better match supp
  4. v1.3.72026-09-13 · 2026-09-13 12:26 UTC
    查看更新说明

    English | 中文

    • Added word-by-word subtitles and a pop-up spring animation, with independent controls for display mode and animation in the WebUI.
    • Added preset background music selection with in-browser audio preview, so you can listen before generating a video.
    • Added native pauses to scripts with Azure TTS V1 (Edge TTS): use [pause: 2s] or [停顿: 2s] to insert silence while keeping narration and subtitles aligned.
    • Added Kokoro and VoxCPM TTS providers. Kokoro supports a self-hosted OpenAI-compatible service and automatically loads the server's voice list.
    • Added Claude Code as an LLM provider using an authenticated Claude subscription, with dedicated Docker deployment files; also added the OpenAI-compatible API Route provider.
    • Improved Shengsuan Cloud video generation with account-specific model discovery, quotes and explicit cost confirmation, plus clip-count recommendations based on narration duration.
    • Reduced repeated material selection across videos generated in the same task when using Pexels, Pixabay, Coverr, or local files. Material reuse is reported when the available pool is insufficient.
    • Added a YouTube “Made for kids” audience setting to Upload-Post publishing.
    • Added Azerbaijani WebUI localization and updated translations for the new settings and prompts.

    Fixes and Improvements

    • Improved subtitle animation rendering, including synchronized scaling of subtitle images and transparency masks to avoid black outlines when subtitles appear.
    • Hardened Kokoro voice discovery and audio handling: retain the selected voice when the service is unavailable and validate generated audio before replacing existing files.
    • Added pause-tag validation and improved multi-segment narration/subtitle synchronization; invalid speech chunks now stop generation rather than silently producing incomplete narration.
    • Handled non-finite voice rates such as NaN and infinity more safely.
    • Fixed the WebUI launch script's port check when the project path contains spaces, and corrected imports and repository paths in the Colab notebook.
    • Added periodic log messages while FFmpeg concatenation is running, making long-running processing easier to diagnose.
    • Extended material cache cleanup to reclaim temporary files left behind by interrupted writes.
    • Updated the agent helper to support openai_image and recognize claude_code as a keyless LLM provider.
    • Synced the documented Edge TTS voice list with the built-in catalog and clarified where to find the Windows one-click package in release Assets.

    Usage and Upgrade Notes

    • Subtitle defaults remain sentence display with no animation. Word-by-word timing works best with Azure TTS V1 (Edge TTS) or Whisper; providers without word-level timestamps may display phrases or whole sentences instead.
    • Script pause tags are supported only with Azure TTS V1 (Edge TTS), with individual pauses from 0.1 to 10 seconds.
    • Kokoro requires a separately running compatible TTS service. Claude Code requires its CLI and subscription authentication; selecting either provider does not install or authenticate the underlying service automatically.
    • The YouTube audience setting is an explicit user declaration, not automatic content classification. It defaults to not made for kids; review the setting before uploading.
    • Batch material allocation reduces reuse within a single task; it does not guarantee unique footage when there are too few source clips and does not change paid AI material providers' allocation behavior.

    What's Changed

  5. v1.3.62026-09-02 · 2026-09-02 14:02 UTC
    查看更新说明

    English | 中文

    • Added native Volcano Engine Ark Seedance video generation for generating source clips directly from script segments.
    • Added OFox multi-model text-to-video support, allowing Seedance, Wan, and other models to share one API key.
    • Added Metaso MiniMax H3 text-to-video support with 768P/2K output, 4–15 second clips, and 9:16, 16:9, and 1:1 aspect ratios.
    • Added an OpenAI-compatible text-to-image material source for cloud relays and local gateways.
    • Added OpenRouter and APIMart as OpenAI-compatible LLM providers.
    • Added a WebUI Auto-Publish settings tab for Upload-Post, with clearer API key and account setup guidance.
    • Added CLI batch manifest mode and applied saved WebUI settings as CLI defaults when command-line values are omitted.
    • Added configurable source clip fit modes: cover fills the frame by cropping excess edges, while contain preserves the complete source with letterboxing.
    • Added complete French and Korean WebUI translations.
    • Reorganized material source settings, grouped video sources by capability, and centralized AI video provider credentials in the WebUI settings.

    Security

    • Restricted browser cross-origin API access to same-origin requests by default. Trusted standalone browser frontends can be enabled explicitly with CORS_ALLOWED_ORIGINS.
    • Added provenance and SBOM attestations to published container images.

    Fixes and Improvements

    • Measured narration duration from the generated audio file instead of relying only on subtitle cues.
    • Anchored the SiliconFlow subtitle timeline to the complete audio duration.
    • Ensured AudioFileClip resources are closed in ElevenLabs, Chatterbox, and Fish Audio paths.
    • Prevented script cleanup from greedily removing unrelated bracketed or parenthesized text.
    • Removed a misleading retry warning after the final LLM attempt.
    • Fixed Redis URLs when no password is configured.
    • Preserved log records when the project root and log destination are on different mounts.
    • Fixed Unicode console output after successful CLI generation on Windows.
    • Added safe, portable download filenames, including RFC-compatible quoting and protection from Windows-reserved names.
    • Improved WebUI preview behavior on headless servers by falling back to browser playback and download.
    • Decoupled Upload-Post configuration from automatic publishing so settings can be saved without enabling uploads.
    • Hardened OpenAI-compatible image handling: malformed 200 responses now skip only the affected keyword, while local storage failures stop further paid requests.

    Upgrade Notes

    • Browser API access now defaults to same-origin requests. Standalone web frontends must declare their trusted origins through CORS_ALLOWED_ORIGINS; server-side clients such as curl, Postman, and n8n are unaffected.
    • CLI commands now inherit saved WebUI settings for omitted options. Explicit CLI arguments and batch manifest values still take precedence.

    What's Changed

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    MoneyPrinterTurbo 💸

    一站式 AI 短视频生成工具

    只需提供视频主题或关键词,即可自动生成视频脚本、匹配素材、生成字幕和背景音乐,并合成高清短视频。

    Version Platform Python Downloads

    简体中文 | English | 日本語 | 版本发布 | 问题反馈

    界面预览 🖥️


    特别感谢 ❤️

    感谢 Kimi 赞助本项目!Kimi K3.1 Pro 是 Moonshot AI 迄今能力最强的 3T 级开放权重模型,拥有原生视觉能力与 100 万 Token 上下文,在知识工作、推理和长周期任务中展现前沿性能。在 MoneyPrinterTurbo 中,K3.1 Pro 能直接驱动视频创作,不仅撰写视频文案,还会提炼素材搜索关键词、决定成片画面;对内容理解越准确,匹配到的素材就越贴题。

    MoneyPrinterTurbo 用户专属优惠:新用户通过专属链接注册,首次成功充值可获充值金额 10% 的 API 额度。活动截至 2026 年 12 月 31 日。前往 Kimi 开放平台(中文站|Global)体验 API。

    作者的另一个开源项目:MangoDisk ⭐


    功能特性 🎯

    创作入口与工作流

    • 提供 AI Agent、WebUI、API 和 CLI 四种使用方式,既能快速上手,也能接入自动化流程
    • 从主题自动完成脚本、配音、素材、字幕、配乐和剪辑,也支持在每个环节使用自定义内容
    • 支持 批量生成多条成片、任务历史记录,以及生成设置与 API Key 的导入、导出和恢复

    脚本与模型服务

    视频与图片素材

    • 支持上传自己的 本地图片和视频,也可从 Pexels(免费)、Pixabay(免费) 和 Coverr 获取高清库存素材
    • 支持 秘塔 MiniMax H3 文生视频,可生成 768P/2K、4~15 秒的原始素材,并适配 9:16、16:9 和 1:1 三种画幅
    • 支持 胜算云 AI 视频,可生成多段 AI 视频素材,并沿用项目的配音、字幕和剪辑流程合成成片
    • 原生接入 火山引擎方舟 Seedance,可根据脚本片段生成连贯的视频画面
    • 支持 WaveSpeed AI 文生视频,可根据脚本关键词快速生成原创素材
    • 支持 OFox 多模型文生视频,一个 API Key 即可调用 Seedance、Wan 等模型
    • 通过异步 MuAPI 文生视频接口生成 3~12 秒 AI 视频素材,并支持配置 Endpoint、画幅、分辨率和轮询参数
    • 支持 OpenAI 兼容文生图,可连接云端服务或自定义图片网关,并将生成图片转换为动态视频片段
    • 支持调整片段时长、画面适配方式和素材匹配顺序,以适配不同画幅和叙事节奏

    配音、字幕与配乐

    • 支持自动配音、上传配音和无配音三种方式,并提供音色试听与完整配音预览
    • 集成 Edge TTS(免费、无需 API Key)、Azure Speech、SiliconFlow、Google Gemini、小米 MiMo、MiniMax、ElevenLabs、Chatterbox、Kokoro、Fish Audio 和 ModelBest VoxCPM 等配音服务
    • 支持自动生成字幕,可调整字体、位置、颜色、大小、描边和背景样式
    • 支持随机、本地及 AI 生成背景音乐,并可独立控制音量

    成片与发布

    • 支持竖屏 9:16(1080×1920)、横屏 16:9(1920×1080) 和方形 1:1(1080×1080)
    • 支持一键 跨平台发布,生成完成后可自动上传至 TikTok、Instagram 和 YouTube Shorts

    作品展示 🎬

    以下示例均由 MoneyPrinterTurbo 实际生成。

    竖屏 9:16

    横屏 16:9

    配置要求 📦

    • 建议系统:Windows 10、macOS 11.0 或更高版本,以及主流 Linux 发行版
    • 本地部署需要 Python 3.11 或更高版本,推荐使用 Python 3.11
    • GPU 不是必需项,但如果你希望本地转录、更快的视频处理或更顺畅的批量生成体验,建议使用带显存的独立显卡
    项目最低配置推荐配置理想配置
    CPU4 核6 到 8 核8 核及以上
    RAM4 GB8 GB16 GB 及以上
    GPU非必须4 GB 显存及以上8 GB 显存及以上
    • 如果你主要依赖云端 LLM、云端 TTS 和在线素材源,CPU 与内存比 GPU 更重要
    • 如果你启用 faster-whisper、批量生成或更重的本地处理链路,GPU 会明显提升速度

    快速开始 🚀

    推荐使用方式

    • 不想手动安装和配置:直接使用 AI Agent 生成视频
    • 已有 Python 环境,想直接安装使用:通过 pip 安装官方包
    • Windows 用户:优先使用一键启动包,适合快速体验
    • 需要源码部署或二次开发:使用 uv 管理环境和依赖
    • 想要隔离运行环境:优先使用 Docker 部署

    使用 AI Agent 生成视频

    如果你的 AI Agent 支持读取 Skill 文档并操作本地终端,可以直接发送下面这段话。Agent 会自动完成安装、配置和视频生成;只有缺少必要的 API Key 时才会向你询问,完成后会返回生成的视频文件路径。目前支持 macOS 和 Windows。

    使用这个 Skill:https://raw.githubusercontent.com/harry0703/MoneyPrinterTurbo/main/docs/skill/SKILL.md
    帮我生成一个主题为“人工智能如何改变普通人的日常生活”的视频。
    

    在 Google Colab 中运行

    免去本地环境配置,点击直接在 Google Colab 中快速体验 MoneyPrinterTurbo

    Open in Colab

    Windows 一键启动包

    下载一键启动包,解压直接使用(路径不要有 中文、特殊字符、空格)

    请在页面下方的 Assets 区域下载 .7z 压缩包。GitHub 自动生成的 Source code (zip) / Source code (tar.gz) 只是源码,解压后只有 webui.bat, 不含 start.bat 和 update.bat。

    下载后,建议先双击执行 update.bat 更新到最新代码,然后双击 start.bat 启动

    启动后,会自动打开浏览器(如果打开是空白,建议换成 Chrome 或者 Edge 打开)

    安装部署 📥

    通过 pip 安装官方包

    官方 PyPI 包名为 mpt,由 harry0703 维护。 PyPI 上名为 MoneyPrinterTurbo 的包由第三方维护。

    无需克隆仓库,需要 Python 3.11 或更高版本,推荐使用 Python 3.11。

    ① 创建并激活虚拟环境

    macOS / Linux:

    python3 -m venv .venv
    source .venv/bin/activate
    

    Windows PowerShell:

    python -m venv .venv
    .venv\Scripts\Activate.ps1
    

    ② 安装并启动

    python -m pip install mpt
    mpt webui
    

    WebUI 会自动打开浏览器。指定端口且不自动打开浏览器时,运行 mpt webui --port 8503 --headless;使用 CLI 生成视频前,可查看 mpt cli --help。

    ③ 配置服务与管理文件

    首次启动会自动创建 config.toml。使用在线模型、素材或语音服务前,请在 WebUI 基础设置中填写相应的 API Key。安装版默认将配置和生成文件保存在:

    系统数据目录
    macOS~/Library/Application Support/MoneyPrinterTurbo
    Windows%LOCALAPPDATA%\MoneyPrinterTurbo
    Linux~/.local/share/MoneyPrinterTurbo,或 $XDG_DATA_HOME/MoneyPrinterTurbo

    可在启动前设置 MPT_HOME 更改目录,生成的视频位于其中的 storage/tasks 下。 后续升级时,在已激活的虚拟环境中运行 python -m pip install --upgrade mpt。

    源码部署前提条件

    • 本地部署需要 Python 3.11 或更高版本
    • Windows 用户建议避免使用包含中文、特殊字符或空格的项目路径
    ① 克隆代码
    git clone https://github.com/harry0703/MoneyPrinterTurbo.git
    
    ② 首次配置

    首次启动时,项目会根据 config.example.toml 自动创建 config.toml,无需手动创建配置文件。使用云端大模型、在线素材或 AI 视频等服务前,请在 WebUI 的基础设置中填写对应的 API Key。

    Docker 部署 🐳

    ① 启动 Docker

    如果尚未安装 Docker,请先下载并安装 Docker Desktop。

    Windows 用户可以参考微软的文档:

    1. 安装 WSL
    2. 在 WSL 中使用 Docker 容器
    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

    API 默认仅允许同源网页访问。只有独立网页前端需要从其他来源直接调用 API 时,才应通过环境变量 CORS_ALLOWED_ORIGINS 配置可信来源,例如 http://localhost:3000,https://frontend.example.com。curl、Postman、n8n 和其他服务端调用不受 CORS 限制。

    手动部署 📦

    视频教程

    ① 创建虚拟环境

    推荐使用 uv 管理 Python 环境和依赖。项目支持 Python 3.11 或更高版本,以下示例使用 Python 3.11。

    git clone https://github.com/harry0703/MoneyPrinterTurbo.git
    cd MoneyPrinterTurbo
    uv python install 3.11
    uv sync --frozen
    

    如果你暂时不使用 uv,也可以继续使用 venv + pip

    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
    .\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
    sh webui.sh
    

    脚本会自动使用项目虚拟环境或 uv,并选择可用的本地端口。如需允许局域网内其他设备访问,可以执行:

    MPT_WEBUI_HOST=0.0.0.0 sh webui.sh
    

    启动后,会自动打开浏览器(如果打开是空白,建议换成 Chrome 或者 Edge 打开)

    ③ 启动 API 服务 🚀
    uv run python main.py
    

    如果你已经手动激活了虚拟环境,也可以直接执行:

    python main.py
    
    ④ 纯命令行方式(无浏览器)⌨️

    如果你无法使用浏览器或端口转发,可以直接在命令行生成视频。最简单的完整视频生成命令如下:

    uv run python cli.py --video-subject "人工智能如何改变日常生活"
    

    字幕样式和配音参数按以下优先级取值:命令行显式参数 > config.toml 中 [ui] 保存的 WebUI 设置 > 内置默认值。其余生成设置(如背景音乐、视频数量、 段落数量等)不会自动沿用 WebUI 的保存值。若 WebUI 中选择了上传自备音频, 命令行需要显式传入 --custom-audio-file,因为音频路径不会被保存。

    如需查看完整命令、参数说明和使用方法,可以执行:

    uv run python cli.py --help
    

    如需顺序执行多个任务,可通过 --batch-file 提供 UTF-8 JSON 数组或 JSONL 清单。CLI 参数作为全局默认值,每个对象可覆盖 VideoParams 字段:

    uv run python cli.py --batch-file ./tasks.json --stop-at video
    

    清单最多包含 100 个任务且不超过 1 MiB。所有条目会在第一个任务启动前完成 参数与本地文件预检;单个任务运行失败不会阻止后续条目,结束后会输出统一的 JSON 汇总。清单中的相对自定义音频与本地素材路径以清单目录为基准。

    配音、字幕与配乐 🎙️

    语音合成

    WebUI 中的 Azure TTS V1 基于 Edge TTS,免费且无需 API Key。项目同时支持 Azure TTS V2、SiliconFlow TTS、Google Gemini TTS、小米 MiMo TTS、MiniMax TTS、ElevenLabs TTS、自托管 Chatterbox TTS、自托管 Kokoro TTS、Fish Audio TTS、ModelBest VoxCPM TTS,以及无配音模式。

    可直接在 WebUI 中选择 Provider 和音色,并按照界面提示填写所需凭据。Edge TTS 不需要 API Key;Azure TTS V2 及其他云端服务需要对应平台的凭据。Edge TTS 音色可查看:音色列表。

    ModelBest VoxCPM 需要填写 API Key 和支持 speech_synthesis 的模型 ID。服务以 SSE 返回 WAV 音频,项目会自动转换为视频流水线使用的 MP3。除了普通文本合成,还可以上传参考音频复刻说话人音色;开启“保留参考音频的节奏与情绪”后,默认复用这段音频并要求填写其准确逐字稿,也可另选一段节奏与情绪示范,通过 prompt_audio 和 prompt_text 延续演绎。WebUI 可使用本地 Whisper 自动生成可编辑的逐字稿草稿。上传文件最大 20 MiB,转换后的单个 WAV 最大 5 MiB。参考素材仅用于当前浏览器会话和任务,不写入配置、预设、任务历史或日志。

    字幕生成

    当前支持两种字幕生成方式:

    • edge:使用 TTS 时间戳生成字幕,速度快,不需要 GPU,默认使用该模式。
    • whisper:使用本地 faster-whisper 转写音频,适用于需要更准确字幕时间轴的场景。首次使用时需要下载模型。

    在 config.toml 中修改 subtitle_provider 即可切换模式。Whisper 默认使用约 3 GB 的 large-v3;如需更小、更快的模型,可以使用约 1.6 GB 的 large-v3-turbo:

    [app]
    subtitle_provider = "whisper"
    
    [whisper]
    model_size = "large-v3-turbo"
    

    首次使用 Whisper 时,程序会自动从 Hugging Face 下载模型。如果当前网络无法自动下载,可以从 Hugging Face 手动下载 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 目录下,你也可以放进去自己的字体。

    常见问题 🤔

    通常情况下,ffmpeg 会被自动下载,并且会被自动检测到。 但是如果你的环境有问题,无法自动下载,可能会遇到如下错误:

    RuntimeError: No ffmpeg exe could be found.
    Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable.
    

    此时可以从 gyan.dev 下载 FFmpeg。解压后,将 ffmpeg_path 设置为实际安装路径即可。

    [app]
    # 请根据你的实际路径设置,注意 Windows 路径分隔符为 \\
    ffmpeg_path = "C:\\Users\\harry\\Downloads\\ffmpeg.exe"
    

    这个问题是由于系统打开文件数限制导致的,可以通过修改系统的文件打开数限制来解决。

    查看当前限制

    ulimit -n
    

    如果过低,可以调高一些,比如

    ulimit -n 10240
    
    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 手动下载模型

    反馈建议 📢

    许可证 📝

    点击查看 LICENSE 文件