2023-01-08 08:09:04 +00:00
"""
InvokeAI Installer
"""
2023-01-10 21:55:57 +00:00
import argparse
2023-07-29 23:19:42 +00:00
import os
2023-02-02 00:03:15 +00:00
from pathlib import Path
2023-08-18 15:13:28 +00:00
2023-01-08 08:09:04 +00:00
from installer import Installer
if __name__ == " __main__ " :
2023-01-10 21:55:57 +00:00
parser = argparse . ArgumentParser ( )
2023-01-17 05:47:36 +00:00
parser . add_argument (
" -r " ,
" --root " ,
dest = " root " ,
type = str ,
help = " Destination path for installation " ,
2023-07-29 23:20:20 +00:00
default = os . environ . get ( " INVOKEAI_ROOT " ) or " ~/invokeai " ,
2023-01-17 05:47:36 +00:00
)
parser . add_argument (
" -y " ,
" --yes " ,
" --yes-to-all " ,
dest = " yes_to_all " ,
action = " store_true " ,
help = " Assume default answers to all questions " ,
default = False ,
)
2023-01-10 21:55:57 +00:00
2023-01-27 07:10:32 +00:00
parser . add_argument (
" --version " ,
dest = " version " ,
help = " Version of InvokeAI to install. Default to the latest stable release. A special ' pre ' value will install the latest published pre-release version. " ,
default = None ,
)
2023-02-02 00:03:15 +00:00
parser . add_argument (
" --find-links " ,
dest = " find_links " ,
help = " Specifies a directory of local wheel files to be searched prior to searching the online repositories. " ,
type = Path ,
default = None ,
)
2023-07-27 14:54:01 +00:00
2023-01-10 21:55:57 +00:00
args = parser . parse_args ( )
2023-01-08 08:09:04 +00:00
inst = Installer ( )
2023-01-10 21:55:57 +00:00
2023-01-08 08:09:04 +00:00
try :
2023-01-17 05:47:36 +00:00
inst . install ( * * args . __dict__ )
2023-08-17 22:45:25 +00:00
except KeyboardInterrupt :
2023-01-08 08:09:04 +00:00
print ( " \n " )
print ( " Ctrl-C pressed. Aborting. " )
2023-01-13 09:10:34 +00:00
print ( " Come back soon! " )