File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 44'''
55import os
66import platform
7+ import psutil
78import requests
89from rich import box , print
9- from rich .console import Console , Group , group
10+ from rich .console import Console , group
1011from rich .panel import Panel
1112from rich .prompt import Prompt
1213from rich .style import Style
13- from rich .syntax import Syntax
14- from rich .text import Text
1514
1615from ldm .invoke import __version__
1716
3231def get_versions ()-> dict :
3332 return requests .get (url = INVOKE_AI_REL ).json ()
3433
34+ def invokeai_is_running ()-> bool :
35+ for p in psutil .process_iter ():
36+ cmdline = p .cmdline ()
37+ matches = [x for x in cmdline if x .endswith ('invokeai' )]
38+ if matches :
39+ print (f':exclamation: [bold red]An InvokeAI instance appears to be running as process { p .pid } [/red bold]' )
40+ return True
41+ return False
42+
43+
3544def welcome (versions : dict ):
3645
3746 @group ()
@@ -62,6 +71,10 @@ def text():
6271
6372def main ():
6473 versions = get_versions ()
74+ if invokeai_is_running ():
75+ print (f':exclamation: [bold red]Please terminate all running instances of InvokeAI before updating.[/red bold]' )
76+ return
77+
6578 welcome (versions )
6679
6780 tag = None
You can’t perform that action at this time.
0 commit comments