开源项目解析
musubi-tuner
视频模型的 LoRA 训练器。同一套代码训 Wan 2.1/2.2、HunyuanVideo、FramePack、Qwen-Image 等多条线。
许可证附加条件:仓库根目录没有 LICENSE 文件;README 声明大部分代码 Apache-2.0,hunyuan_model 等目录随上游许可
读懂层
2 张 · 架构图 / 流程图
DeepWiki 架构页 · 抓取 2026-08-16 · 核验 2026-08-16
DeepWiki 架构页 · 抓取 2026-08-16 · 核验 2026-08-16
每个底座一组脚本(`wan_*` / `hv_*` / `fpack_*` …),都汇到 `library/train_util.py` 与 `networks/lora.py`。省显存靠两招:把 DiT 的块在 CPU 与 GPU 之间轮换(BlockSwapConfig),以及先把 VAE 隐变量与文本编码结果缓存到磁盘(cache_latents.py)。
它管哪几个决定
自持能力
本地训练,产出是 LoRA 文件;底座换一个就换一组脚本
动手层
装它要过哪几关
- 1装 torch按显卡选 cu124 / cu128 / cu130 三条源之一
- 2`pip install -e .`另外还要 `pip install ascii-magic matplotlib tensorboard prompt-toolkit`
- 3配 accelerate问到「只用 CPU 吗」要答 NO —— 答错了训练会静悄悄跑在 CPU 上
改哪个文件能改什么
wan_train_network.py 等一个底座一个入口脚本。要训哪个模型就跑哪个library/train_util.py训练主循环与通用参数。所有底座共用这一份cache_latents.py隐变量预缓存。显存不够时这一步是必跑的坑在哪一处
带 issue 编号的来自:github issues 按回复数排序 · 核验 2026-08-16
教程
官方文档、作者本人的视频,以及 ComfyUI 官方给的原生工作流示例。每条都验过还打得开。
项目自述
以下是仓库 README 的开头部分(原文引用,抓取 2026-08-17)。读全文 ↗
Musubi Tuner
English | 日本語
Table of Contents
Click to expand
- Musubi Tuner
- Table of Contents
- Introduction
- Sponsors
- Support the Project
- Recent Updates
- Releases
- For Developers Using AI Coding Agents
- Overview
- Hardware Requirements
- Features
- Documentation
- Installation
- pip based installation
- Windows on ARM64
- uv based installation
- Linux/MacOS
- Windows
- Model Download
- Usage
- Dataset Configuration
- Pre-caching and Training
- Configuration of Accelerate
- Training and Inference
- Miscellaneous
- SageAttention Installation
- PyTorch version
- Disclaimer
- Contributing
- License
Introduction
This repository provides scripts for training LoRA (Low-Rank Adaptation) models with HunyuanVideo, Wan2.1/2.2, FramePack, FLUX.1 Kontext, FLUX.2 dev/klein, Qwen-Image, Z-Image, and MiniMax-H3 architectures.
This repository is unofficial and not affiliated with the official repositories of these architectures.
*This repository is under development.*
Sponsors
We are grateful to the following companies for their generous sponsorship:
Support the Project
If you find this project helpful, please consider supporting its development via GitHub Sponsors. Your support is greatly appreciated!
Recent Updates
GitHub Discussions Enabled: We've enabled GitHub Discussions for community Q&A, knowledge sharing, and technical information exchange. Please use Issues for bug reports and feature requests, and Discussions for questions and sharing experiences. Join the conversation →
- September 27, 2026
- Updated the dependencies in pyproject.toml: transformers 4.57.6 -> 5.17.0, diffusers 0.32.1 -> 0.40.0, accelerate 1.6.0 -> 1.15.0, huggingface-hub 0.34.3 -> 1.32.0. PR #1139
- This is mainly a security maintenance update (the 4.x line of transformers and diffusers < 0.38 no longer receive fixes). The previous versions of the libraries still work with this release, so you do not have to update them immediately, but it is recommended to run pip install -e . again in your environment at your earliest convenience.
- diffusers 0.40 requires PyTorch 2.6 or later, so PyTorch 2.6.0 or later is now required.
- transformers 5.6 changed the internal structure of CLIPTextModel, and in 5.x CLIPTokenizer no longer applies the ftfy text normalization of the original CLIP tokenizer (straightening curly quotes, converting full-width characters, etc.). Musubi Tuner handles both, so loading CLIP-L checkpoints and the text encoder outputs of HunyuanVideo, FramePack, FLUX.1 Kontext and Kandinsky 5 are unchanged from previous versions.
- transformers 5.6 switched the attention implementation of T5 (T5-XXL of FLUX.1 Kontext, byT5 of HunyuanVideo 1.5) to SDPA, which is faster and uses less memory. The bf16/fp16 outputs of T5 differ very slightly from previous versions (the accuracy against fp32 is the same). This may change generated images or trained weights in minor details; cached text encoder outputs from previous versions are still usable. The outputs of the other text encoders are identical.
- The text encoder out
……(后略,见原文)判断
优势
- 这一格里唯一在维护的(今天还有提交)—— sd-scripts 管图,它管视频
- 一套代码覆盖 Wan、HunyuanVideo、FramePack、Qwen-Image 多个底座,不用每换一个模型换一套训练器
- 12GB 也能训图像 LoRA,靠的是块交换与预缓存,不是砍质量
- 作者就是 sd-scripts 的 kohya,参数命名与习惯一脉相承
局限
- 仓库根目录没有 LICENSE 文件 —— 只有 README 里一段说明,且各目录随上游,商用前要逐目录看
- 星数只有 1994,遇到问题能搜到的中文资料很少
- 视频训练 24GB 起,消费级里只有 3090/4090 这一档够
- OOM 是最常撞的墙(issue #46,回复 30 条)
不适用
只训图片 LoRA 的人 —— 那是 sd-scripts 的活,用这个是绕远路。
同管这些决定的其它项目
github README + GitHub API + DeepWiki 架构页 · 核验 2026-10-19 | 判断栏可报错。