From d8ee920f342517e50dd2811d5a3f2e52044a8e0b Mon Sep 17 00:00:00 2001 From: Kavya Mali <111480325+kavya2904@users.noreply.github.com> Date: Mon, 20 Oct 2025 02:14:05 +0530 Subject: [PATCH] Update launch_utils.py Lines 380-382 if args.reinstall_torch or not is_installed("torch") or not is_installed("torchvision"): run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True) startup_timer.record("install torch") have been replaced with: if args.reinstall_torch or not is_installed("torch") or not is_installed("torchvision"): # Skipping automatic torch install; using manually installed torch 1.12.1 + cu113 print("Skipping torch installation. Using existing torch 1.12.1 + cu113.") startup_timer.record("install torch") , which forces A1111 to use the legacy pytorch installed in venv. --- modules/launch_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/launch_utils.py b/modules/launch_utils.py index 20c7dc127..1463900a6 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -378,9 +378,11 @@ def prepare_environment(): print(f"Commit hash: {commit}") if args.reinstall_torch or not is_installed("torch") or not is_installed("torchvision"): - run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True) - startup_timer.record("install torch") + # Skipping automatic torch install; using manually installed torch 1.12.1 + cu113 + print("Skipping torch installation. Using existing torch 1.12.1 + cu113.") + startup_timer.record("install torch") + if args.use_ipex: args.skip_torch_cuda_test = True if not args.skip_torch_cuda_test and not check_run_python("import torch; assert torch.cuda.is_available()"): @@ -480,3 +482,4 @@ def dump_sysinfo(): file.write(text) return filename +