diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

from diffusers.loaders.autoencoder import FromOriginalVAEMixin fails with ImportError

Open juancamilog opened this issue 1 year ago • 4 comments

On 0.28.2, this

from diffusers.loaders.autoencoder import FromOriginalVAEMixin

will fail with this error

ImportError: cannot import name 'create_diffusers_vae_model_from_ldm' from 'diffusers.loaders.single_file_utils' (/usr/local/lib/python3.10/dist-packages/diffusers/loaders/single_file_utils.py)

If you look at the source code, create_diffusers_vae_model_from_ldm imported here: https://github.com/huggingface/diffusers/blob/0d68ddf3275b20b0d12cfd3d0a9f002fecfe001c/src/diffusers/loaders/autoencoder.py#L18

does not exist here: https://github.com/huggingface/diffusers/blob/0d68ddf3275b20b0d12cfd3d0a9f002fecfe001c/src/diffusers/loaders/single_file_utils.py

This commit removed it: https://github.com/huggingface/diffusers/commit/cb0f3b49cbd9f67c088a8cd8e96e477a6ae47764#diff-46dbaee212aec178869ccc3db97f026579819d5fbffbd4321e7063cf472139f8

juancamilog avatar Jun 07 '24 19:06 juancamilog

Cc: @DN6

sayakpaul avatar Jun 08 '24 02:06 sayakpaul

Possible Fix:

from diffusers.loaders.autoencoder import FromOriginalVAEMixin

to

from diffusers.loaders.single_file_model import FromOriginalModelMixin

because in the commit is it replaced with it at the same way?

NeoGriever avatar Jun 15 '24 05:06 NeoGriever

@DN6 a gentle reminder :)

sayakpaul avatar Jun 15 '24 05:06 sayakpaul

Hi sorry this should have been removed in 0.28. This PR: https://github.com/huggingface/diffusers/pull/8754 removes these deprecated classes in favour of FromOrignalModelMixin

DN6 avatar Jul 03 '24 13:07 DN6

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 Sep 14 '24 15:09 github-actions[bot]

Closing due to inactivity and because it looks like this was answered. Feel free to re-open if there's anything else not addressed sufficiently

a-r-r-o-w avatar Oct 20 '24 23:10 a-r-r-o-w