From fcd53c418485f9b2d90459d975a98e039d242531 Mon Sep 17 00:00:00 2001 From: Deepanjan Roy Date: Tue, 10 Jun 2025 21:10:36 -0700 Subject: [PATCH] Warn about no sandbox on non-windows --- main.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index f123d01e0..b5cd543ad 100644 --- a/main.py +++ b/main.py @@ -116,12 +116,15 @@ def execute_prestartup_script(): apply_custom_paths() -if os.name == "nt" and args.enable_sandbox: - # We do not have pywin32 on non-windows platforms, so this import needs to - # be guarded. - from sandbox import windows_sandbox - # Must run before executing custom node prestartup scripts. - try_enable_sandbox() +if args.enable_sandbox: + if os.name == "nt": + # windows_sandbox imports the pywin32 module, which is not available on + # non-windows platforms, so this import needs to be guarded. + from sandbox import windows_sandbox + try_enable_sandbox() + else: + logging.warning("Sandbox mode is not supported on non-windows platforms." + "ComfyUI will run without sandbox.") execute_prestartup_script()