local-theater-auto
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
本地图文小剧场自动化(OpenVINO / Intel 版)
Copyright 2026 MWnv1(GitHub: https://github.com/MWnv1) 个人站点:https://imworkingnow.cc.cd | https://imwn.cc.cd | https://imwn.dpdns.org 许可:Apache License 2.0(见
LICENSE、NOTICE) 版本生成时间:2026-11-07 09:31:28 +08:00(Asia/Shanghai / UTC 2026-11-07T01:31:28Z / Unix 1794015088)
剧本 → 背景与角色立绘 → 台词配音 → 镜头画面(含字幕)→ 成片,全本地离线运行, 通过 MCP 暴露给 LobeChat 分步调用。
目录结构
D:\AI_T_MCP\
├─ server.py # MCP Server(stdio),LobeChat 的入口
├─ pipeline_full.py # 流水线 + 命令行入口(也可让本地 LLM 写剧本)
├─ check_env.py # 环境自检
├─ requirements.txt
├─ README.md
├─ output\ # 成片输出
├─ cache\ # 素材/音频/帧/片段缓存(可删)
└─ theater\
├─ __init__.py # 路径与公用工具(绝对路径锚定)
├─ script_parser.py # 剧本结构化
├─ ai_draw.py # OpenVINO 绘图 + 离线抠图
├─ local_tts.py # SAPI5 离线配音
├─ frame_compose.py # 图层合成 + 字幕
└─ video_export.py # QSV/NVENC/libx264 导出Related MCP server: ShotFlow MCP Server
1. 环境
64 位 Python 3.11(强烈建议;OpenVINO/optimum-intel 官方 wheel 目前只到 3.12 左右, 本机默认的 3.14 装不上 openvino)
ffmpeg + ffprobe(建议带
h264_qsv的静态构建),把bin加进 PATH, 或设FFMPEG_PATH/FFPROBE_PATHIntel 显卡/NPU 驱动最新
cd D:\AI_T_MCP
py -3.11 -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt
python check_env.py仓库里的
.venv是本次验证时用 3.14 建的,只装了 pillow / pyttsx3,不要用它装 openvino; 正式环境请按上面的 3.11 流程重建(或直接删掉把.venv重开)。
check_env.py 里 FAIL 必须先修;WARN 可以带病运行(会自动降级并打印告警)。
2. 模型摆放(默认 D:\ai_models,用 MODEL_ROOT 可改)
用途 | 目录 | 说明 |
绘图 |
| Flux Schnell INT4 OpenVINO 预转换包 |
抠图 |
| 必须预置,否则不会联网下载,会降级为白底抠图 |
剧本 LLM(可选) |
| Qwen3-4B INT4 OpenVINO |
预转换包只要有 openvino_model.xml/.bin + model_index.json 之类即可;本项目
会优先用 OVFluxPipeline 加载 FLUX,旧版 optimum-intel 缺该类时回退
OVStableDiffusionPipeline。
3. 环境变量
变量 | 默认 | 作用 |
|
| 模型根目录 |
|
| 缓存根目录 |
| PATH 中 | 可执行文件绝对路径 |
|
| 绘图模型 |
|
|
|
|
| 采样步数、出图边长 |
|
| 不可用时自动回退 |
|
| QSV 的 |
|
| 回退 x264 时的 CRF |
|
| 输出规格 |
|
| 语速 |
| 空 | 发音人;映射例 |
|
| 剧本生成 |
4. 剧本格式
【镜头1】
【小林:站位:左】
【阿杰:站位:右】
小林:这个模型真能离线跑?
阿杰:4bit 的,NPU 上 30 token/s。
【镜头2】机房门口
【旁白】夜色渐深。
阿杰:走吧,明天继续调。【镜头N】后可接场景描述(会用来单独出背景)【角色:站位:左/右/居中】可省略,省略时按角色数自动分配场景:xxx会被当成镜头元信息,不会误判成台词
5. 命令行
python pipeline_full.py --script script.txt --out output\demo.mp4
python pipeline_full.py --script script.txt --steps parse :: 只看解析结果
python pipeline_full.py --requirement "两个程序员在机房聊本地AI小剧场" --out output\demo.mp46. LobeChat MCP 配置
{
"mcpServers": {
"local-theater-auto": {
"command": "python",
"args": ["D:\\AI_T_MCP\\server.py"],
"env": {
"HF_HUB_OFFLINE": "1",
"TRANSFORMERS_OFFLINE": "1",
"MODEL_ROOT": "D:\\ai_models",
"FFMPEG_PATH": "D:\\ai_tools\\ffmpeg\\bin\\ffmpeg.exe",
"FFPROBE_PATH": "D:\\ai_tools\\ffmpeg\\bin\\ffprobe.exe"
}
}
}
}7. 本机(AMD + NVIDIA)跑这套代码的真实预期
这套代码按 Intel 平台写死,在你当前机器上:
h264_qsv不存在 → 导出会自动回退libx264(慢一些,但能出片)DRAW_DEVICE=GPU指的是 Intel GPU,AMD 核显/NVIDIA 都不适用 → 绘图会报设备不可用。真要出图,需要换 CUDA/ComfyUI 后端(可用DRAW_DEVICE=CPU先跑通流程看效果,非常慢)LLM_DEVICE=NPU需要 Intel NPU → 本机没有,写剧本这步不可用;剧本文本手写或外部模型给合成、字幕、TTS(SAPI5)、拼接这几步与平台无关,可以正常跑
即:流程、解析、字幕、配音、拼片可用;绘图与 NPU 推理需要 Intel 硬件。
8. 本次已验证 / 未验证
已验证(本机实跑):
项目 | 结果 |
全部 9 个 .py 字节码编译 | 通过( |
| 3 镜头、角色 小林/阿杰;旁白不占站位、 |
| 输出 1920×1080 PNG;长句自动折 3 行 + 省略号;半透明字幕条生效(像素采样变暗);3 角色同站"居中"自动均匀铺开不重叠 |
| 7 句全部产出非 0 字节 wav(81–181KB),无"只有第一句有声音"问题 |
时长解析 | 走 |
| 中文正常输出,FAIL/WARN 分级正确;检测到 2 个发音人(Huihui / Zira) |
未验证(缺依赖/模型,非代码问题):ai_draw 绘图(无 OPENVINO + 无模型)、
video_export 实际编码(本机无 ffmpeg)、server.py 的 MCP 握手(未装 mcp 包)。
9. 许可与署名
Copyright 2026 MWnv1 (GitHub: https://github.com/MWnv1)
Websites: https://imworkingnow.cc.cd | https://imwn.cc.cd | https://imwn.dpdns.org
License: Apache License, Version 2.0 (SPDX: Apache-2.0)LICENSE:Apache-2.0 官方全文(未做任何删改)NOTICE:署名、站点、生成时间戳与第三方组件许可清单每个
.py文件头部均带SPDX-License-Identifier: Apache-2.0+ 版权/署名/站点/时间戳注释块再分发时按 Apache-2.0 第 4 条:保留 LICENSE 与 NOTICE,修改过的文件需标注"已修改"
提示:
script.txt顶部那几行#注释会被解析器自动跳过,不影响剧本解析。
This server cannot be deployed
Maintenance
Related MCP Connectors
AI comic & short-drama studio: scripts to storyboards, image/video generation on an infinite canvas
Make AI short films with your agent: script, storyboard, quoted image and video, review and export.
Make AI-drawn video from chat: your LLM draws every frame in code; add narration, music and SFX.
Direct AI video, image, music and storyboard production from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceIntegrates with Jianying (CapCut) and Chinese LLMs to automate short drama video editing, including commentary generation, remix creation, and draft import.22MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to generate professional storyboards and videos from scripts or creative descriptions via MCP-compatible clients.36 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that turns drama scripts into storyboard shots and generates videos for each shot using Zhipu CogVideoX, returning timed download URLs. It can be integrated with MCP-compatible agents like LangChain, Dify, Cline, and Cherry Studio.MIT
- AlicenseBqualityBmaintenanceEnables AI agents to take a raw script all the way to a finished, downloadable short-drama .mp4, covering AI rewrite, character consistency, storyboards, frames, video shots, TTS voiceover, and final cut with quote-before-spend billing from any MCP client.1324,749 npmMIT