Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

MAC Ultra pipe.load_lora raise an error "AttributeError: QwenImageDiT has no attribute `diffusion_model`"

未关闭
#224 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python, pytorch

调研方向

Start at pipe.load_lora in pipelines/base.py and follow the Qwen-specific path in pipelines/qwen_image.py into models/base.py. Inspect how the LoRA key reaches torch.nn.Module.get_submodule and compare it with the QwenImageDiT structure shown by the error. Done means the provided Qwen Image 2512 LoRA-loading example no longer raises the AttributeError on the reported setup.

由索引模型根据 Issue 内容生成。

描述

diffsynth-engine==0.6.0

source code

import gradio as gr
from diffsynth_engine import fetch_model, QwenImagePipeline, QwenImagePipelineConfig

import torch

model_name = "Qwen/Qwen-Image-2512/"
device = "mps" # Mac 使用 MPS (Metal Performance Shaders)
torch_dtype = torch.bfloat16

print("Loading model...")

transformer_files = [f'Qwen/Qwen-Image-2512/transformer/diffusion_pytorch_model-0000{x}-of-00009.safetensors' for x in range(1,10)]
encoder_files = [f'Qwen/Qwen-Image-2512/text_encoder/model-0000{x}-of-00004.safetensors' for x in range(1,5)]
vae_files = [f'Qwen/Qwen-Image-2512/vae/diffusion_pytorch_model.safetensors']
config = QwenImagePipelineConfig.basic_config(
model_path = transformer_files,
encoder_path= encoder_files,
vae_path= vae_files,
offload_mode="cpu_offload",
device = device,
)
pipe = QwenImagePipeline.from_pretrained(
config,
)
lora_file = 'Qwen-Image-2512-Turbo-LoRA/Wuli-Qwen-Image-2512-Turbo-LoRA-4steps-V1.0-bf16.safetensors'
pipe.load_lora(
path=lora_file,
scale=1.0,
fused=True,
)
........

Error

File "/Users/abc/models/main.py", line 35, in
pipe.load_lora(
File "/opt/anaconda3/lib/python3.12/site-packages/diffsynth_engine/pipelines/base.py", line 79, in load_lora
self.load_loras([(path, scale)], fused, save_original_weight)
File "/opt/anaconda3/lib/python3.12/site-packages/diffsynth_engine/pipelines/qwen_image.py", line 269, in load_loras
super().load_loras(lora_list, fused, save_original_weight)
File "/opt/anaconda3/lib/python3.12/site-packages/diffsynth_engine/pipelines/base.py", line 76, in load_loras
model.load_loras(lora_args, fused=fused)
File "/opt/anaconda3/lib/python3.12/site-packages/diffsynth_engine/models/base.py", line 44, in load_loras
module = self.get_submodule(key)
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/lib/python3.12/site-packages/torch/nn/modules/module.py", line 710, in get_submodule
raise AttributeError(
AttributeError: QwenImageDiT has no attribute diffusion_model

主要语言
Python
星标
432
派生
51
平均合并
3 天 5 小时
30 天内合并 PR
1

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelscope/DiffSynth-Engine 的其他 Issue

查看 modelscope/DiffSynth-Engine 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。