Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#224 2 comments 0 reactions 0 assignees View on GitHub

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

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelscope/DiffSynth-Engine

All issues in modelscope/DiffSynth-Engine

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.