Skip to content

Commit 1719ac7

Browse files
committed
Warn about no sandbox on non-windows
1 parent 4fa56ae commit 1719ac7

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

main.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,15 @@ def execute_script(script_path):
117117

118118
apply_custom_paths()
119119

120-
if os.name == "nt" and args.enable_sandbox:
121-
# We do not have pywin32 on non-windows platforms, so this import needs to
122-
# be guarded.
123-
from sandbox import windows_sandbox
124-
# Must run before executing custom node prestartup scripts.
125-
try_enable_sandbox()
120+
if args.enable_sandbox:
121+
if os.name == "nt":
122+
# windows_sandbox imports the pywin32 module, which is not available on
123+
# non-windows platforms, so this import needs to be guarded.
124+
from sandbox import windows_sandbox
125+
try_enable_sandbox()
126+
else:
127+
logging.warning("Sandbox mode is not supported on non-windows platforms."
128+
"ComfyUI will run without sandbox.")
126129

127130
execute_prestartup_script()
128131

0 commit comments

Comments
 (0)