-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[Modular] loader related #13025
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
[Modular] loader related #13025
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2142,6 +2142,8 @@ def load_components(self, names: Optional[Union[List[str], str]] = None, **kwarg | |
| name | ||
| for name in self._component_specs.keys() | ||
| if self._component_specs[name].default_creation_method == "from_pretrained" | ||
| and self._component_specs[name].pretrained_model_name_or_path is not None | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am guessing
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is up to the user. We work with Unlike This one was automatically converted from a regular Qwen Pipeline: ModularPipeline.from_pretrained("Qwen/Qwen-Image").save_pretrained()So it has all the Custom ones can be all empty to start with: MyCustomBlock.init_pipeline().save_pretrained()Another example: https://huggingface.co/diffusers/flux2-bnb-4bit-modular/blob/main/modular_model_index.json#L49 Here we updated the So it's very flexible - and I think it's expected behavior that if
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense, thanks for explaining. I was missing the point on the latter. |
||
| and getattr(self, name, None) is None | ||
| ] | ||
| elif isinstance(names, str): | ||
| names = [names] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with this change, now, by default with
pipeline.load_components():pretrained_model_name_or_pathfor (1), currently, under the
main, if we run script below, we will load thetext_encoder, add it to the pipeline withupdate_components, and then reload again when you runload_components()- which is a bit unintuitive I thinkin this PR, it will skip text_encoder instead of loading all components
for (2), in main, if you run this
you would get a confusing message like this
this is because controlnet is a component in qwen auto pipeline, but not included in
Qwen/Qwen-Image; in this PR, we just skip it by default and not sending any message - I think it is more of an expected behavior