-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Adding UV installation instructions to README #6349
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
base: master
Are you sure you want to change the base?
Conversation
uv is great.
Also, I believe simply adding the requirements is not enough if you want CUDA or RoCM torch? Have you tried setting any of this stuff up in pyproject.toml? https://docs.astral.sh/uv/guides/integration/pytorch/ Would be great to have something like:
|
Hi there, thanks to asking... I did not stress the command because I don't have an easy way to do it (multiple SOs). About |
…er, project is interpreted as ready from uv.
@robinjhuang I updated the READ.me as I tested with the other PR #6386 |
@dsantiago What are your thoughts on adding the pytorch as optional dependencies? uv supports configuring accelerator-specific dependencies like this. Now you can install ComfyUI simply by running:
|
It's a great idea @robinjhuang. I was just thinking in something easy for a fresh install but this one should be even better if we explain it well in the docs... |
FYI uv does not contain pip by default, so you may need to include pip as optional dependency as some third party extensions use calls such as Or shim the pip to call uv pip. Here's how I am presently doing this:
import sys
import subprocess
sys.exit(subprocess.call(['uv', 'pip'] + sys.argv[1:])) Then register it to python by setting env var Please note that since not all pip features are available in uv's pip which may break if someone is using pip specific flags viz. |
Could you provide an example for reference? Is that part of automated install or just instructions for manual install?
It is nice, but IIRC it is not always compatible due to how PyTorch publishes their wheels. IIRC The issue with PyTorch wheels IIRC was notable with CPU package difference between AMD64 and ARM64 platforms. They were inconsistent. UV also was a bit limited (at least at the time) when it came to installing these packages from PyTorch, you could not as easily set version constraints when specifiers were involved, but not using specifiers would also have related torch packages resolve the wrong torch package. I guess they've possible fixed that concern, but you might still have an issue with ARM64 compatibility. If so adding a disclaimer might be needed 😅 |
Comyui model manager auto installs packages using https://github.com/hayden-fr/ComfyUI-Model-Manager/blob/main/__init__.py#L16-L29 Of course a lot of people who uses it tend to rely on these tools to manage their dependencies rather than doing manually. |
Btw there's a flag for uv to auto-resolve pytorch. https://docs.astral.sh/uv/guides/integration/pytorch/#automatic-backend-selection Experimental though. |
Awesome thanks! :)
This is unlikely to work in environments like building containers, especially when the build host is not equipped with a GPU (such as GH Actions). Relying upon that would need to communicate why the install method fails in such environments where it'd be unsupported. EDIT: Oh you can set an explicit version. It'd still need to be clear it's only for CUDA, not AMD/Intel equivalent. |
As UV gains traction as a package management tool, I'm adding instructions to READ.me for those who have the interest to install and better control the package usage.