Skip to content

Conversation

@yashwantbezawada
Copy link
Contributor

What does this PR do?

Fixes #12606

This PR corrects the import path for load_model_dict_into_meta in 6 conversion scripts that were importing from the wrong module.

Problem

The function load_model_dict_into_meta exists in diffusers/models/model_loading_utils.py but the conversion scripts were importing it from diffusers/models/modeling_utils.py (where it doesn't exist), causing ImportError when running these scripts.

Solution

Updated the import statement in the following conversion scripts:

  • scripts/convert_sd3_to_diffusers.py
  • scripts/convert_stable_cascade_lite.py
  • scripts/convert_stable_cascade.py
  • scripts/convert_stable_audio.py
  • scripts/convert_sana_to_diffusers.py
  • scripts/convert_sana_controlnet_to_diffusers.py

Changed from:

from diffusers.models.modeling_utils import load_model_dict_into_meta

To:

from diffusers.models.model_loading_utils import load_model_dict_into_meta

Testing

While I discovered this issue was present in 6 scripts (not just the SD3 script mentioned in the issue), the fix is straightforward - it's simply correcting the import path to match where the function actually exists.

…scripts

The function load_model_dict_into_meta was moved from modeling_utils.py to
model_loading_utils.py but the imports in the conversion scripts were not
updated, causing ImportError when running these scripts.

This fixes the import in 6 conversion scripts:
- scripts/convert_sd3_to_diffusers.py
- scripts/convert_stable_cascade_lite.py
- scripts/convert_stable_cascade.py
- scripts/convert_stable_audio.py
- scripts/convert_sana_to_diffusers.py
- scripts/convert_sana_controlnet_to_diffusers.py

Fixes huggingface#12606
@DN6 DN6 merged commit 0fd58c7 into huggingface:main Nov 10, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong import of scripts/convert_sd3_to_diffusers.py

2 participants