mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-19 03:13:01 +08:00
feat: support better reboot mechanism based on comfy-cli
This commit is contained in:
parent
4c8635d893
commit
12a364dd6a
@ -21,7 +21,7 @@ sys.path.append(glob_path)
|
|||||||
import cm_global
|
import cm_global
|
||||||
from manager_util import *
|
from manager_util import *
|
||||||
|
|
||||||
version = [2, 21, 3]
|
version = [2, 22]
|
||||||
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
||||||
|
|
||||||
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
|
|||||||
@ -1112,6 +1112,14 @@ def restart(self):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
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)
|
return os.execv(sys.executable, [sys.executable] + sys.argv)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user