Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Pipelines without unet #10440

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

hlky
Copy link
Collaborator

@hlky hlky commented Jan 3, 2025

What does this PR do?

As in #10439 this PR guards some checks involving unet in a pipeline's __init__ that prevent it from being used without unet i.e. for text encoder only.

I'll cover default values for vae_scale_factor like in #10393 for all pipelines in another PR.

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.

@sayakpaul @yiyixuxu

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Sleek!

@hlky
Copy link
Collaborator Author

hlky commented Jan 3, 2025

Some of these checks are before register_modules and use unet, vae etc. directly, others are after register_modules and like if hasattr(self, "unet") and self.unet is not None and ..., it's ok to do either there shouldn't be any side effects from register_modules but we could consider uniformizing this.

@sayakpaul
Copy link
Member

Fully agree!

@hlky hlky mentioned this pull request Jan 3, 2025
@hlky
Copy link
Collaborator Author

hlky commented Jan 3, 2025

Oh there's actually a reason some of these unet and scheduler checks are before register_modules, they are changing values that in turn are registered to the module's config. Others like unet.config.in_channels and default_sample_size could be after register_modules.

@sayakpaul
Copy link
Member

Oh there's actually a reason some of these unet and scheduler checks are before register_modules, they are changing values that in turn are registered to the module's config. Others like unet.config.in_channels and default_sample_size could be after register_modules.

But I guess that doesn't block this PR no?

@hlky
Copy link
Collaborator Author

hlky commented Jan 7, 2025

But I guess that doesn't block this PR no?

We can leave reorganising as a follow-up.

@sayakpaul
Copy link
Member

You mean the uniformization? If so, yes, I think that is okay. That also doesn't block #10438 I think

@sayakpaul sayakpaul requested a review from yiyixuxu January 8, 2025 02:20
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.

3 participants