diff --git a/modules/launch_utils.py b/modules/launch_utils.py index 20c7dc127..8d0de26a7 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -317,7 +317,11 @@ def requirements_met(requirements_file): def prepare_environment(): torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu121") - torch_command = os.environ.get('TORCH_COMMAND', f"pip install torch==2.1.2 torchvision==0.16.2 --extra-index-url {torch_index_url}") + + # Use more flexible PyTorch version handling to support newer Python versions + default_torch_command = f"pip install torch torchvision --extra-index-url {torch_index_url}" + torch_command = os.environ.get('TORCH_COMMAND', default_torch_command) + if args.use_ipex: if platform.system() == "Windows": # The "Nuullll/intel-extension-for-pytorch" wheels were built from IPEX source for Intel Arc GPU: https://github.com/intel/intel-extension-for-pytorch/tree/xpu-main diff --git a/requirements_versions.txt b/requirements_versions.txt index 0306ce94f..809e4ad13 100644 --- a/requirements_versions.txt +++ b/requirements_versions.txt @@ -23,7 +23,7 @@ psutil==5.9.5 pytorch_lightning==1.9.4 resize-right==0.0.2 safetensors==0.4.2 -scikit-image==0.21.0 +scikit-image==0.22.0 spandrel==0.3.4 spandrel-extra-arches==0.1.1 tomesd==0.1.3 diff --git a/webui-macos-env.sh b/webui-macos-env.sh index 00a36e177..acb24515b 100644 --- a/webui-macos-env.sh +++ b/webui-macos-env.sh @@ -9,9 +9,9 @@ export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae export PYTORCH_ENABLE_MPS_FALLBACK=1 if [[ "$(sysctl -n machdep.cpu.brand_string)" =~ ^.*"Intel".*$ ]]; then - export TORCH_COMMAND="pip install torch==2.1.2 torchvision==0.16.2" + export TORCH_COMMAND="pip install torch torchvision" else - export TORCH_COMMAND="pip install torch==2.3.1 torchvision==0.18.1" + export TORCH_COMMAND="pip install torch torchvision" fi ####################################################################