restore ability to launch web server with invokeai --web

This commit is contained in:
Lincoln Stein 2023-07-07 10:07:15 -04:00
parent 56f4712814
commit 8d88ad3b8d
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,19 @@
import os
import sys
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--web', action='store_true')
opts,_ = parser.parse_known_args()
if opts.web:
sys.argv.pop(sys.argv.index('--web'))
from invokeai.app.api_app import invoke_api
invoke_api()
else:
from invokeai.app.cli_app import invoke_cli
invoke_cli()
if __name__ == '__main__':
main()

View File

@ -112,7 +112,11 @@ dependencies = [
"textual_inversion.py" = "invokeai.frontend.training:invokeai_textual_inversion"
# shortcut commands to start cli and web
"invokeai" = "invokeai.app.cli_app:invoke_cli"
# "invokeai --web" will launch the web interface
# "invokeai" will launch the CLI
"invokeai" = "invokeai.frontend.legacy_launch_invokeai:main"
# new shortcut to launch web interface
"invokeai-web" = "invokeai.app.api_app:invoke_api"
# full commands