Add --nowebui flag for pure API mode (#4651)
This commit is contained in:
parent
0fa1af296c
commit
ef6feedeb2
4 changed files with 22 additions and 11 deletions
24
server.py
24
server.py
|
@ -226,13 +226,19 @@ if __name__ == "__main__":
|
|||
|
||||
shared.generation_lock = Lock()
|
||||
|
||||
# Launch the web UI
|
||||
create_interface()
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
if shared.need_restart:
|
||||
shared.need_restart = False
|
||||
if shared.args.nowebui:
|
||||
# Start the API in standalone mode
|
||||
shared.args.extensions = [x for x in shared.args.extensions if x != 'gallery']
|
||||
if shared.args.extensions is not None and len(shared.args.extensions) > 0:
|
||||
extensions_module.load_extensions()
|
||||
else:
|
||||
# Launch the web UI
|
||||
create_interface()
|
||||
while True:
|
||||
time.sleep(0.5)
|
||||
shared.gradio['interface'].close()
|
||||
time.sleep(0.5)
|
||||
create_interface()
|
||||
if shared.need_restart:
|
||||
shared.need_restart = False
|
||||
time.sleep(0.5)
|
||||
shared.gradio['interface'].close()
|
||||
time.sleep(0.5)
|
||||
create_interface()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue