开源项目解析
DiffSynth-Studio
魔搭扩散模型工程框架,覆盖图像、视频、音乐推理与训练;近期加入 FLUX.3、MOSS-Image 与 OPD 蒸馏加速训练。
读懂层
2 张 · 工程图 / 流程图
DeepWiki 架构页 · 抓取 2026-08-16 · 核验 2026-08-16
DeepWiki 架构页 · 抓取 2026-08-16 · 核验 2026-08-16
`Pipeline.from_pretrained()` 按 ModelConfig 拉模型进 ModelPool,推理时按需 `load_models_to_device()` 逐段搬运,用完即卸。各家模型(WanModel、FluxDiT、QwenImageDiT、AceStepDiT…)实现在 `diffsynth/models/`,管线在 `diffsynth/pipelines/`,训练在 `diffsynth/training/`。同时支持 CUDA 与昇腾 NPU。
它管哪几个决定
自持能力
本地权重,seed 是 pipe() 的参数;换模型改 ModelConfig 一处
动手层
装它要过哪几关
- 1`pip install -e .`非 NVIDIA 卡(含昇腾)另看官方 Setup 文档
- 2选模型先去 `docs/*/Model_Details/` 找对应那一篇 —— 每个模型的显存与参数都写在各自的文档里
- 3跑示例`examples/` 下按模型分目录,照着改比从头写快
改哪个文件能改什么
diffsynth/pipelines/各家模型的管线。要看一次生成怎么走,从这里进diffsynth/models/模型结构实现(WanModel、FluxDiT、AceStepDiT…)docs/*/Pipeline_Usage/VRAM_management.md显存管理。6GB 跑大模型的开关都在这一篇坑在哪一处
带 issue 编号的来自:github issues 按回复数排序 · 核验 2026-08-16
教程
官方文档、作者本人的视频,以及 ComfyUI 官方给的原生工作流示例。每条都验过还打得开。
项目自述
以下是仓库 README 的开头部分(原文引用,抓取 2026-08-17)。读全文 ↗
DiffSynth-Studio 切换到中文版 Introduction Welcome to the magical world of Diffusion models! DiffSynth-Studio is an open-source Diffusion model engine developed and maintained by the ModelScope Community team. We hope to foster technological innovation through framework construction, aggregate the power of the open-source community, and explore the rich capabilities of generative model technology! Framework features: * Model Support: The framework integrates mainstream open-source Diffusion models, covering image generation, video generation, audio generation, and image quality metrics models. * VRAM Management: Dynamically schedules model parameters across disk, memory, and VRAM, allowing consumer-grade GPUs with low VRAM to run inference with large models. * Parameter Quantization: Converts model parameters to quantized precisions such as NF4 and INT8, significantly reducing the VRAM requirements of model inference and LoRA training. * Arbitrary Training: Almost every model that supports inference also supports training, whether base models, LoRAs, or any Adapter models with additional inputs. * Split Training: Uses a computational graph inference engine to track every variable in the Pipeline, splitting the training process into two stages for efficient training. References: * Developer documentation (for humans): 中文版、English version * Agent Skills (for AI): DiffSynth-Studio Model Integration Skills See also: * DiffSynth-ComfyUI: A ComfyUI node package built on DiffSynth-Studio, enabling you to build workflows in ComfyUI to run model inference. * DiffSynth-WebUI: A lightweight LoRA training tool built on DiffSynth-Studio, enabling LoRA training of models on consumer-grade GPUs. * ModelScope AIGC Zone (for Chinese users): Productized features powered by DiffSynth-Studio as the core inference and training engine; experience the rich potential of the open-source model ecosystem. * ModelScope Civision (for global users): Unlock the vast potential of the open-source model ecosystem through productized capabilities powered by DiffSynth-Studio. Update History > DiffSynth-Studio has undergone major version updates, and some old features are no longer maintained. If you need to use old features, please switch to the last historical version before the major version update. > Currently, the development personnel of this project are limited, with most of the work handled by Artiprocher and mi804. Therefore, the progress of new feature development will be relatively slow, and the speed of responding to and resolving issues is limited. We apologize for this and ask developers to understand. - October 16, 2026 flux-3-image-klein open-sourced, welcome a new member to the image model family! Support includes text-to-image generation, multi-reference editing, layout control, low VRAM inference, and Base training capabilities. For details, please refer to the documentation and example code. We quantized the model with EntroPack, providing pre-quantized models in 3-bit, 4-bit, and 6-bit versions at DiffSynth-Studio/flux-3-image-klein-entropack. - October 12, 2026 We now support distillation accelerated training based on OPD (On-Policy Distillation), w ……(后略,见原文)
判断
优势
- 写代码的底座:不想连线的人在这里三行出片,`seed=42` 直接是参数
- 一个框架覆盖图、视频、音乐多条线,换模型不换框架
- 显存管理做到层级与磁盘卸载 —— 官方举例 HunyuanVideo 能从 24GB 压到 6GB
- 魔搭官方在维护,今天还有提交;Apache-2.0
局限
- 要写 Python —— 不接受这一点的人应该去用 ComfyUI
- 覆盖面广带来的代价是坑分散:训练侧 OOM、DeepSpeed 张量形状不一致这类 issue 长期开着(#532、#687)
- 文档按模型分散在 `docs/` 下几十个文件里,没有一条主线
- 新模型支持来得快,但也意味着接口变动频繁
不适用
完全不写代码的人 —— 它的入口就是 Python API,没有图形界面这一层。
同管这些决定的其它项目
github README + GitHub API + LICENSE 原文 + DeepWiki 架构页 · 核验 2026-10-19 | 判断栏可报错。