Try use cu121 (#591)

* Try use cu121

* Try use cu121

* Try use cu121
This commit is contained in:
lllyasviel 2023-10-08 23:13:43 -07:00 committed by GitHub
parent 71e9ebc7a2
commit 76708ce286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 19 deletions

View File

@ -1 +1 @@
version = '2.1.24' version = '2.1.25'

View File

@ -10,19 +10,19 @@ from modules.launch_util import is_installed, run, python, \
from modules.model_loader import load_file_from_url from modules.model_loader import load_file_from_url
from modules.path import modelfile_path, lorafile_path, vae_approx_path, fooocus_expansion_path, upscale_models_path from modules.path import modelfile_path, lorafile_path, vae_approx_path, fooocus_expansion_path, upscale_models_path
REINSTALL_ALL = False REINSTALL_ALL = False
TRY_INSTALL_XFORMERS = False
def prepare_environment(): def prepare_environment():
torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu118") torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu121")
torch_command = os.environ.get('TORCH_COMMAND', torch_command = os.environ.get('TORCH_COMMAND',
f"pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url {torch_index_url}") f"pip install torch==2.1.0 torchvision==0.16.0 --extra-index-url {torch_index_url}")
requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt") requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt")
xformers_package = os.environ.get('XFORMERS_PACKAGE', 'xformers==0.0.20')
comfy_repo = os.environ.get('COMFY_REPO', "https://github.com/comfyanonymous/ComfyUI") comfy_repo = os.environ.get('COMFY_REPO', "https://github.com/comfyanonymous/ComfyUI")
comfy_commit_hash = os.environ.get('COMFY_COMMIT_HASH', "1c5d6663faf1a33e00ec67240167b174a9cac655") comfy_commit_hash = os.environ.get('COMFY_COMMIT_HASH', "c16f5744e306fb042363767d771da68929f088d8")
print(f"Python {sys.version}") print(f"Python {sys.version}")
print(f"Fooocus version: {fooocus_version.version}") print(f"Fooocus version: {fooocus_version.version}")
@ -34,18 +34,20 @@ def prepare_environment():
if REINSTALL_ALL or not is_installed("torch") or not is_installed("torchvision"): if REINSTALL_ALL 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) run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
if REINSTALL_ALL or not is_installed("xformers"): if TRY_INSTALL_XFORMERS:
if platform.system() == "Windows": if REINSTALL_ALL or not is_installed("xformers"):
if platform.python_version().startswith("3.10"): xformers_package = os.environ.get('XFORMERS_PACKAGE', 'xformers==0.0.20')
run_pip(f"install -U -I --no-deps {xformers_package}", "xformers", live=True) if platform.system() == "Windows":
else: if platform.python_version().startswith("3.10"):
print("Installation of xformers is not supported in this version of Python.") run_pip(f"install -U -I --no-deps {xformers_package}", "xformers", live=True)
print( else:
"You can also check this and build manually: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers#building-xformers-on-windows-by-duckness") print("Installation of xformers is not supported in this version of Python.")
if not is_installed("xformers"): print(
exit(0) "You can also check this and build manually: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers#building-xformers-on-windows-by-duckness")
elif platform.system() == "Linux": if not is_installed("xformers"):
run_pip(f"install -U -I --no-deps {xformers_package}", "xformers") exit(0)
elif platform.system() == "Linux":
run_pip(f"install -U -I --no-deps {xformers_package}", "xformers")
if REINSTALL_ALL or not requirements_met(requirements_file): if REINSTALL_ALL or not requirements_met(requirements_file):
run_pip(f"install -r \"{requirements_file}\"", "requirements") run_pip(f"install -r \"{requirements_file}\"", "requirements")

View File

@ -160,7 +160,7 @@ Or if you want to open a remote port, use
### Linux (AMD GPUs) ### Linux (AMD GPUs)
Coming soon ... Same with the above instructions. Not intensively tested, however.
### Mac/Windows(AMD GPUs) ### Mac/Windows(AMD GPUs)