feat: support better reboot mechanism based on comfy-cli
This commit is contained in:
@@ -1112,6 +1112,14 @@ def restart(self):
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
if '__COMFY_CLI_SESSION__' in os.environ:
|
||||
with open(os.path.join(os.environ['__COMFY_CLI_SESSION__'], '.reboot'), 'w') as file:
|
||||
pass
|
||||
|
||||
print(f"\nRestarting...\n\n")
|
||||
exit(0)
|
||||
|
||||
print(f"\nRestarting... [Legacy Mode]\n\n")
|
||||
return os.execv(sys.executable, [sys.executable] + sys.argv)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user