Skip to content

Conversation

@Haoming02
Copy link
Contributor

Description

  • Simple Description: uv is "an extremely fast Python package and project manager, written in Rust"; it will speed up the installation process, especially during repeated installation where packages are already cached

  • Summary of Changes:

    1. Add a new uv_hook.py script, which replaces python -m pip with uv pip when calling subprocess.run (eg. run_pip) if applicable
    2. Add a new flag --uv to the cmd_args
  • How to Use: add the following flag to the COMMANDLINE_ARGS

--uv

Checklist

@Haoming02
Copy link
Contributor Author

This method supports:

  • User installs a system-wide uv
  • User manually creates a venv using uv
  • User additionally installs uv in a regular python -m venv venv

@w-e-w
Copy link
Collaborator

w-e-w commented Feb 28, 2025

I did some testing and found that xformes have trouble installing when installed by UV because of -I
so I added -I to the BAD_FLAGS

I also implemented a fallback to pip if retrun code is not 0, as they're likely other flags that are used that are not supported by uv

additionally I add in
"if uv is not installed auto install uv via pip"

Copy link
Collaborator

@w-e-w w-e-w left a comment

Choose a reason for hiding this comment

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

using uv, improves the install time around 2x in my pc
from 2 minutes 55 seconds down to 1 minute 25 seconds

@w-e-w w-e-w merged commit d8688de into AUTOMATIC1111:dev Feb 28, 2025
3 checks passed
@silvertuanzi
Copy link

Not work properly on Linux: #17137

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.

3 participants