Skip to content

Conversation

DN6
Copy link
Collaborator

@DN6 DN6 commented Jan 3, 2024

What does this PR do?

Setting a pipeline component to a compiled module and then calling save_pretrained results in an incorrect model_index.json file being created for the pipeline. This is because the compiled module isn't unwrapped before registering to config.

This PR:

Moves a block of code in register_modules into a helper function that correctly unwraps the compiled module and extracts the correct library and class name. We can then apply this function everywhere that is needed to extract the library, class tuple.

So it should also handle pipeline modules like MultiControlNet.

Fixes # (issue)
#5617

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.

@DN6 DN6 changed the title update Correctly handle creating model index json files when setting compiled modules in pipelines. Jan 3, 2024
@DN6 DN6 requested a review from patrickvonplaten January 3, 2024 10:46
Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactor

@DN6 DN6 merged commit 86a2676 into main Jan 5, 2024
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
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.

2 participants