diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

[Community Pipelines] Why does diffusers pipelines get's updated in background? Without permission?

Open adhikjoshi opened this issue 3 years ago • 18 comments

Describe the bug

Now, i have working environment where i see community pipelines get's updated without any explicit updates. And now all production code has stopped working.

I am getting :: AttributeError: 'StableDiffusionLongPromptWeightingPipeline' object has no attribute 'vae_scale_factor' which wasn't there few hours ago.

How can i disable any kind of over the air updates of community pipelines without update of diffusers plugin? @SkyTNT @patil-suraj @patrickvonplaten

Reproduction

  • diffusers==0.8.1

Logs

2022-12-08T17:35:04.544050336Z File "/root/.cache/huggingface/modules/diffusers_modules/git/lpw_stable_diffusion.py", line 879, in text2img 2022-12-08T17:35:04.544055375Z return self.call( 2022-12-08T17:35:04.544068731Z File "/opt/conda/envs/ldm/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context 2022-12-08T17:35:04.544098187Z return func(*args, **kwargs) 2022-12-08T17:35:04.544100210Z File "/root/.cache/huggingface/modules/diffusers_modules/git/lpw_stable_diffusion.py", line 739, in call 2022-12-08T17:35:04.544102274Z latents, init_latents_orig, noise = self.prepare_latents( 2022-12-08T17:35:04.544104308Z File "/root/.cache/huggingface/modules/diffusers_modules/git/lpw_stable_diffusion.py", line 558, in prepare_latents 2022-12-08T17:35:04.544106222Z height // self.vae_scale_factor, 2022-12-08T17:35:04.544108085Z AttributeError: 'StableDiffusionLongPromptWeightingPipeline' object has no attribute 'vae_scale_factor' No response

System Info

  • diffusers==0.8.1

adhikjoshi avatar Dec 08 '22 13:12 adhikjoshi

I'm modifying file ::: root/.cache/huggingface/modules/diffusers_modules/git/lpw_stable_diffusion.py

Which get's auto replaced from git everytime.

Suggestions

  1. Only fetch latest release pipeline files, not from latest commit which often is buggy
  2. Have offline mode
  3. Community pipeline needs to be tested before getting on main repo.

adhikjoshi avatar Dec 08 '22 18:12 adhikjoshi

I'm modifying file ::: root/.cache/huggingface/modules/diffusers_modules/git/lpw_stable_diffusion.py

Which get's auto replaced from git everytime.

Suggestions

1. Only fetch latest release pipeline files, not from latest commit which often is buggy

2. Have offline mode

3. Community pipeline needs to be tested before getting on main repo.

I don't think this is working as desired. I am locked into diffusers=0.8.0 but your changes to LPW are effecting these old versions it seems. Easy Diffusion is broken as wrong things are suddenly passed to it, while version being used is 0.8.0 and shouldn't be received 0.10+ updates. This functionality looks broken.

WASasquatch avatar Dec 08 '22 20:12 WASasquatch

I'm also running into similar problems with diffusers 0.9.0 and have posted a bug report here.

kovtcharov avatar Dec 08 '22 20:12 kovtcharov

Is code automatically pulled from the head of main repo even if we use a specific version of the diffusers library? It seems to be given our recent experience. Maybe we should be pulling a tagged commit or release branch instead since head of main seems to be very active in development.

kovtcharov avatar Dec 08 '22 20:12 kovtcharov

I've tried to replace file to solve error. But it gets updated automatically from git repo.

Tried to block github.com, huggingface.co or even uninstalling wget, curl, git

But nothing works, @SkyTNT @patrickvonplaten

adhikjoshi avatar Dec 09 '22 03:12 adhikjoshi

I'm modifying file ::: root/.cache/huggingface/modules/diffusers_modules/git/lpw_stable_diffusion.py

Which get's auto replaced from git everytime.

Suggestions

1. Only fetch latest release pipeline files, not from latest commit which often is buggy

2. Have offline mode

3. Community pipeline needs to be tested before getting on main repo.

I don't think this is working as desired. I am locked into diffusers=0.8.0 but your changes to LPW are effecting these old versions it seems. Easy Diffusion is broken as wrong things are suddenly passed to it, while version being used is 0.8.0 and shouldn't be received 0.10+ updates. This functionality looks broken.

Can you share option to load img2img and text2img using joblib?

It seems only 1 pipeline is possible to load that way. But i really don't want to use anything community. Any standard way to do it?

adhikjoshi avatar Dec 09 '22 03:12 adhikjoshi

lpw_stable_diffusion compatibility will be fixed in #1622

SkyTNT avatar Dec 09 '22 04:12 SkyTNT

I'm modifying file ::: root/.cache/huggingface/modules/diffusers_modules/git/lpw_stable_diffusion.py Which get's auto replaced from git everytime. Suggestions

1. Only fetch latest release pipeline files, not from latest commit which often is buggy

2. Have offline mode

3. Community pipeline needs to be tested before getting on main repo.

I don't think this is working as desired. I am locked into diffusers=0.8.0 but your changes to LPW are effecting these old versions it seems. Easy Diffusion is broken as wrong things are suddenly passed to it, while version being used is 0.8.0 and shouldn't be received 0.10+ updates. This functionality looks broken.

Can you share option to load img2img and text2img using joblib?

It seems only 1 pipeline is possible to load that way. But i really don't want to use anything community. Any standard way to do it?

You should be able to cache any pipe with the normal joblib.dump() method. I was dumping LPW pipeline just fine and using all it's functionality. Easy Diffusion, before it was updated to use LPW, would cache each pipe (Stable Diffusion text2image, image2image, and inpaint) before first run, so that way it could quickly switch out to desire pipe through a simple condition without the initial setup.

However this method doesn't really seem viable unless local files only is on, which for production isn't an option as people need to be able to load any custom model from HF that they don't have. Probably needs to be some sort of offline_mode which acts like it does now, and a local_files which uses only local models if available, but doesn't update them, but will download models when it doesn't exist.

WASasquatch avatar Dec 09 '22 06:12 WASasquatch

lpw_stable_diffusion compatibility will be fixed in #1622

is there a way to use specific code version? and not automatically use latest one? offline-mode is what needed at this point to avoid community code deployed without any manual update.

adhikjoshi avatar Dec 09 '22 06:12 adhikjoshi

is there a way to use specific code version? and not automatically use latest one? offline-mode is what needed at this point to avoid community code deployed without any manual update.

Download the file and move it to your project. Import StableDiffusionLongPromptWeightingPipeline and use StableDiffusionLongPromptWeightingPipeline.from_pretrained

SkyTNT avatar Dec 09 '22 06:12 SkyTNT

is there a way to use specific code version? and not automatically use latest one? offline-mode is what needed at this point to avoid community code deployed without any manual update.

Download the file and move it to your project. Import StableDiffusionLongPromptWeightingPipeline and use StableDiffusionLongPromptWeightingPipeline.from_pretrained

For future updates for lpw pipeline, please make sure we have 0.8 + diffusers support

adhikjoshi avatar Dec 09 '22 16:12 adhikjoshi

Thanks a lot @SkyTNT for being so responsive here and replying so quickly, that's super nice! For the future we should probably change community pipelines to automatically detect which diffusers version is installed and if it's not the master version we load the community pipeline from previous versions. Wdyt @anton-l @pcuenca @williamberman ?

patrickvonplaten avatar Dec 12 '22 16:12 patrickvonplaten

Thanks a lot @SkyTNT for being so responsive here and replying so quickly, that's super nice! For the future we should probably change community pipelines to automatically detect which diffusers version is installed and if it's not the master version we load the community pipeline from previous versions. Wdyt @anton-l @pcuenca @williamberman ?

So if the user has installed 0.8.0, we would download the pipeline that was released with 0.8.0 as well? Sounds good! Another solutions would be:

  • Use a "keep_local_files" option that doesn't replace an existing file (but then users would have to refresh it when they upgrade).
  • Specify the tag/revision/commit when using custom pipelines.

I think that bringing the version that matches the currently installed version of diffusers should work fine in most cases.

pcuenca avatar Dec 12 '22 17:12 pcuenca

  1. community pipeline versions
  2. Local file only option

These two will fix all problems.

Can choose any commit code Or modify pipeline as i wish to, and use local code.

adhikjoshi avatar Dec 12 '22 18:12 adhikjoshi

Yeah let's use the diffusers version when pulling community pipelines from github, sounds good!

williamberman avatar Dec 12 '22 18:12 williamberman

Maybe we also need to add min version code to community pipelines to check whether the pipelines is compatible with the currently installed diffusers when pulling.

SkyTNT avatar Dec 13 '22 06:12 SkyTNT

Here a PR: https://github.com/huggingface/diffusers/pull/1680

Happy to hear feedback. In short, when not specifying a "custom_version" we default to the version that is locally installed or "main" if the local version has not been published yet. When specifying a "custom_version" this version will be pulled from GitHub.

patrickvonplaten avatar Dec 13 '22 11:12 patrickvonplaten

"main" as in from repo? Why would it pull from main, if the local version isn't published, and thus, likely being developed?

WASasquatch avatar Dec 15 '22 21:12 WASasquatch

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.

github-actions[bot] avatar Jan 13 '23 15:01 github-actions[bot]