diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Reduce duplicated code in stable diffusion pipelines

Open emsi opened this issue 3 years ago • 5 comments

Duplicated code is bad codding practice and makes fixing and changing code harder. This pr removes some of duplicated code from multiple stable diffusion pipelines by making all StableDiffusionPipeline's inherit from StableDiffusionPipeline rather than DiffusionPipeline and placing common functionalities there.

emsi avatar Oct 02 '22 19:10 emsi

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

There's been a lot of discussion on this lately. See #551 if you haven't yet.

keturn avatar Oct 02 '22 20:10 keturn

There's been a lot of discussion on this lately. See #551 if you haven't yet.

I didn't realize that. I've picked the CoreStableDiffusionPipeline suggestion.

emsi avatar Oct 03 '22 18:10 emsi

Hey @emsi,

Thanks a lot for the PR - it's super useful to see what code is shared between pipelines! Given that there was a lot of discussion on #551 that concluded on a slightly different design and given that #551 is blocked by https://github.com/huggingface/diffusers/issues/336 would it be ok if we wait with this PR 1 week?

Would love to work with you to get something similar to this merged though to close @336 then

patrickvonplaten avatar Oct 04 '22 13:10 patrickvonplaten

would it be ok if we wait with this PR 1 week?

Absolutely. Feel free to do with this PR whatever makes sense. I started it when I realized that there's a lot of code duplication that required me to repeat the same modification multiple times. I was not aware of any work on that at that time.

emsi avatar Oct 04 '22 13:10 emsi

I think we can close this as we have the copy mechanism now in place to solve https://github.com/huggingface/diffusers/issues/551

patrickvonplaten avatar Nov 16 '22 07:11 patrickvonplaten