Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/diffusers/pipelines/auto_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@ def from_pipe(cls, pipeline, **kwargs):
if k not in text_2_image_kwargs
}

missing_modules = set(expected_modules) - set(pipeline._optional_components) - set(text_2_image_kwargs.keys())
missing_modules = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think maybe

missing_modules = set(expected_modules) - set(text_2_image_cls._optional_components) - set(text_2_image_kwargs.keys())

Because if one component is optional for the other pipe (the pipe as in .from_pipe(pipe)) but it's not optional for the target pipe (text_2_image here) - it is still missing, no?

Just a thought: I didn't run any tests, I think it might a bug we had and was able to get away with this because the _optional_componentes is usually the same among different tasks for the same model group

so please let me know if it is the case:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, thanks

set(expected_modules) - set(text_2_image_cls._optional_components) - set(text_2_image_kwargs.keys())
)

if len(missing_modules) > 0:
raise ValueError(
Expand Down Expand Up @@ -838,7 +840,9 @@ def from_pipe(cls, pipeline, **kwargs):
if k not in image_2_image_kwargs
}

missing_modules = set(expected_modules) - set(pipeline._optional_components) - set(image_2_image_kwargs.keys())
missing_modules = (
set(expected_modules) - set(image_2_image_cls._optional_components) - set(image_2_image_kwargs.keys())
)

if len(missing_modules) > 0:
raise ValueError(
Expand Down Expand Up @@ -1141,7 +1145,9 @@ def from_pipe(cls, pipeline, **kwargs):
if k not in inpainting_kwargs
}

missing_modules = set(expected_modules) - set(pipeline._optional_components) - set(inpainting_kwargs.keys())
missing_modules = (
set(expected_modules) - set(inpainting_cls._optional_components) - set(inpainting_kwargs.keys())
)

if len(missing_modules) > 0:
raise ValueError(
Expand Down
Loading