ComfyUI-AnimateAnyone-Evolved icon indicating copy to clipboard operation
ComfyUI-AnimateAnyone-Evolved copied to clipboard

Cannot import name 'PixArtAlphaTextProjection' from 'diffusers.models.embeddings'

Open zeta274 opened this issue 2 years ago • 10 comments

File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\nodes.py", line 22, in from .src.models.unet_2d_condition import UNet2DConditionModel File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\unet_2d_condition.py", line 40, in from .unet_2d_blocks import ( File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\unet_2d_blocks.py", line 15, in from .transformer_2d import Transformer2DModel File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\transformer_2d.py", line 7, in from diffusers.models.embeddings import PixArtAlphaTextProjection ImportError: cannot import name 'PixArtAlphaTextProjection' from 'diffusers.models.embeddings' (D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\embeddings.py)

zeta274 avatar Jan 30 '24 14:01 zeta274

Same problem here...

Traceback (most recent call last): File "C:\code\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1893, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in call_with_frames_removed File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved_init.py", line 8, in module = importlib.import_module(f".{nodes_filename}", package=name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "importlib_init_.py", line 126, in import_module File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\nodes.py", line 22, in from .src.models.unet_2d_condition import UNet2DConditionModel File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\unet_2d_condition.py", line 40, in from .unet_2d_blocks import ( File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\unet_2d_blocks.py", line 15, in from .transformer_2d import Transformer2DModel File "C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved\src\models\transformer_2d.py", line 7, in from diffusers.models.embeddings import PixArtAlphaTextProjection ImportError: cannot import name 'PixArtAlphaTextProjection' from 'diffusers.models.embeddings' (C:\code\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\embeddings.py)

Cannot import C:\code\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateAnyone-Evolved module for custom nodes: cannot import name 'PixArtAlphaTextProjection' from 'diffusers.models.embeddings' (C:\code\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\embeddings.py)

corvo4791 avatar Jan 30 '24 23:01 corvo4791

You need to update " diffusers " to 0.25.1 , Eg. pip install --upgrade diffusers==0.25.1 will add the new embedding .. Then " PixArtAlphaTextProjection " can be found !

ctankep avatar Jan 31 '24 06:01 ctankep

You need to update " diffusers " to 0.25.1 , Eg. pip install --upgrade diffusers==0.25.1 will add the new embedding .. Then " PixArtAlphaTextProjection " can be found !

I did it but this didn't solve the problem. When I send the command: "pip install --upgrade diffusers==0.25.1" Diffusers is installed in Python's "site-packages" folder (the one located in: C:\Users\USERNAME\AppData\Local\Programs\Python\Python310) Maybe, Diffusers must be installed in the "site-packages" of the "python_embeded"?

If yes, how do I do it?

Thanks

corvo4791 avatar Jan 31 '24 13:01 corvo4791

You need to update " diffusers " to 0.25.1 , Eg. pip install --upgrade diffusers==0.25.1 will add the new embedding .. Then " PixArtAlphaTextProjection " can be found !

I did it but this didn't solve the problem. When I send the command: "pip install --upgrade diffusers==0.25.1" Diffusers is installed in Python's "site-packages" folder (the one located in: C:\Users\USERNAME\AppData\Local\Programs\Python\Python310) Maybe, Diffusers must be installed in the "site-packages" of the "python_embeded"?

If yes, how do I do it?

Thanks

Yes, this is the solution, but first, navigate to Python_Embeded and use the Python executable there. So, in that folder: python.exe -m pip install --upgrade diffusers==0.25.1

Important: After doing this, everything worked, however, I had to replace certain modules from the Impact pack with their newer variants that are roughly identical.

zeta274 avatar Jan 31 '24 14:01 zeta274

python.exe -m pip install --upgrade diffusers==0.25.1

DUUUUUDE!!! You saved my life. Everything works perfectly, now. No error messages. THANKS. I'm struggling since yesterday.

corvo4791 avatar Jan 31 '24 14:01 corvo4791

i think im facing simillar problems related to this fix but with comfyui, and the animate anyone addon/plugin. i ran the update diffusers in the pythong embeded forlder of comfyui install but didnt solve my issue and got this message when running the update:

DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063

anythoughts how to fix ?

TomTomGit86 avatar Feb 02 '24 00:02 TomTomGit86

i think im facing simillar problems related to this fix but with comfyui, and the animate anyone addon/plugin. i ran the update diffusers in the pythong embeded forlder of comfyui install but didnt solve my issue and got this message when running the update:

DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063

anythoughts how to fix ?

It is written in Yellow, right? This also happens to me and I think you can ignore it.

corvo4791 avatar Feb 02 '24 00:02 corvo4791

Right ok but this still hasn't fixed my issue with the nodes in animate anyone to be able to use different samplers I know this isn't strictly the thread for that issue but seems similar programs/code have similar issues

TomTomGit86 avatar Feb 02 '24 00:02 TomTomGit86

Hi ,

DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063

This is just saying that torchsde 0.2.5 has a non standard version specifier that is throwing this " deprecation " warning that you can ignore. The fault is because there is an asterisk which won't be recognised once " pip " updates to the next major version and removes support for that and will throw an error.

The issue needs to be fixed in the torchsde repo and the metadata for that package. It's happening because the original maintainers from " google " moved on , and left it as a community maintained project. There is a simple one line fix that has been merged months ago but no new updated version released. You can fix it on your end to remove the warning though next time you install torchsde 0.2.5 it will be there :

— Remove the " .* " inside torchsde-0.2.5.dist-info\METADATA : Requires-Dist: numpy (>=1.19) ; python_version >= "3.7"

— Issue #131 " Malformed Torch SDE package " : [https://github.com/google-research/torchsde/issues/131]

ctankep avatar Feb 02 '24 02:02 ctankep

Hi ,

DEPRECATION: torchsde 0.2.5 has a non-standard dependency specifier numpy>=1.19.*; python_version >= "3.7". pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of torchsde or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at pypa/pip#12063

This is just saying that torchsde 0.2.5 has a non standard version specifier that is throwing this " deprecation " warning that you can ignore. The fault is because there is an asterisk which won't be recognised once " pip " updates to the next major version and removes support for that and will throw an error.

The issue needs to be fixed in the torchsde repo and the metadata for that package. It's happening because the original maintainers from " google " moved on , and left it as a community maintained project. There is a simple one line fix that has been merged months ago but no new updated version released. You can fix it on your end to remove the warning though next time you install torchsde 0.2.5 it will be there :

— Remove the " .* " inside torchsde-0.2.5.dist-info\METADATA : Requires-Dist: numpy (>=1.19) ; python_version >= "3.7"

— Issue #131 " Malformed Torch SDE package " : [google-research/torchsde#131]

In my METADATA there's also this: Requires-Dist: scipy (==1.5.*) ; python_version < "3.7"

Should I also correct it deleting .*, there?

corvo4791 avatar Feb 02 '24 16:02 corvo4791