2023-07-07 14:07:15 +00:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import argparse
|
|
|
|
|
2023-07-27 14:54:01 +00:00
|
|
|
|
2023-07-07 14:07:15 +00:00
|
|
|
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
|
2023-07-27 14:54:01 +00:00
|
|
|
|
2023-07-07 14:07:15 +00:00
|
|
|
invoke_api()
|
|
|
|
else:
|
|
|
|
from invokeai.app.cli_app import invoke_cli
|
2023-07-27 14:54:01 +00:00
|
|
|
|
2023-07-07 14:07:15 +00:00
|
|
|
invoke_cli()
|
|
|
|
|
2023-07-27 14:54:01 +00:00
|
|
|
|
2023-07-07 14:07:15 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|