MAC Ultra pipe.load_lora raise an error "AttributeError: QwenImageDiT has no attribute `diffusion_model`"
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python, pytorch
- Domain
- machine-learning
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 432
- Forks
- 51
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelscope/DiffSynth-Engine
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
modelscope/DiffSynth-Engine#266 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
modelscope/DiffSynth-Engine#238 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
modelscope/DiffSynth-Engine#235 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 32/100
modelscope/DiffSynth-Engine#223 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
modelscope/DiffSynth-Engine#221 ·
All issues in modelscope/DiffSynth-Engine
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·