MAC Ultra pipe.load_lora raise an error "AttributeError: QwenImageDiT has no attribute `diffusion_model`"
还没有人认领这个 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
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelscope/DiffSynth-Engine 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
modelscope/DiffSynth-Engine#266 ·
-
难度 5/5 一周以上 新手友好度 25/100
modelscope/DiffSynth-Engine#238 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
modelscope/DiffSynth-Engine#235 ·
-
难度 3/5 1-2 天 新手友好度 32/100
modelscope/DiffSynth-Engine#223 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 55/100
modelscope/DiffSynth-Engine#221 ·
查看 modelscope/DiffSynth-Engine 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 70/100
huggingface/Repo2RLEnv#163 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
难度 2/5 1-3 小时 新手友好度 70/100
NousResearch/hermes-agent#121143 ·