You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expanded init fields in StableDiffusionPipeline cause incompatibilities with many/most inherited pipelines #6969
and here image_encoder was recently introduced thus changing the class signature
but most community pipelines do not include init field for recently included image_encoder and thus order or params is wrong
for example, examples/community/regional_prompting_stable_diffusion.py has this in its init:
which means bool value from requires_safety_checker is going to be passed as image_encoder and pipeline will fail during initialization like this:
> diffusers/pipelines/pipeline_utils.py:546 in _fetch_class_library_tuple
AttributeError: 'bool' object has no attribute '__module__'
this is a conceptual problem with changing master class signature while all inherited classes pass args list as simple list.
i don't see a simple solution as going back is bad and going forward requires updates to a lot of pipelines.
but at the very basic, at least add error handling to _fetch_class_library_tuple so invalid type does not cause entire solution to crash.
Reproduction
load nearly any community pipeline or any pipeline inherited from StableDiffusionPipeline, but not updated to use new signature in its super().__init__ call
Hi @vladmandic
It only breaks pipelines that inherit from StableDiffusionPipeline instead of DiffusionPipeine - all our pipelines should inherit from DiffusionPipeline.
I don't consider this a breaking change for this reason. However would very much like to make the community pipelines work correctly again. We can ask the community to help refactor these PRs to use DiffusionPipeline as a base class instead - does this plan work for you?
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Activity
sayakpaul commentedon Feb 14, 2024
Cc: @yiyixuxu
yiyixuxu commentedon Feb 14, 2024
Hi @vladmandic
It only breaks pipelines that inherit from
StableDiffusionPipelineinstead ofDiffusionPipeine- all our pipelines should inherit fromDiffusionPipeline.I don't consider this a breaking change for this reason. However would very much like to make the community pipelines work correctly again. We can ask the community to help refactor these PRs to use
DiffusionPipelineas a base class instead - does this plan work for you?cc @sayakpaul @DN6 here
do you guys have any good ideas?
I think we should start to check the base classes for community pipeline PRs and don't merging in unless they use
DiffusionPipelinesayakpaul commentedon Feb 14, 2024
What you suggested is the best case here as it's the simplest.
yiyixuxu commentedon Feb 14, 2024
@vladmandic
Is this something can be done in SD.Next for a temporary solution while we trying to update all the community pipelines to use
DiffusionPipeline?vladmandic commentedon Feb 14, 2024
thanks - i agree with action plan.
i'll try monkey-patching
_fetch_class_library_tuplefrom sdnext in the meantime.vladmandic commentedon Feb 14, 2024
i confirm that monkey-patching works as as stop-gap solution
github-actions commentedon Mar 15, 2024
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
sayakpaul commentedon Mar 15, 2024
I think this is not stale. @yiyixuxu can you confirm?
github-actions commentedon Apr 9, 2024
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
vladmandic commentedon Apr 9, 2024
ping.
9 remaining items
github-actions commentedon Nov 27, 2024
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
vladmandic commentedon Nov 27, 2024
ping to remove stale
asomoza commentedon Nov 27, 2024
added the wip so it doesn't get stale.
Also added the contributions tags so if people want to contribute we would really appreciate it. This is a good first issue for new comers.
Filippo-Venturini commentedon Oct 31, 2025
Is someone working on this? If not I can give it a chance, do you have a specific list of pipelines that need to be fixed?
sayakpaul commentedon Oct 31, 2025
Feel free to take it away.
Filippo-Venturini commentedon Oct 31, 2025
I think this Issue can be closed as they refactored all the pipelines changing the base class to
DiffusionPipelinehere: #6984 (comment)fix: Add type validation to _fetch_class_library_tuple to prevent cra…