diff --git a/TODO.md b/TODO.md index 15d9a23b6..e04d5a361 100644 --- a/TODO.md +++ b/TODO.md @@ -62,5 +62,7 @@ Tech that can be integrated as part of the core workflow... - fix VAE dtype should fix most issues with NaN or black images - add built-in Gradio themes +- fix setup race conditions - fix requirements - more AMD specific work +- additional PR merges diff --git a/launch.py b/launch.py index 3c209160a..8c00b7c4a 100644 --- a/launch.py +++ b/launch.py @@ -14,7 +14,7 @@ from rich import print # pylint: disable=redefined-builtin,wrong-import-order commandline_args = os.environ.get('COMMANDLINE_ARGS', "") sys.argv += shlex.split(commandline_args) -setup.extensions_preload() +setup.extensions_preload(force=False) setup.parse_args() args, _ = modules.cmd_args.parser.parse_known_args() script_path = modules.paths_internal.script_path @@ -93,7 +93,7 @@ def run_extension_installer(ext_dir): if __name__ == "__main__": setup.run_setup() setup.set_environment() - setup.extensions_preload() + setup.extensions_preload(force=True) setup.log.info(f"Server arguments: {sys.argv[1:]}") setup.log.debug('Starting WebUI') logging.disable(logging.INFO) diff --git a/setup.py b/setup.py index e38003cbe..d78638723 100644 --- a/setup.py +++ b/setup.py @@ -471,7 +471,7 @@ def parse_args(): args = parser.parse_args() -def extensions_preload(): +def extensions_preload(force = False): setup_time = 0 if os.path.isfile('setup.log'): with open('setup.log', 'r', encoding='utf8') as f: @@ -479,7 +479,7 @@ def extensions_preload(): for line in lines: if 'Setup complete without errors' in line: setup_time = int(line.split(' ')[-1]) - if setup_time > 0: + if setup_time > 0 or force: log.info('Running extension preloading') from modules.script_loading import preload_extensions from modules.paths_internal import extensions_builtin_dir, extensions_dir