Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/launch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions webui-macos-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

####################################################################
Loading