@@ -39,7 +39,7 @@ def check_python_version():
3939 micro = sys .version_info .micro
4040
4141 if is_windows :
42- supported_minors = [10 ]
42+ supported_minors = [10 , 11 ]
4343 else :
4444 supported_minors = [7 , 8 , 9 , 10 , 11 ]
4545
@@ -50,16 +50,12 @@ def check_python_version():
5050 f"""
5151INCOMPATIBLE PYTHON VERSION
5252
53- This program is tested with 3.10.6 Python, but you have { major } .{ minor } .{ micro } .
53+ This program is tested with 3.11 Python, but you have { major } .{ minor } .{ micro } .
5454If you encounter an error with "RuntimeError: Couldn't install torch." message,
5555or any other error regarding unsuccessful package (library) installation,
56- please downgrade (or upgrade) to the latest version of 3.10 Python
56+ please downgrade (or upgrade) to the latest version of 3.11 Python
5757and delete current Python and "venv" folder in WebUI's directory.
5858
59- You can download 3.10 Python from here: https://www.python.org/downloads/release/python-3106/
60-
61- { "Alternatively, use a binary release of WebUI: https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.0.0-pre" if is_windows else "" }
62-
6359Use --skip-python-version-check to suppress this warning.
6460"""
6561 )
@@ -434,19 +430,19 @@ def prepare_environment():
434430 system = platform .system ()
435431 nvidia_driver_found = False
436432 backend = "cuda"
437- torch_command = "pip install torch==2.7.0 torchvision --extra-index-url https://download.pytorch.org/whl/cu121"
433+ torch_command = "pip install torch==2.7.0 torchvision numpy==1.26.4 --extra-index-url https://download.pytorch.org/whl/cu121"
438434
439435 if args .use_cpu_torch :
440436 backend = "cpu"
441437 torch_command = os .environ .get (
442438 "TORCH_COMMAND" ,
443- "pip install torch==2.7.0 torchvision" ,
439+ "pip install torch==2.7.0 torchvision numpy==1.26.4 " ,
444440 )
445441 elif args .use_directml :
446442 backend = "directml"
447443 torch_command = os .environ .get (
448444 "TORCH_COMMAND" ,
449- "pip install torch torchvision torch-directml" ,
445+ "pip install torch==2.4.1 torchvision torch-directml numpy==1.26.4 " ,
450446 )
451447 args .skip_python_version_check = True
452448 elif args .use_zluda :
@@ -484,7 +480,7 @@ def prepare_environment():
484480 )
485481 torch_command = os .environ .get (
486482 "TORCH_COMMAND" ,
487- f"pip install torch==2.7.0 torchvision - -index-url { torch_index_url } " ,
483+ f"pip install torch==2.7.0 torchvision numpy==1.26.4 --extra -index-url { torch_index_url } " ,
488484 )
489485 else :
490486 nvidia_driver_found = shutil .which ("nvidia-smi" ) is not None
@@ -496,7 +492,7 @@ def prepare_environment():
496492 )
497493 torch_command = os .environ .get (
498494 "TORCH_COMMAND" ,
499- f"pip install torch==2.7.0 torchvision --extra-index-url { torch_index_url } " ,
495+ f"pip install torch==2.7.0 torchvision numpy==1.26.4 --extra-index-url { torch_index_url } " ,
500496 )
501497
502498 requirements_file = os .environ .get ('REQS_FILE' , "requirements_versions.txt" )
@@ -593,13 +589,13 @@ def prepare_environment():
593589 if error is None :
594590 try :
595591 zluda_installer .load ()
596- torch_command = os .environ .get ('TORCH_COMMAND' , 'pip install torch==2.7.0 torchvision - -index-url https://download.pytorch.org/whl/cu118' )
592+ torch_command = os .environ .get ('TORCH_COMMAND' , 'pip install torch==2.7.0 torchvision numpy==1.26.4 --extra -index-url https://download.pytorch.org/whl/cu118' )
597593 except Exception as e :
598594 error = e
599595 print (f'Failed to load ZLUDA: { e } ' )
600596 if error is not None :
601597 print ('Using CPU-only torch' )
602- torch_command = os .environ .get ('TORCH_COMMAND' , 'pip install torch torchvision' )
598+ torch_command = os .environ .get ('TORCH_COMMAND' , 'pip install torch==2.7.0 torchvision numpy==1.26.4 ' )
603599
604600 if rocm .is_wsl :
605601 rocm .load_hsa_runtime ()
0 commit comments