Skip to content

Ensure consistent dynamic module path for custom components#13459

Open
neo wants to merge 1 commit intohuggingface:mainfrom
neo:consistent-custom-submodule-path
Open

Ensure consistent dynamic module path for custom components#13459
neo wants to merge 1 commit intohuggingface:mainfrom
neo:consistent-custom-submodule-path

Conversation

@neo
Copy link
Copy Markdown

@neo neo commented Apr 13, 2026

What does this PR do?

Currently the behaviour/final module path of the are different in the following way:

  • if it's a standalone custom AutoModel, the dynamic module is being loaded directly from the hub into diffusers_modules.local.org--repo.hash.file.class
  • however if it's a custom component from a pipeline, hub files were already downloaded and cached from previous loading, and it's being passed as a "local dir", thus the dynamic module becomes diffusers_modules.local.file.class

This proposed change is to unify the second behaviour to be consistent with the first one where if it's being loaded from a local dir that's known to be a hub download cache; and as a bonus, it's more self contained and less likely to collide with other custom modules with the same file name sharing in the same local diffusers_modules.root folder/module

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@github-actions github-actions bot added utils size/S PR with diff < 50 LOC labels Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S PR with diff < 50 LOC utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant