Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fix, albumentations pydantic insightface, onnxruntime-gpu #2761

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

w-e-w
Copy link
Contributor

@w-e-w w-e-w commented Apr 18, 2024

webui 1.9 with gradio==3.41.2 / fastapi==0.94.0 requires

  • pydantic required: >=1.7.4,<3.0.0,!=2.0.1,!=2.0.0,!=1.8.1,!=1.8

webui 1.9 is not compatible with pydantic>=2.0
which causes web UI to not launch

solution for now
in controlnet
pin albumentations==1.4.3 as control net requirement
if albumentations==1.4.3 is installed before insightface pip won't auto install the newest version 1.4.4

I did a quick tested with ip-adapter, all variant seems to work fine after this PR, but today is the first time I use ip-adapter so I'm not sure if it's actually working properly


To get webui back working

pip install albumentations==1.4.3
pip install pydantic==1.10.15
outdated

First

so to "fix" this I've added some code that would revert the pydantic version to what it was after insightface is installed
I'm not sure because I have not played with ip-adapter before
but this downgrading pydantic to 1.10.15 seems to casue ip-adapter_face_id/plus to break


Second issue not as critical
they exist onnxruntime and onnxruntime-gpu
as far as I know they are interchangeable but they cannot coexist in the same environment (unless things has changed since)
in lots of use cases it doesn't really matter if you're running on CPU but for other extensions they might requires the extra performance

so I believe currently it's best to install the GPU version even if you don't need it as long as GPU is available

these are several instances of extensions checking for GPU before installing the appropriate onnxruntime
https://github.com/Gourieff/sd-webui-reactor/blob/main/install.py#L104-L124
Gourieff/sd-webui-reactor#170 (comment)
https://github.com/w-e-w/sd-webui-nudenet-nsfw-censor/blob/main/install.py
https://github.com/aria1th/sd-webui-nsfw-filter/blob/main/install.py
https://github.com/diffus-me/sd-webui-facefusion/blob/main/install.py#L22-L28


other changes

  • pkg_resources -> importlib.metadata
  • I originally changed this because it seems in python3.12 pkg_resources will no longer be pre-installed
    https://docs.python.org/3/whatsnew/3.12.html
    and it seems to work better as in it's able to observe version changes before and after installation of packages
    in previous commit I observedly change in the versions of packages and and reverting it
    not important but since I already change I didn't bother reverting it

@w-e-w w-e-w changed the title Install fix, pydantic insightface Install fix, pydantic insightface, onnxruntime-gpu Apr 18, 2024
dependency incompatibility compatibility with albumentations==1.4.4
whitch requires
- pydantic required: >=2.6.4

webui 1.9 with gradio==3.41.2 / fastapi==0.94.0 requires
- pydantic required: >=1.7.4,<3.0.0,!=2.0.1,!=2.0.0,!=1.8.1,!=1.8

solution for now
pin albumentations==1.4.3 as control net requirement
which doesn't requires pydantic
@w-e-w w-e-w changed the title Install fix, pydantic insightface, onnxruntime-gpu Install fix, albumentations pydantic insightface, onnxruntime-gpu Apr 18, 2024
@w-e-w w-e-w marked this pull request as ready for review April 18, 2024 13:21
@w-e-w
Copy link
Contributor Author

w-e-w commented Apr 18, 2024

@huchenlei

Copy link
Collaborator

@huchenlei huchenlei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for drilling this down!

@huchenlei huchenlei merged commit f6bc98a into Mikubill:main Apr 18, 2024
2 checks passed
@w-e-w
Copy link
Contributor Author

w-e-w commented Apr 18, 2024

you're welcome
and I can sleep now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants