Skip to content

'super' object has no attribute '__getattr__' #12174

@White-Friday

Description

@White-Friday

Describe the bug

Installed diffusers version:

pip install -e . -i https://mirrors.aliyun.com/pypi/simple/ --no-build-isolation --timeout=500
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Obtaining file:///app/diffusers
Checking if build backend supports build_editable ... done
Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: importlib-metadata in /opt/conda/lib/python3.10/site-packages (from diffusers==0.35.0.dev0) (8.7.0)
Requirement already satisfied: filelock in /opt/conda/lib/python3.10/site-packages (from diffusers==0.35.0.dev0) (3.13.1)
Requirement already satisfied: huggingface-hub>=0.34.0 in /opt/conda/lib/python3.10/site-packages (from diffusers==0.35.0.dev0) (0.34.4)
Requirement already satisfied: numpy in /opt/conda/lib/python3.10/site-packages (from diffusers==0.35.0.dev0) (1.26.3)
Requirement already satisfied: regex!=2019.12.17 in /opt/conda/lib/python3.10/site-packages (from diffusers==0.35.0.dev0) (2025.7.34)
Requirement already satisfied: requests in /opt/conda/lib/python3.10/site-packages (from diffusers==0.35.0.dev0) (2.31.0)
Requirement already satisfied: safetensors>=0.3.1 in /opt/conda/lib/python3.10/site-packages (from diffusers==0.35.0.dev0) (0.6.2)
Requirement already satisfied: Pillow in /opt/conda/lib/python3.10/site-packages (from diffusers==0.35.0.dev0) (10.0.1)
Requirement already satisfied: fsspec>=2023.5.0 in /opt/conda/lib/python3.10/site-packages (from huggingface-hub>=0.34.0->diffusers==0.35.0.dev0) (2023.12.2)
Requirement already satisfied: packaging>=20.9 in /opt/conda/lib/python3.10/site-packages (from huggingface-hub>=0.34.0->diffusers==0.35.0.dev0) (23.1)
Requirement already satisfied: pyyaml>=5.1 in /opt/conda/lib/python3.10/site-packages (from huggingface-hub>=0.34.0->diffusers==0.35.0.dev0) (6.0.1)
Requirement already satisfied: tqdm>=4.42.1 in /opt/conda/lib/python3.10/site-packages (from huggingface-hub>=0.34.0->diffusers==0.35.0.dev0) (4.65.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /opt/conda/lib/python3.10/site-packages (from huggingface-hub>=0.34.0->diffusers==0.35.0.dev0) (4.14.1)
Requirement already satisfied: hf-xet<2.0.0,>=1.1.3 in /opt/conda/lib/python3.10/site-packages (from huggingface-hub>=0.34.0->diffusers==0.35.0.dev0) (1.1.7)
Requirement already satisfied: zipp>=3.20 in /opt/conda/lib/python3.10/site-packages (from importlib-metadata->diffusers==0.35.0.dev0) (3.23.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/lib/python3.10/site-packages (from requests->diffusers==0.35.0.dev0) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.10/site-packages (from requests->diffusers==0.35.0.dev0) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/lib/python3.10/site-packages (from requests->diffusers==0.35.0.dev0) (1.26.18)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.10/site-packages (from requests->diffusers==0.35.0.dev0) (2023.11.17)
Building wheels for collected packages: diffusers
Building editable for diffusers (pyproject.toml) ... done
Created wheel for diffusers: filename=diffusers-0.35.0.dev0-0.editable-py3-none-any.whl size=11246 sha256=09acf61b8d01f320e723cdbc945837620b06c9e15ba2838808fd5c36acbd5d26
Stored in directory: /tmp/pip-ephem-wheel-cache-r2rv4hva/wheels/3b/f2/4c/79e732ce61cd1eb100b117de97260cf70fe5edc2ebea9674fe
Successfully built diffusers
Installing collected packages: diffusers
Successfully installed diffusers-0.35.0.dev0

The error is as follows:

Traceback (most recent call last):
File "/app/generate_with_diffusers.py", line 171, in
main(
File "/app/generate_with_diffusers.py", line 99, in main
pipe = DiffusionPipeline.from_pretrained(
File "/opt/conda/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/app/diffusers/src/diffusers/pipelines/pipeline_utils.py", line 927, in from_pretrained
expected_types = pipeline_class._get_signature_types()
File "/app/diffusers/src/diffusers/utils/import_utils.py", line 644, in getattr
return super().getattr(cls, key)
AttributeError: 'super' object has no attribute 'getattr'. Did you mean: 'setattr'?

Reproduction

if lora_path is not None:
model = QwenImageTransformer2DModel.from_pretrained(
model_name, subfolder="transformer", torch_dtype=torch_dtype
)
assert os.path.exists(lora_path), f"Lora path {lora_path} does not exist"
model = load_and_merge_lora_weight_from_safetensors(model, lora_path)
scheduler_config = {
"base_image_seq_len": 256,
"base_shift": math.log(3), # We use shift=3 in distillation
"invert_sigmas": False,
"max_image_seq_len": 8192,
"max_shift": math.log(3), # We use shift=3 in distillation
"num_train_timesteps": 1000,
"shift": 1.0,
"shift_terminal": None, # set shift_terminal to None
"stochastic_sampling": False,
"time_shift_type": "exponential",
"use_beta_sigmas": False,
"use_dynamic_shifting": True,
"use_exponential_sigmas": False,
"use_karras_sigmas": False,
}
scheduler = FlowMatchEulerDiscreteScheduler.from_config(scheduler_config)
pipe = DiffusionPipeline.from_pretrained(
model_name, transformer=model, scheduler=scheduler, torch_dtype=torch_dtype
)
else:
pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)

Logs

System Info

As above

Who can help?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions