From b2cb209e0f0286aa5a5ff42ab78862a8168f196a Mon Sep 17 00:00:00 2001 From: ljleb Date: Fri, 3 Nov 2023 05:28:41 -0400 Subject: [PATCH] Add warning (#172) * mv portalocker * add error message * dont move pl --- lib_comfyui/comfyui_process.py | 17 +++++++++++++++++ lib_comfyui/webui/settings.py | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib_comfyui/comfyui_process.py b/lib_comfyui/comfyui_process.py index 7f09376..7abd396 100644 --- a/lib_comfyui/comfyui_process.py +++ b/lib_comfyui/comfyui_process.py @@ -67,6 +67,23 @@ def get_comfyui_env(comfyui_install_location): if 'PYTHONPATH' in comfyui_env: del comfyui_env['PYTHONPATH'] + problematic_windows_tmp_dirs = { + k: v + for k, v in comfyui_env.items() + if k in ("TMP", "TEMP") and v == "tmp" + } + if os.name == "nt" and problematic_windows_tmp_dirs: + problematic_windows_tmp_dirs = " and ".join(f'{k}="{v}"' for k, v in problematic_windows_tmp_dirs.items()) + message_prefix = "[sd-webui-comfyui] " + print( + "\n".join([ + f'{message_prefix}Found {problematic_windows_tmp_dirs} in the environment. On Windows, this is known to cause issues.', + f'{message_prefix}If ComfyUI refuses to start, consider using TEMP="temp" or TMP="temp" as a workaround.', + f'{message_prefix}For more information, see https://github.com/ModelSurge/sd-webui-comfyui/issues/170#issuecomment-1792009789', + ]), + file=sys.stderr, + ) + comfyui_env['SD_WEBUI_COMFYUI_EXTENSION_DIR'] = settings.get_extension_base_dir() comfyui_env['SD_WEBUI_COMFYUI_IPC_STRATEGY_CLASS_NAME'] = global_state.ipc_strategy_class.__name__ return comfyui_env diff --git a/lib_comfyui/webui/settings.py b/lib_comfyui/webui/settings.py index 653cad1..0534cc4 100644 --- a/lib_comfyui/webui/settings.py +++ b/lib_comfyui/webui/settings.py @@ -205,6 +205,7 @@ def is_webui_server_remote(): return any( bool(getattr(shared.cmd_opts, opt, False)) for opt in ( + "listen", "share", "ngrok", @@ -215,7 +216,7 @@ def is_webui_server_remote(): "jprq", "bore", "googleusercontent", - "tunnel-webhook", + "tunnel_webhook", ) )