|
|
|
|
@ -8,6 +8,7 @@ import re
|
|
|
|
|
from fastapi import FastAPI
|
|
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
|
from fastapi.middleware.gzip import GZipMiddleware
|
|
|
|
|
from packaging import version
|
|
|
|
|
|
|
|
|
|
from modules import import_hook, errors, extra_networks
|
|
|
|
|
from modules import extra_networks_hypernet, ui_extra_networks_hypernets, ui_extra_networks_textual_inversion
|
|
|
|
|
@ -49,7 +50,32 @@ else:
|
|
|
|
|
server_name = "0.0.0.0" if cmd_opts.listen else None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def check_versions():
|
|
|
|
|
expected_torch_version = "1.13.1"
|
|
|
|
|
|
|
|
|
|
if version.parse(torch.__version__) < version.parse(expected_torch_version):
|
|
|
|
|
errors.print_error_explanation(f"""
|
|
|
|
|
You are running torch {torch.__version__}.
|
|
|
|
|
The program is tested to work with torch {expected_torch_version}.
|
|
|
|
|
To reinstall the desired version, run with commandline flag --reinstall-torch.
|
|
|
|
|
Beware that this will cause a lot of large files to be downloaded.
|
|
|
|
|
""".strip())
|
|
|
|
|
|
|
|
|
|
expected_xformers_version = "0.0.16rc425"
|
|
|
|
|
if shared.xformers_available:
|
|
|
|
|
import xformers
|
|
|
|
|
|
|
|
|
|
if version.parse(xformers.__version__) < version.parse(expected_xformers_version):
|
|
|
|
|
errors.print_error_explanation(f"""
|
|
|
|
|
You are running xformers {xformers.__version__}.
|
|
|
|
|
The program is tested to work with xformers {expected_xformers_version}.
|
|
|
|
|
To reinstall the desired version, run with commandline flag --reinstall-xformers.
|
|
|
|
|
""".strip())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def initialize():
|
|
|
|
|
check_versions()
|
|
|
|
|
|
|
|
|
|
extensions.list_extensions()
|
|
|
|
|
localization.list_localizations(cmd_opts.localizations_dir)
|
|
|
|
|
|
|
|
|
|
|