diff --git a/invokeai/frontend/legacy_launch_invokeai.py b/invokeai/frontend/legacy_launch_invokeai.py new file mode 100644 index 0000000000..349fa5b945 --- /dev/null +++ b/invokeai/frontend/legacy_launch_invokeai.py @@ -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() diff --git a/pyproject.toml b/pyproject.toml index 7d1f833087..645aa17960 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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