Skip to content

Commit

Permalink
Add warning (#172)
Browse files Browse the repository at this point in the history
* mv portalocker

* add error message

* dont move pl
  • Loading branch information
ljleb authored Nov 3, 2023
1 parent 7dd908a commit b2cb209
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions lib_comfyui/comfyui_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion lib_comfyui/webui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def is_webui_server_remote():
return any(
bool(getattr(shared.cmd_opts, opt, False))
for opt in (
"listen",
"share",
"ngrok",

Expand All @@ -215,7 +216,7 @@ def is_webui_server_remote():
"jprq",
"bore",
"googleusercontent",
"tunnel-webhook",
"tunnel_webhook",
)
)

Expand Down

0 comments on commit b2cb209

Please sign in to comment.